Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL Funnel Drop-Off Analysis

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

Your question is SQL Funnel Drop-Off Analysis. Start with the requirements and the two 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

Airbnb wants to understand where users drop out of the Airbnb Homes booking funnel in the mobile app. Write a PostgreSQL query for February 2025 that measures sequential funnel engagement.

Requirements

  1. Restrict events to February 2025 and the airbnb_app surface, joining valid users from users.
  2. Report each funnel stage in order: search, listing view, reservation request, and booking confirmation.
  3. Return distinct users reaching each stage, total events from qualified users at that stage, conversion from the previous stage, and user drop-off from the previous stage. A user qualifies for a stage only if they reached every preceding stage.
  4. Include stages with no users, preserve funnel order, and calculate conversion as a decimal rounded to three places.

Schema

users
ColumnTypeDescription
user_idPKINTUnique Airbnb user identifier
signup_dateDATEDate the user signed up
country_codeVARCHAR(2)Two-letter user country code
funnel_events
ColumnTypeDescription
event_idPKINTUnique funnel event identifier
user_idINTReferences users.user_id
event_typeVARCHAR(30)Airbnb Homes funnel action
event_timestampTIMESTAMPTimestamp when the event occurred
surfaceVARCHAR(20)Product surface generating the event
Tablesusersfunnel_events
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results