Question d’entretien chez IntegraFEC

How would you solve this programming problem?