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
ExperiencesCoaching
New
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
Get started
Meta Messenger Signup Funnel
00:00
5 left

Meta Messenger Signup Funnel

MediumSQL · PostgreSQL

Problem

Meta wants to measure a simple Messenger onboarding funnel: signup → first message sent → 7-day active. Write a SQL query to calculate, by signup date, how many users reached each stage.

A user counts as:

  1. signed_up if they appear in users
  2. sent_first_message if they sent at least one message on or after signup
  3. active_7d if they had at least one activity event exactly 7 days after signup

Return one row per signup_date with counts for each funnel stage.

Requirements

  1. Group results by signup_date
  2. Count distinct users at each funnel stage
  3. A message sent before signup should not count
  4. A 7-day active event must occur on signup_date + 7 days
  5. Order output by signup_date

Schema

users
ColumnTypeDescription
user_idPKINTUnique user identifier
signup_tsTIMESTAMPTimestamp when the user signed up
signup_surfaceVARCHAR(50)Meta surface where signup started
messages
ColumnTypeDescription
message_idPKINTUnique message identifier
sender_idINTUser who sent the message
sent_tsTIMESTAMPTimestamp when the message was sent
thread_typeVARCHAR(30)Conversation type
activity_events
ColumnTypeDescription
event_idPKINTUnique activity event identifier
user_idINTUser who generated the activity event
event_tsTIMESTAMPTimestamp of the activity event
event_nameVARCHAR(50)Type of activity event
Tablesusersmessagesactivity_events
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the three tables are in the Question tab.

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.