Domanda di colloquio di Thoughtworks

Please explain how you solve the assignment.