Pregunta de entrevista de Qualcomm

Explain a deadlock and design a simple solution for the same.