Pregunta de entrevista de Looloo Technology

Please solve the following problem?