Société Générale Interview Question

how to prevent deadlock in java multithreading