Bank of America interview question

Write code for deadlock?