Amazon interview question

Coding problems to test knowledge