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
Monthly Upgrades and MoM Growth
00:00
5 left

Monthly Upgrades and MoM Growth

MediumSQL · PostgreSQL

Problem

Write a query to find the monthly active users who upgraded their subscription tier, showing the month-over-month growth rate.

Use user_activity records to identify active users and subscription_changes records to identify upgrades occurring in the same calendar month. Include only users active during the month of their upgrade.

Output

  1. One row per month with at least one qualifying user.
  2. Columns: month, monthly_active_upgraded_users, and mom_growth_rate_pct.
  3. Show growth as a percentage rounded to two decimal places. The first month should have a NULL growth rate.
  4. Sort chronologically by month.

Schema

user_activity
ColumnTypeDescription
activity_idPKINTUnique activity record identifier
user_idINTHubSpot user identifier associated with the activity
activity_atTIMESTAMPTimestamp when the user was active
subscription_changes
ColumnTypeDescription
change_idPKINTUnique subscription change identifier
user_idINTHubSpot user identifier affected by the change
changed_atTIMESTAMPTimestamp when the subscription changed
change_typeVARCHAR(20)Type of subscription change
old_tierVARCHAR(30)Subscription tier before the change
new_tierVARCHAR(30)Subscription tier after the change
Tablesuser_activitysubscription_changes
Interviewer

Your question is Monthly Upgrades and MoM 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.