Amazon interview question

I didn't expect the HR to ask one programming problem