#300

Watch Time Completion Streaks

HARDData AnalysisPYTHON

Problem Description

A content engagement analytics pipeline identifies highly engaged subscribers by combining a completion rate filter with a viewing streak detector, powering targeted retention campaigns. Given viewing session data, find all unique accounts that watched more than 80% of a title's runtime within the first 100 days from release. For qualifying accounts, return their top 3 titles that also meet a completion streak: watched on at least 3 different days within any 7-day window. **Input:** `sessions` (list of session dicts with user_id, title_id, watch_time, watch_date) and `titles` (list of title dicts with title_id, runtime, release_date). **Output:** Dict mapping qualifying user_ids to their top 3 streak titles. **Key Rules:** - 80% completion threshold applies within the 100-day post-release window only - Streak requires 3+ distinct days within any rolling 7-day window - Top 3 titles per qualifying account (by a defined ranking criterion)

Topics

sliding windowdata analysis

Asked at Companies

netflix

Solve This Problem

Sign up to access the interactive code editor, run test cases, view the editorial, and get AI-powered feedback on your solution.

Start Solving →