Calculate Weekly, Monthly Hours Watched by Premium Users
Company: Amazon
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Technical Screen
Overview: This question evaluates a candidate's ability to perform time-based aggregation and data manipulation in SQL and Python, including grouping, filtering by subscription status, and converting minute-level metrics into hours.
Tables
watch_events(user_id INTEGER, video_id VARCHAR, watched_minutes INTEGER, watched_at TIMESTAMP, subscription VARCHAR)
Hints
- Filter to premium subscriptions before aggregating.
- Use DATE_TRUNC for week and month buckets.