Société Générale interview question

how to prevent deadlock in java multithreading