Identify Most Popular First-Watched Movie in Viewing History
AmazonBusiness Intelligence Engineer · OnsiteLast updated
This question evaluates proficiency in data manipulation and temporal event analysis, assessing competency in identifying per-user earliest views and aggregating frequencies using SQL or Python.
MOVIE_VIEWS
+------------+--------------------+------------+ | customer_id| title | date | +------------+--------------------+------------+ | 1 | Toy Story |2025-01-01 | | 1 | Avengers |2025-01-10 | | 2 | Avengers |2025-01-02 | +------------+--------------------+------------+
Scenario
A streaming platform wants to find the movie that most customers watched first in their viewing history.
Question
Using SQL or Python, determine which movie title appears most frequently as users' earliest-dated movie view (i.e., the most popular first-watched film).
Hints
Rank or aggregate by the minimum date per customer, then count titles and order by frequency.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.