Microsoft Interview Question

How do you guarantee that there is no deadlock?