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
Month-Over-Month Engagement Growth
00:00
5 left

Month-Over-Month Engagement Growth

MediumSQL · PostgreSQL

Problem

Netflix Analytics Engineering needs a regional view of monthly content engagement across the Netflix catalog. Write a PostgreSQL query that calculates total watch minutes and month-over-month growth for each region.

Requirements

  1. Join viewing events to netflix_titles so only events for known titles are included.
  2. Aggregate positive watch minutes by region and calendar month for Q1 2025, excluding events with a missing region.
  3. Use a window function to return the previous reported month’s engagement and calculate percentage growth. Return NULL growth when no prior month exists or the prior value is zero.
  4. Sort the results by region and month in ascending order.

Schema

viewing_events
ColumnTypeDescription
event_idPKINTUnique viewing event identifier
title_idINTReferenced Netflix title identifier
regionVARCHAR(20)Viewer region
viewed_atTIMESTAMPTimestamp when content was watched
watch_minutesINTMinutes watched during the event
netflix_titles
ColumnTypeDescription
title_idPKINTUnique Netflix title identifier
title_nameVARCHAR(150)Netflix movie or series name
content_typeVARCHAR(20)Content classification
Tablesviewing_eventsnetflix_titles
Interviewer

Your question is Month-Over-Month Engagement Growth. 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.