Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Monthly Active User Growth by Platform

MediumSQL · PostgreSQL00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to the SQL screen.

The question is on your right: Monthly Active User Growth by Platform. Read through the requirements and the three tables first.

Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?

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