SQL interview questions · By company
Netflix SQL interview questions
For analytics and data science roles: what candidates report, and how to practice for it.
SQLRep isn't affiliated with or endorsed by Netflix. This guide summarizes public candidate reports and prep guides (sources below, checked November 2026). The practice questions are original, written in the reported style; they aren't Netflix's actual questions. Processes change, so confirm details with your recruiter.
What candidates report about the process
- Prep content mentions an online coding screen and a focus on data wrangling and analytical problem solving.
- Public first-hand reports are limited, so treat this as indicative.
SQL topics that come up
- Viewing time by device or title
- Completion and binge behavior from viewing sessions
- Retention cohorts
Practice the reported patterns
Each one runs in real PostgreSQL in your browser, with feedback on what's wrong.
- Viewing hours by device, midnight sessions includedFor sessions that started on 2025-03-01 or 2025-03-02, return view_date (the date the session started), device_type, sessions and hours_watched (total ended_at - started_at in hours, rounded to 2 decimals). Sort by view_date, then device_type.Pattern: Timestamp intervals · EXTRACT(EPOCH) · half-open date rangesEasyPro
- Title completion rate with a viewer minimumFor titles with at least 4 distinct viewers, return title, viewers (distinct profiles), completers (distinct profiles with a view where minutes_watched >= 90% of runtime_min) and completion_pct (completers as a % of viewers, rounded to 1 decimal). Sort by completion_pct descending, then title.Pattern: COUNT(DISTINCT) FILTER · HAVING · threshold comparisonsMediumPro
- Binge-watch daysReturn user_id, show (the show's title), watch_date (the date of started_at) and episodes (distinct episodes of that show the user started that day) for every binge: 3 or more different episodes of the same show on the same day. Sort by watch_date, user_id, show.Pattern: Timestamp to date · COUNT(DISTINCT) · HAVINGMediumPro
- Watched every episode of a seasonReturn user_id, show (the show's title) and season for every user who has at least one view of every episode in that season of that show. Sort by user_id, show, season.Pattern: Relational division · HAVING COUNT(DISTINCT) = totalHardPro
- Session length from start and end eventsPair each session_start with the same player's next event when that event is a session_end; a start followed by another start, or by nothing, was a crash and is skipped. Return username, sessions (completed sessions) and avg_minutes (their average length in minutes, rounded to 1 decimal). Sort by avg_minutes descending, then username.Pattern: LEAD · PARTITION BY · pairing eventsHardPro
- Month-1 retention by signup cohortFor users who signed up (users.created_at) in January through March 2024, return cohort_month (YYYY-MM), cohort_size, retained (cohort users with at least one app open in the calendar month after their signup month) and retention_pct (retained as a percentage of cohort_size, rounded to 1 decimal). Oldest cohort first.Pattern: Cohorts · date_trunc · LEFT JOINHardPro
- Sessions from raw pageviewsSplit pageviews into sessions per user: a gap of more than 30 minutes since the user's previous view starts a new session (exactly 30 minutes stays in the same session). Return user_id, session_start, session_end and pageviews (views in the session). Sort by user_id, session_start.Pattern: LAG · running SUM · sessionizationHardPro
Tip: Viewing logs have sessions that cross midnight and partial plays: decide how to count them and say so.
Sources
Netflix is a trademark of its owner, used here only to identify the company the reports are about.