Amazon Interview Question
Software Engineer / DevelopersTeam: Intern
Country: United States
Interview Type: Phone Interview
I think we should talk data structures here, and I think 'heap' would be the best way. Everytime a higher bid is placed, it can take the top position. And if a bid gets cancelled, the heap will re-adjust to bring the highest available bid on top.
how about use priority queue? PriorityQueue<people, price> price is the priority. the higher of the price, the more change to get the product. If a person provide a higher price, change his/her priority
h%t%t%p://thought-works.blogspot.in/2012/11/object-oriented-design-for-online.html
- sriniatiisc November 11, 2012(remove % in the url and paste in the address bar)