Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Monthly Active User Growth by Platform

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Monthly Active User Growth by Platform. Start with the requirements and the three tables on the right.

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.

Problem

You are given user activity data for Google products. Write a SQL query to calculate the month-over-month growth rate of active users for a specific platform, using Google Maps as the target product. Treat an active user as a distinct user with at least one activity event in that month. Return each month, the active user count, the prior month's active user count, and the month-over-month growth rate as a percentage. For the first month in the result, the prior month and growth rate should be NULL.

Schema

products
ColumnTypeDescription
product_idPKINTUnique product identifier
product_nameVARCHAR(100)Google product name
platformVARCHAR(20)Platform where the product is used
users
ColumnTypeDescription
user_idPKINTUnique user identifier
country_codeVARCHAR(2)User country code
signup_dateDATEDate the user signed up
activity_events
ColumnTypeDescription
event_idPKINTUnique event identifier
user_idINTUser who generated the event
product_idINTProduct tied to the event
event_dateDATEDate of the activity event
event_typeVARCHAR(30)Type of user activity
Tablesproductsusersactivity_events
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results