Amazon interview question

java fundaments