Pergunta de entrevista da empresa the LEGO Group

How I would solve 2 different tasks