Amazon interview question

Programming questions.