Feature #7: Browse Ratings

Implementing the "Browse Ratings" feature for our "Netflix" project.


In this feature, the user will be able to randomly browse through movie titles and read their summaries and reviews. We want to enable a Back button so the user can return to the previous title in the viewing history. We also want the user to immediately get the title with the highest viewer rating from their viewing history. We want to implement both of these operations in constant time to provide a good user experience.

We’ll be provided with a sequential input of ratings to simulate the user viewing them one by one. For simplicity, we’ll assume that the movie ratings are all unique.

Let’s say that a user has browsed through the movies with the following ratings:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.