Design search for a food delivery app
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Uber's system design round, last asked Nov 2025. It tests search, geospatial and indexing.
Design the search of a large food delivery app. A user types a restaurant name ("Joe's Pizza"), a cuisine ("Thai", "sushi") or a dish ("pad thai", "vegan burger") and gets a ranked list of restaurants, and possibly individual dishes, that can deliver to their location now. Ranking weighs relevance, whether the restaurant is open, delivery distance, estimated delivery time, ratings, promotions and business rules. Walk through the whole design, from requirements to monitoring.
Requirements
- Functional: search by restaurant name, cuisine or dish; only restaurants that deliver to the user's location; filters such as open now, price, rating and delivery time; pagination.
- Functional: ranking by relevance plus distance or ETA, popularity and rating, with optional personalization.
- Non-functional: p95 latency around 200 ms inside the service; high availability; fresh results when restaurants close, items sell out or prices change; millions of users, hundreds of thousands of restaurants, high query volume.
Clarifying questions
- Are dishes returned as their own results, or only restaurants with matching dishes?
- How is "delivers to the user" defined: a radius, a polygon per restaurant, or a live ETA check?
- How fresh must availability be: seconds or minutes?
- Which ranking signals exist today, and is there click and order history to learn from?
- Do promoted (paid) results appear in the same list?
What a strong answer covers
- A search API with query, location, filters and a page token, and a response with restaurants, matching dishes, ETA and price info.
- Sources of truth (restaurant profiles, menus, availability, prices, ETAs, ratings, promotions, user context), split into slow-changing data and fast-changing data.
- A search index with one document per restaurant, holding name, cuisines, dish names and geo data, supporting text, geo and structured filters; an indexing pipeline fed by change events.
- The query flow: gateway, query understanding (spelling, synonyms, cuisine detection), candidate retrieval with geo filtering, hard filters, enrichment with live signals (open now, ETA, stock), ranking, pagination.
- Ranking that grows from a weighted sum of signals into a multi-stage learned ranker trained on clicks and orders, with personalization.
- Real-time updates: fast-changing fields kept outside the index or patched in place; how a closure or stock-out shows up within seconds.
- Scale and failure: sharding by geography, replicas, caching popular queries per area with short TTLs, degraded modes (fall back to heuristic ranking when ETA is down).
- Monitoring: search quality (click-through, conversion, zero-result rate), latency, freshness lag and business impact, with dashboards and alerts.
Follow-ups
- Freshness against latency: when do you call the ETA service per result, and when do you precompute?
- Lexical against semantic matching: "something spicy" or "healthy lunch". How would you add embeddings?
- Online ranking against precomputed rankings per area.
- A restaurant closes early on a busy night. Trace how long it keeps appearing and how to shorten that.
Where it's asked
- Uber · System design · Last asked Nov 202560 min · Whiteboard and discussion
What it tests
search · geospatial · indexing
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
