Pregunta de entrevista de Codibly

How to solve deadlock problem in code