You are building the restaurant recommendation system for a food-delivery platform like Uber Eats or DoorDash. When a user opens the app, the home feed must rank nearby restaurants in a way that converts to orders, while respecting hard logistics: the restaurant must be open, inside the delivery radius, and able to deliver on time given the current courier supply.
How would you design this system? Cover the retrieval and ranking architecture, the features and objectives, and how you handle cold start for new restaurants.

The Problem: a million restaurants platform-wide, but only a few hundred can actually deliver to this user right now. Rank the right ones first, inside a lunch-rush latency budget.
Answer
The design is a multi-stage funnel with a hard logistics gate in front: a geo/open/ETA filter cuts the catalog to the few hundred restaurants that can actually serve the request, multi-source retrieval (two-tower embeddings, co-order graphs, trending-nearby) proposes candidates, a multi-task ranker scores them for order probability, basket value, and delivery time, and a re-ranker enforces cuisine diversity and new-restaurant exploration. The two decisions that make or break the system are treating deliverability as a constraint rather than a feature, and reserving exploration slots so new restaurants ever get seen.
(1) Funnel, Not One Model: filter → retrieve → rank → re-rank, so each stage stays cheap enough for the 50 ms feed budget.
(2) Logistics As Hard Filters: open hours, delivery radius, courier supply, and predicted ETA gate eligibility before any learned model runs.
(3) Context-Heavy Features: time of day, day of week, weather, and session activity matter as much as long-term taste, because lunch intent differs completely from late-night intent.
(4) Multi-Objective Ranking: combine P(order), expected basket value, and delivery-time risk into one score with explicit business weights.
(5) Cold Start By Construction: content-based embeddings give new restaurants a Day-1 representation, and reserved exploration slots guarantee them impressions.

Figure 1: The serving funnel: about one million restaurants shrink to roughly 300 deliverable candidates, then to a ranked top-20 feed. The dashed loop is the offline retraining path fed by logged impressions and orders.
Clarify Before Designing:
(1) Scale: how many cities, restaurants, and daily active users, and what is the peak feed QPS at lunch?
(2) Latency Budget: how many milliseconds for the home feed, and are personalized search results in scope too?
(3) Objective Priority: is the north star order conversion, gross merchandise value, or delivery-time reliability?
(4) Cold-Start Volume: how many new restaurants onboard per week, and in how many cities?
(5) Constraints: must we support sponsored slots, dietary filters, and per-market regulations?
Leave a Reply