Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Top Titles by Signup Completion
00:00
5 left

Top Titles by Signup Completion

HardSQL · PostgreSQL

Problem

Netflix wants to identify which titles most effectively drive completed new memberships. Analyze activity from Q2 2025, using only viewers whose recorded event was their first-ever view of that title.

Write a PostgreSQL query to return the top ten titles by new-signup completion rate.

Requirements

  1. Include first-time title viewers whose viewing occurred from 2025-04-01 through 2025-06-30.
  2. Join signup attempts attributed to the same title and viewer, retaining viewers without a signup attempt.
  3. Calculate completion rate as completed signup attempts divided by first-time viewers. Return the top ten titles, ordered by rate descending, then viewer count descending, then title name ascending.

Schema

titles
ColumnTypeDescription
title_idPKINTUnique Netflix title identifier
title_nameVARCHAR(150)Display title
viewing_events
ColumnTypeDescription
viewing_event_idPKINTUnique viewing event identifier
viewer_idINTViewer identifier
title_idINTViewed title identifier
viewed_atTIMESTAMPTime of viewing
is_first_ever_viewBOOLEANWhether this was the viewer's first view of the title
signup_attempts
ColumnTypeDescription
signup_attempt_idPKINTUnique signup attempt identifier
viewer_idINTViewer identifier
title_idINTAttributed title identifier
signup_started_atTIMESTAMPTime the signup attempt started
signup_completed_atTIMESTAMPCompletion time, or NULL when incomplete
Tablestitlesviewing_eventssignup_attempts
Interviewer

Your question is Top Titles by Signup Completion. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.