Amazon interview question

Compare and Book and a Three Ring Binder using data structures and classes.

Interview Answers

Anonymous

23 Feb 2011

A book is like an array. You can very easily look up based on index (page number), however it is hard to insert (you'd have to cut out pages, put one in, and put pages back in). A binder has a more difficult lookup, but insertions are easy (like an unsorted list)

2

Anonymous

25 Jan 2011

Book would have a class pages, and page numbers. You would use an Array to store all pages of the book in an ordered sequence. Binder would also have the class pages, but you would use a linked list to add or remove pages at anytime.