Amazon interview question

Java questions