Amazon interview question

Technical stuff