NVIDIA Interview Question

Explain deadlock and how to avoid it.