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
Monthly Studio Delivery Performance
00:00
5 left

Monthly Studio Delivery Performance

MediumSQL · PostgreSQL

Problem

You are given delivery event data for Lucid Studios and asked to analyze monthly delivery performance by studio. Write a PostgreSQL query that returns one row per studio per delivery month, showing the average dwell time in hours and the on-time delivery rate. Treat dwell time as the time between vehicle arrival at the studio and customer handoff. A delivery is on time when the actual handoff date is on or before the scheduled delivery date. Only include deliveries that were completed and have a non-null actual handoff timestamp.

Schema

lucid_studios
ColumnTypeDescription
studio_idPKINTPrimary key for each Lucid Studio
studio_nameVARCHAR(100)Studio name
regionVARCHAR(50)Studio region
vehicle_deliveries
ColumnTypeDescription
delivery_idPKINTPrimary key for each delivery
studio_idINTStudio handling the delivery
order_idINTCustomer order identifier
scheduled_delivery_dateDATEPlanned customer delivery date
actual_handoff_tsTIMESTAMPActual customer handoff timestamp
delivery_statusVARCHAR(30)Delivery status
delivery_events
ColumnTypeDescription
event_idPKINTPrimary key for each event
delivery_idINTRelated delivery
event_typeVARCHAR(40)Event type such as vehicle_arrived
event_tsTIMESTAMPEvent timestamp
Tableslucid_studiosvehicle_deliveriesdelivery_events
Interviewer

Your question is Monthly Studio Delivery Performance. 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.