Top Three Dishes per Cuisine by Customer Reorder Rate

Last updated: November 29, 2026

Quick Overview

For the last 90 days, rank menu items within each cuisine by the share of their buyers who ordered the item at least twice, require at least 50 buyers, and return the top three per cuisine.

DoorDash
Data Manipulation (SQL/Python)
Data Scientist
DoorDash
November 29, 2026
Data Scientist
Phone Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


For the last 90 days, rank menu items within each cuisine by the share of their buyers who ordered the item at least twice, require at least 50 buyers, and return the top three per cuisine.

DoorDash merchandising and search teams highlight 'most loved' dishes, and reorder rate is a better quality signal than raw volume. The phone screen uses it to check per-customer aggregation before a per-item metric, a minimum-sample threshold, and a top-N per group window function with deterministic ties.

What the Interviewer Expects
  • Aggregate to customer by item first, then compute the item-level rate
  • Count distinct orders so an item ordered twice in one cart is not a reorder
  • Apply a minimum buyer threshold with HAVING
  • Use ROW_NUMBER (or explain RANK versus DENSE_RANK) partitioned by cuisine
  • Break ties deterministically
Key Topics to Cover
window functions
top-N per group
ROW_NUMBER
minimum sample size
two-level aggregation
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • Why might reorder rate favor cheap staple items like drinks, and how would you adjust?
  • How would you shrink small-sample rates toward the cuisine average instead of using a hard 50-buyer cutoff?
  • How would you return ties at rank 3 instead of cutting them?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

orders(order_id, customer_id, created_at, status), order_items(order_id, item_id, quantity), menu_items(item_id, store_id, item_name), stores(store_id, store_name, cuisine). Item ids are store...

Approach

Two aggregation levels. First customer by item with the number of distinct orders. Then item level: buyer count and reorder rate, filtered to at least 50 buyers so a dish with 3 buyers and 2 repeaters...


Submit Your Answer
Markdown supported