Pergunta de entrevista da empresa Adjust

two tasks in javascript regarding react