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 Ecommerce Conversion Funnel
00:00
5 left

Analyze Ecommerce Conversion Funnel

MediumSQL · PostgreSQL

Problem

NovaCart wants to measure how users move through a simple purchase funnel: visit → checkout → purchase. Write a SQL query to calculate funnel performance by visit date.

Your query should use the event stream and user data to report how many distinct users reached each stage on each day, along with conversion rates between stages.

Requirements

  1. For each visit_date, count distinct users who had a visit, then a checkout, then a purchase on the same day.
  2. A user should count at a later stage only if they also reached the earlier stage that day.
  3. Return visit_date, visitors, checkout_users, purchase_users, visit_to_checkout_rate, and checkout_to_purchase_rate.
  4. Include only users from the web acquisition channel.

Schema

users
ColumnTypeDescription
user_idPKINTUnique user identifier
signup_dateDATEDate the user signed up
acquisition_channelVARCHAR(20)Channel that acquired the user
countryVARCHAR(20)User country
events
ColumnTypeDescription
event_idPKINTUnique event identifier
user_idINTUser who generated the event
event_nameVARCHAR(20)Event type in the funnel
event_timeTIMESTAMPTimestamp of the event
session_idVARCHAR(20)Session identifier
Tablesusersevents
Interviewer

Your question is Analyze Ecommerce Conversion Funnel. Start with the requirements and the two 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.