Bank of America Interview Question

Write code for deadlock?