Amazon Interview Question
Software Engineer / DevelopersHi amm,
if you use the adjacency list you have to store the elements in the sorted order...? do you agress this..?
and thn u have to count the no of each rating....
may be a simple hash map: <movie's name, ratings>. depends on needs, ratings could be a single number, or a an array list of different rates.
something similar to like adjacency list....use hashing to get a index (hash value) for the movie name and store the rating of each user as a node in the list.
- amm February 25, 2011