Question d’entretien chez Thoughtworks

Please explain how you solve the assignment.