Amazon interview question

General coding puzzles