Pergunta de entrevista da empresa Finshell

Question was based on the assignment.