Amazon Interview Question

It was based on algorithms and data. structures