PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates proficiency in SQL data manipulation, including aggregation, date-based grouping, window functions, and percentile-based analysis to quantify monthly customer spend and restaurant revenues.

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

Analyze Monthly Customer and Restaurant Spend Data

Company: DoorDash

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

orders +-----------+-------------+---------------+------------+--------+ | order_id | customer_id | restaurant_id | order_date | amount | +-----------+-------------+---------------+------------+--------+ | 1001 | 501 | 3001 | 2023-05-12 | 45.20 | | 1002 | 502 | 3002 | 2023-05-12 | 120.00 | | 1003 | 501 | 3003 | 2023-06-04 | 99.99 | | 1004 | 503 | 3001 | 2023-06-15 | 210.50 | | 1005 | 504 | 3002 | 2023-07-02 | 15.25 | +-----------+-------------+---------------+------------+--------+ ##### Scenario You are a data scientist at a food-delivery marketplace. You have an orders table that logs every completed order. Business wants monthly insights on spend, restaurant performance, and customer mix. ##### Question Write a SQL query to return all customers who spent more than $100 in every calendar month they transacted. 2. Among customers NOT returned in ( 1), find those with the highest total monthly spend for each month. 3. For a given restaurant_id, show its month-over-month gross revenue and the percentage change versus the prior month. 4. In any month, what proportion of orders come from restaurants whose monthly revenues fall in the bottom 25 th percentile of all restaurants for that month? ##### Hints Think window functions, GROUP BY month, conditional aggregation, percentile/NTILE for bottom-quartile filter.

Quick Answer: This question evaluates proficiency in SQL data manipulation, including aggregation, date-based grouping, window functions, and percentile-based analysis to quantify monthly customer spend and restaurant revenues.

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)