Finmid Interview Question

How do you avoid a deadlock in the case study?