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
Daily Peak-Hour Driver Acceptance Rate
00:00
5 left

Daily Peak-Hour Driver Acceptance Rate

MediumSQL · PostgreSQL

Problem

You are given ride request and driver response data from Lyft. Write a query to calculate the daily driver acceptance rate for rides requested in San Francisco during peak hours. Treat peak hours as 7:00-9:59 and 16:00-18:59 based on the ride request timestamp. The acceptance rate should be the number of requested rides with at least one accepted driver response divided by the total number of qualifying ride requests for each day.

Schema

ride_requests
ColumnTypeDescription
request_idPKINTUnique ride request identifier
rider_idINTRider who placed the request
requested_atTIMESTAMPTimestamp when the ride was requested
city_idINTCity where the ride was requested
ride_typeVARCHAR(50)Requested Lyft product type
cities
ColumnTypeDescription
city_idPKINTUnique city identifier
city_nameVARCHAR(100)City name
state_codeVARCHAR(10)State abbreviation
driver_responses
ColumnTypeDescription
response_idPKINTUnique driver response identifier
request_idINTRide request tied to the response
driver_idINTDriver who received the request
response_statusVARCHAR(20)Driver response outcome
responded_atTIMESTAMPTimestamp of the driver response
Tablesride_requestscitiesdriver_responses
Interviewer

Your question is Daily Peak-Hour Driver Acceptance Rate. 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.