Amazon interview question

Find the bug in sample code