Amazon interview question

What's wrong with this given code?