JPMorganChase interview question

Implement a deadlock in any programming language.

Interview Answer

Anonymous

18 Sept 2014

I screwed this one up as I hadn't seen deadlocks in a while. Basically you need to start two threads which use two resources. Thread 1 should lock resource A and wait for resource B. Thread 2 should lock resource B and wait for resource A. Running both of these threads at the same time should cause a deadlock.