Derive Insights from DoorDash Order Database
Company: DoorDash
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Technical Screen
Orders
user_id | order_id | merchant_id | order_value | order_date
1 | 1001 | 501 | 45.00 | 2023-07-01
2 | 1002 | 502 | 12.50 | 2023-07-02
1 | 1003 | 501 | 30.00 | 2023-07-05
3 | 1004 | 503 | 85.00 | 2023-07-05
4 | 1005 | 502 | 15.00 | 2023-07-06
##### Scenario
DoorDash order database; need to derive user and merchant insights during SQL interview.
##### Question
Write a query to calculate the percentage of high-frequency users (e.g., users whose order count exceeds a defined threshold) over total users. 2. Excluding high-frequency users, compute the monthly total order value. 3. Identify the customer with the single highest order value. 4. Given an existing query that returns bottom-quantile-revenue merchants, modify it per a new prompt from the interviewer (e.g., change quantile or add date filter).
##### Hints
Use GROUP BY, COUNT/DISTINCT, window functions or percentile logic; handle date truncation for monthly rollups; join/CTE chain is acceptable.
Quick Answer: This question evaluates SQL and Python data-manipulation skills, specifically aggregation, filtering, window functions, quantile analysis, and the ability to derive user- and merchant-level metrics; it belongs to the Data Manipulation (SQL/Python) domain and emphasizes practical query-writing and data-wrangling competency.