Pergunta de entrevista da empresa Amazon

Problem faced with past project.