Question d’entretien chez ING

How would you solve this coding problem