Pergunta de entrevista da empresa MindCloud

How would you deal with this code challenge? (hard code challenge)