Pergunta de entrevista da empresa Glassdoor

How would you code and design a solution for this problem?