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
Experiment Design With Multiple Factors
00:00
5 left

Experiment Design With Multiple Factors

MediumSQL · PostgreSQL

Problem

For a case study, consider multiple factors affecting DoorDash USA and come up with a reliable solution. How would you test the solution, including using SQL with datetime functions and window functions?

Use the supplied DoorDash USA delivery data to produce a validation-oriented delivery report for January 2025.

Output

  1. One row per completed delivery requested in January 2025.
  2. Return delivery_id, market, dasher_id, merchant_name, delivery_minutes, prior_delivery_minutes, duration_change_minutes, and reliability_flag.
  3. Flag missing or negative durations, durations over 60 minutes, and durations more than twice the Dasher's previous delivery as review; otherwise use reliable.
  4. Order by requested_at, then delivery_id.

Schema

deliveries
ColumnTypeDescription
delivery_idPKINTUnique delivery identifier
requested_atTIMESTAMPTimestamp when the delivery was requested
picked_up_atTIMESTAMPTimestamp when the Dasher picked up the order
delivered_atTIMESTAMPTimestamp when the order was delivered
statusVARCHAR(20)Delivery lifecycle status
marketVARCHAR(50)DoorDash USA market
dasher_idINTAssigned Dasher identifier
merchant_idINTMerchant identifier
dashers
ColumnTypeDescription
dasher_idPKINTUnique Dasher identifier
dasher_nameVARCHAR(100)Dasher display name
home_marketVARCHAR(50)Dasher home market
merchants
ColumnTypeDescription
merchant_idPKINTUnique merchant identifier
merchant_nameVARCHAR(100)Merchant display name
cuisineVARCHAR(50)Merchant cuisine category
Tablesdeliveriesdashersmerchants
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.