Pergunta de entrevista da empresa Centific

Coding question but straight forward.