Microsoft interview question

How do you guarantee that there is no deadlock?