PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in time-based aggregations, timestamp arithmetic, percentage calculations, and ranking/grouping using SQL or equivalent Python data-manipulation libraries.

  • Medium
  • DoorDash
  • Data Manipulation (SQL/Python)
  • Data Scientist

Measure Late Deliveries and Identify Top Delayed Restaurants

Company: DoorDash

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

orders +----------+---------+--------------+---------------------+-------------------------+-----------------------+ | order_id | user_id | restaurant_id| created_at | estimated_delivery_at | actual_delivery_at | +----------+---------+--------------+---------------------+-------------------------+-----------------------+ | 1 | 101 | 15 | 2023-07-10 12:00 | 2023-07-10 12:30 | 2023-07-10 12:40 | | 2 | 102 | 17 | 2023-07-10 13:10 | 2023-07-10 13:45 | 2023-07-10 13:43 | | 3 | 103 | 15 | 2023-07-11 10:05 | 2023-07-11 10:35 | 2023-07-11 11:00 | | 4 | 104 | 18 | 2023-07-12 09:00 | 2023-07-12 09:25 | 2023-07-12 09:20 | +----------+---------+--------------+---------------------+-------------------------+-----------------------+ ##### Scenario An on-demand food-delivery company wants to measure and monitor late deliveries. ##### Question Write a SQL query that, for the last 7 days, returns each day’s total orders and the percentage that were delivered more than 10 minutes after estimated_delivery_at. Extend it to list the top 5 restaurants with the highest average delivery delay in that period. ##### Hints Use DATE_TRUNC / DATE() for grouping, TIMESTAMPDIFF or equivalent to compute delay, and ORDER BY with LIMIT for ranking.

Quick Answer: This question evaluates proficiency in time-based aggregations, timestamp arithmetic, percentage calculations, and ranking/grouping using SQL or equivalent Python data-manipulation libraries.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Calculate Order Request Metrics - DoorDash (hard)
  • Analyze Restaurant Customer Metrics - DoorDash (medium)
  • Write SQL for monthly spend and ratios - DoorDash (medium)
  • Write SQL for late-delivery metrics by window - DoorDash (Medium)
  • Compute rolling cold-delivery rates with windows - DoorDash (Medium)