Amazon interview question

Debugging, two coding questions