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
24-Hour Email Conversion Rate
00:00
5 left

24-Hour Email Conversion Rate

MediumSQL · PostgreSQL

Problem

Given a table of email dispatches and a table of website purchases, write a query to calculate the conversion rate of users who made a purchase within 24 hours of receiving an email at Zulily.

Treat each user as converted if at least one purchase occurs from the email timestamp through 24 hours afterward, inclusive. Calculate the rate using distinct emailed users as the denominator.

Output

  1. One result row with converted_users, emailed_users, and conversion_rate_pct.
  2. Return the conversion rate as a percentage rounded to two decimal places.

Schema

email_dispatches
ColumnTypeDescription
dispatch_idPKINTUnique email dispatch identifier
user_idVARCHAR(20)Zulily user who received the email
sent_atTIMESTAMPTimestamp when the email was dispatched
website_purchases
ColumnTypeDescription
purchase_idPKINTUnique website purchase identifier
user_idVARCHAR(20)Zulily user who made the purchase
purchased_atTIMESTAMPTimestamp when the purchase was completed
Tablesemail_dispatcheswebsite_purchases
Interviewer

Your question is 24-Hour Email Conversion Rate. 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.