Feature #4: Popularity Analysis
Explore how to analyze popularity trends of Netflix titles by processing weekly popularity scores. Understand how to determine if a title's popularity is increasing, decreasing, or steady using Ruby. Learn to implement a single-pass algorithm with O(n) time and O(1) space complexity to efficiently classify titles for better data analysis.
We'll cover the following...
Description
Netflix maintains a popularity score for each of its titles. This popularity score is derived from customer feedback, likes, dislikes, etc. This score is updated weekly and added to the end of the list containing previous scores for the same title. This score list helps Netflix identify titles that may be increasing or decreasing in popularity over time. Some titles may be steady in popularity, increasing, decreasing, and fluctuating. We want to identify and separate a title if it is gaining or losing popularity.
We’ll be provided with a list of integers representing the popularity scores of a movie collected over a number of weeks. We need to identify only those titles that are either increasing or decreasing in popularity, so we can separate them from the fluctuating ones for better analysis.
Solution
A list is increasing if the expression ...