Qualcomm Interview Question

what is deadlock? how to prevent it?