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
Analyze Signup Funnel Drop-Off
00:00
5 left

Analyze Signup Funnel Drop-Off

HardSQL · PostgreSQL

Problem

StreamFlow wants to measure where users drop off in its onboarding funnel. Write a PostgreSQL query to calculate how many users reached each funnel step and how many dropped before the next step within a 7-day window from signup.

Requirements

  1. Treat the funnel as: landing_view  signup_started  email_verified  subscription_started.
  2. Count each user at most once per step, using their earliest event timestamp for that step.
  3. Only include users who signed up between 2024-01-01 and 2024-01-31.
  4. A step counts only if it happened on or after signup and within 7 days of the user's signup date.
  5. Return one row per funnel step with:
    • users who reached the step
    • users who dropped before the next step
    • drop-off percentage from that step to the next

Schema

users
ColumnTypeDescription
user_idPKINTUnique user identifier
signup_dateDATEDate the user registered
acquisition_channelVARCHAR(50)Marketing acquisition source
funnel_steps
ColumnTypeDescription
step_namePKVARCHAR(50)Name of the funnel step
step_orderINTStep sequence in the funnel
events
ColumnTypeDescription
event_idPKINTUnique event identifier
user_idINTUser who generated the event
event_nameVARCHAR(50)Event type corresponding to a funnel step or other action
event_timeTIMESTAMPTime the event occurred
device_typeVARCHAR(20)Device used for the event
Tablesusersfunnel_stepsevents
Interviewer

Your question is Analyze Signup Funnel Drop-Off. 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.