Thoughtworks interview question

Few data structures problem