Finmid interview question

How do you avoid a deadlock in the case study?