Katkat

Identify Most Popular First-Watched Movie in Viewing History

AmazonBusiness Intelligence Engineer · Onsite

Last 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.