Amazon Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

Hold the N books in a hash table and keep a max heap associated with each of the book. The formats available for the book will be the nodes for the max-heap.
Each node of the heap will have a key associated with it and if the popularity of the format goes high so does the value of the key. and in a max-heap the node with highest key would be at the top.

- algooz June 22, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think since the types a book can be represented is limited, not a big no and will be known in advance. just have a datastructure which has book name and a map of type and count of times downloaded, also have apis for adding counts, getting most downloaded type etc.

You mite want to store these book data structures in the best search DS ( depends on what API's u need). I would recommend a trie of book names based on what i think will be needed( remember every book search shows similar books :P)

- Prasanna August 29, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

How about using a HashTable where key is the bookID and the value is the most famous version of that book. and maintain a linked list that shows other formats in decreasing popularity. whenever the popularity is changed just manipulate the linked list nodes

- veeru December 17, 2010 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More