Amazon Interview Question

Debugging, two coding questions