Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 feedbackSuccess 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 Active Users by Campaign
00:00
5 left

Monthly Active Users by Campaign

MediumSQL · PostgreSQL

Problem

Write a query to find the monthly active users who signed up via a specific marketing campaign.

Use the users, campaigns, and activity_events tables. For this exercise, the campaign is Copilot Launch, and an active user has at least one recorded activity event during the month.

Output

  1. One row per month with columns activity_month and monthly_active_users.
  2. Include only users whose signup campaign is Copilot Launch; count each user once per month.
  3. Sort chronologically by activity_month.

Schema

campaigns
ColumnTypeDescription
campaign_idPKINTUnique campaign identifier
campaign_nameVARCHAR(100)Marketing campaign name
channelVARCHAR(50)Primary acquisition channel
users
ColumnTypeDescription
user_idPKINTUnique GitHub user identifier
emailVARCHAR(255)User email address
signup_dateDATEDate the user signed up
campaign_idINTCampaign attributed to the signup
activity_events
ColumnTypeDescription
event_idPKINTUnique activity event identifier
user_idINTUser who generated the event
activity_atTIMESTAMPTimestamp when the activity occurred
event_typeVARCHAR(50)Type of product activity
Tablesuserscampaignsactivity_events
Interviewer

Your question is Monthly Active Users by Campaign. Start with the requirements and the three 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.