Pergunta de entrevista da empresa DocPath Document Management

How would you solve this problem?