Question d’entretien chez RouteOne

How would you solve this code challenge?