Amazon interview question

It was based on algorithms and data. structures