Eterno Infotech Pvt Ltd Interview Question
Software Engineer / DevelopersCountry: United States
could we do this: Since the top products list is generally const, we can have a int array, where the value of each object is the how much its liked/sold (+1 everytime someone buys/likes, -1 someone dislikes), and the index of each object is the key to a hash table that returns the name of the product from a database.
I guess we have to build max-heap for getting max selling product.
- Nitin Gupta January 23, 2013