Amazon interview question

to solve a case study.