Qualcomm interview question

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