Amazon interview question

Quite more about data structures