Morgan Stanley Interview Question

Multi-thread stuff like deadlock. How to avoid them.