Pergunta de entrevista da empresa Amazon

Nothing too difficult although one should be strong with using data structures.