Pregunta de entrevista de Tata Consultancy Services

How can we avoid the deadlock