Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Churn Risk from Streaming Drop
00:00
5 left

Churn Risk from Streaming Drop

MediumSQL · PostgreSQL

Problem

How would you write a query to identify subscribers who are at risk of churning based on a sudden drop in their weekly streaming hours?

Assume a subscriber is at risk when their latest recorded week has streaming hours at least 50% below the immediately preceding recorded week. Use the provided tables and return only subscribers meeting that condition.

Output

  1. One row per subscriber at risk
  2. Include subscriber_id, subscriber_name, latest_week, previous_hours, latest_hours, and drop_percentage
  3. Sort by drop_percentage descending, then subscriber_id ascending

Schema

subscribers
ColumnTypeDescription
subscriber_idPKINTUnique subscriber identifier
subscriber_nameVARCHAR(100)Subscriber display name
plan_typeVARCHAR(30)Current subscription plan
weekly_streaming_hours
ColumnTypeDescription
weekly_usage_idPKINTUnique weekly usage record identifier
subscriber_idINTSubscriber associated with the weekly measurement
week_startDATEStart date of the measurement week
streaming_hoursNUMERIC(8,2)Total streaming hours during the week
Tablessubscribersweekly_streaming_hours
Interviewer

Your question is Churn Risk from Streaming Drop. Start with the requirements and the two 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
Sign up free to run your codeLog inLn 1
Run your query to see results here.