Pregunta de entrevista de Adjust

two tasks in javascript regarding react