Find orders from bottom-quartile revenue restaurants
Company: DoorDash
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Onsite
Overview: This question evaluates proficiency in SQL data manipulation, including time-windowed aggregation, joins, filtering by status and date, and percentile-based ranking of restaurant revenue using completed orders.
Tables
restaurants(restaurant_id INT, restaurant_name VARCHAR(100))
orders(order_id INT, restaurant_id INT, customer_id INT, order_date DATE, status VARCHAR(20), total_amount DECIMAL(10,2))
Hints
- First aggregate delivered order revenue per restaurant within 2025-05-01 to 2025-05-31.
- Use NTILE(4) over the restaurant revenue ordered ascending to identify the bottom quartile, then join back to orders.