CDON interview question

what is a deadlock and how do you avoid it