Hexaware Technologies Interview Question

What is a deadlock and how can it be avoided?