Imagine you have been given role to design a competitor for Flipkart.com for your new company. Thousands of products needs to be listed on website.
1>Create a simple RESTful endpoint that will take input as category of item and returns the sorted List of Items based on popularity (assume there is popularity score associated with every item) . Write only controller component.
2> Implement another endpoint that filters the above list of item objects based on three parameters – 1) price range 2) rating 3) number of Reviews. Write only controller component.
Write a clean code with Unit tests for relevant methods.