Question d’entretien chez Intel Corporation

How would you solve a following code.