Domanda di colloquio di Amazon

Basic coding questions, a lot of algorithm analysis