Pergunta de entrevista da empresa Didlake

How would you implement the solution?