Design Natural-Language Search for a Food Delivery App
Understanding the Problem
🔎 What is natural-language search in a food delivery app? It's the search box in an app like DoorDash, Uber Eats, Swiggy or Zomato, built to handle how people actually type when they're hungry. Not just "Domino's" or "pad thai," but "protein food under 30 min," "spicy biryani near me," "cheap vegan lunch" or "something warm, it's raining." The system has to work out what the user wants to eat, which parts of the query are hard constraints, and which nearby dishes and restaurants best fit, right now, for this user.
Most food search traffic is still short: a restaurant name or a dish. Those queries need fast, exact matching. The long tail of descriptive queries is where users give up, and where an ML-heavy design pays off. We'll design one system that handles both, because a search that's clever about "high-protein dinner" but can't find "McDonald's" is worse than what we started with.
The search infrastructure itself (inverted indexes, sharding, index updates) is covered in Elasticsearch and Post Search, and the delivery app around it in Design a Food Delivery App. Here we focus on the models: understanding the query, retrieving candidates, and ranking them.
Functional Requirements
Core Requirements
- Users should be able to search with natural language that mixes dishes and cuisines ("biryani," "Thai"), attributes ("spicy," "high protein," "vegan"), and constraints ("under 30 min," "under $15," "near me," "open now").
- Results should show dishes and restaurants that satisfy the hard constraints and match the intent, grouped sensibly (a restaurant with its matching dishes).
- Ranking should be personalized and context-aware: the user's location, history and dietary patterns, the time of day, and conditions like weather.
- Search should be robust to misspellings, transliterations and mixed languages ("biriyani," "paneer tikka masala," "chikn").
Below the line (out of scope)
- The home feed and browse surfaces. See Homepage Recommendation.
- Sponsored results in search.
- A conversational assistant that builds a cart over several turns. See AI Shopping Assistant.
- Autocomplete (it shares the query understanding, but it's a different latency problem).
Non-Functional Requirements
Core Requirements
- Scale: 30 million daily active users, of whom about 40% search, around 2.5 times each: 30 million searches a day, about 350 per second on average and roughly 1,500 per second at the dinner peak.
- Catalog: around 500,000 restaurants and 50 million menu items globally, but any one user can only order from what delivers to them: typically a few thousand restaurants and a few hundred thousand dishes.
- Latency: results in under 300 ms at p95 on the server.
- Freshness: whether a restaurant is open, whether a dish is sold out and the delivery ETA change minute to minute and must be right in results. Menu edits should be searchable within minutes.
- Safety: dietary filters like "vegan" and "gluten-free" must be trustworthy. A guessed "vegan" tag on a dish with fish sauce is a real harm, not a relevance bug.
Below the line (out of scope)
- Multi-region replication of the index.
A little arithmetic shapes the design. 1,500 QPS is modest, so raw throughput isn't the issue. The question is how much model we can afford per query in 300 ms.
- An LLM call to parse each query would take a few hundred milliseconds, eating the whole budget, and at 1,500 QPS it's a large serving bill. But the query distribution is head-heavy: a few tens of thousands of distinct queries make up a large share of traffic. Parse those offline, cache the result, and only the long tail needs live parsing by a small, fast model.
- The geo filter is our friend. Retrieval doesn't search 50 million dishes; it searches the few hundred thousand that deliver to this user. That keeps vector search and ranking cheap.
- A cross-encoder (a transformer that reads the query and a dish together) costs a few milliseconds per pair on a GPU when batched. We can afford it for the top 50 to 100 candidates, not for thousands.
"Under 30 minutes" isn't a text-matching problem. It's a filter on a predicted number, the delivery ETA, that changes every minute. Good answers notice that half of these queries are really structured queries in disguise, and that the structured half is the part users are least forgiving about.
Framing It as an ML Problem
ML Objective
The business cares about:
- Search conversion: the share of searches that lead to an order.
- GMV per search and time to order.
- Null and low-result rate and reformulation rate (the user typed again because the results were bad).
What the ranker optimizes is the probability that the user orders (or adds to cart) each result, given the query, the user and the context. But conversion alone is a dangerous target: it would happily rank a popular pizza place first for "vegan salad" because people order there a lot. So relevance is a separate objective with its own labels, and a result must be relevant before conversion gets a say. Constraint satisfaction ("every result really is under 30 minutes") is a hard rule, not a learned score.
Inputs and Outputs
- Input: the query text, the user (ID, delivery address, history), context (time, day, weather at the address, device, app language).
- Output: a ranked list of restaurants with their matching dishes (or dishes with their restaurants, depending on the query), each satisfying the hard constraints, plus the parsed interpretation so the app can show filter chips ("High protein · Under 30 min") the user can remove.
Choosing the ML Approach
The system is a pipeline of four ML problems:
- Query understanding: classification (intent: restaurant name, dish, cuisine, attribute browse) and slot filling (dish = biryani, spice = hot, max_eta = 30 min). This turns text into a structured query plus a free-text remainder.
- Retrieval: get a few thousand candidates from the deliverable catalog that could match. We care about recall. Lexical search alone misses vocabulary mismatch ("protein food" → "grilled chicken bowl"); vector search alone misses exact names and numbers. We use both: hybrid retrieval.
- Ranking: a learning-to-rank model orders candidates by relevance and conversion. We care about precision at the top.
- Re-ranking and presentation: enforce constraints, group dishes by restaurant, diversify.
Data and Labels
Sources
- Search logs: query, parsed interpretation, results shown with positions, clicks, add-to-carts, orders, reformulations.
- Catalog: restaurants (cuisine, location, hours, rating, price level), menu items (name, description, price, category, photos, modifiers), merchant-declared tags (vegetarian, vegan, gluten-free, halal, spice level).
- Order history per user.
- Operational signals: open/closed, item availability, ETA predictions, delivery fees.
- Reviews, which describe dishes in the words users search with ("the spiciest vindaloo in town").
How labels are produced
- Implicit engagement. For each (query, result) we observe a graded outcome: impression only, click, add to cart, order. A natural graded label is order = 3, add-to-cart = 2, click = 1, none = 0. Orders often happen several minutes after the search, after browsing the menu, so attribute them within a session window.
- Position bias. Users click the top results more because they're on top. Training naively on clicks teaches the model to agree with the old ranking. Correct for it with inverse propensity weighting: estimate how likely each position is to be examined (from a small amount of randomization, like swapping adjacent results for a sliver of traffic), and weight clicks by the inverse.
- Human relevance labels. Raters judge (query, dish) pairs on a graded scale: exact match, good substitute, related, irrelevant. Expensive (cents to tens of cents per judgment) but unbiased, and essential for evaluation and for queries with little traffic.
- LLM-generated relevance labels. An LLM judge, given the query, the dish name, description and restaurant, produces graded labels at a fraction of the cost. Calibrate it against a human-labeled set first and keep checking agreement; use it to scale labels to millions of pairs, especially for the long tail.
- Query-parse labels: a few thousand annotated queries with their slots, plus synthetic queries generated from the catalog ("high-protein bowl under $15") with known slots.
Imbalance. Orders are rare: most impressions get nothing. Downsample negatives in training, keep all positives, and remember the rate if you need calibrated probabilities.
Leakage. Popularity features ("orders for this dish in the last 7 days") must be computed as of the search time, not including the order that's the label. And split evaluation sets by time, so the model isn't tested on queries from the same days and sessions it trained on.
Feature Engineering
Query features
- The parsed slots: dish, cuisine, attributes, constraints, intent class.
- A query embedding from the query encoder.
- Query popularity and category (a restaurant-name query behaves very differently from an attribute query).
Dish and restaurant features
- A dish embedding from its name, description, category and photo, and a restaurant embedding from its menu and cuisine.
- Attributes: merchant-declared tags, plus inferred ones (spice level, protein content, "comfort food") from an offline tagging model (deep dive 3).
- Price, rating, review count, popularity and conversion rate overall and per query category ("this restaurant converts well on biryani searches").
- Predicted delivery ETA and fee for this user's address (from ETA Prediction), open status, prep time.
User features
- Cuisines and dishes ordered before, typical order value (price sensitivity), inferred dietary pattern (has only ever ordered vegetarian), favourite restaurants, time-of-day habits.
Context features
- Hour, day of week, meal period (breakfast, lunch, late night), weather at the delivery address (rain, temperature), local events, device.
Cross features
- Lexical match scores (BM25 between the query and the dish name, description and restaurant name).
- Embedding similarity between the query and the dish.
- User × restaurant order count, user × cuisine affinity.
- Query category × dish historical CTR and conversion.
Batch vs real-time. Embeddings, attribute tags, per-category conversion rates and user profiles are batch (daily). Open status, availability, ETAs and in-session behaviour (the user just viewed three Indian restaurants) are real-time, from the order and availability streams into an online store. Training uses point-in-time snapshots from the offline store. See Feature Store.
Modeling
Query understanding
Bad Solution: Keywords and Regex Rules
Approach
Tokenize the query, match words against cuisine and dish dictionaries, and extract constraints with patterns like under (\d+) ?(min|mins|minutes) and under \$?(\d+).
Challenges
It handles the common phrasings and fails on everything else: "quick," "in half an hour," "not too pricey," "something light." It can't tell "Thai" the cuisine from "Thai Basil" the restaurant, and it doesn't know that "protein food" should map to an attribute, not to a dish literally named "protein." Still, keep the regexes as a cheap first pass; they're precise for the patterns they cover.
Good Solution: Intent Classifier Plus a Slot-Tagging Model
Approach
Fine-tune a small transformer encoder (a distilled BERT-sized multilingual model) for two tasks: intent classification (restaurant name, dish, cuisine, attribute browse, mixed) and token-level slot tagging with BIO labels (B-DISH, B-ATTR, B-MAX_ETA...). Normalize the tagged spans against the catalog's vocabulary: "biriyani" and "biryani" map to the same dish entity, "hot" and "spicy" to the same attribute. Restaurant names are matched against an index of names in the user's area, so "Thai Basil" is recognized as a restaurant when one exists nearby.
Challenges
Runs in a few milliseconds and covers most queries. It needs labeled data for every slot type, and it maps spans to a fixed set of slots, so it struggles with vague intents ("something healthy but filling," "comfort food") that don't reduce to one attribute.
Great Solution: Structured Parsing, With an LLM Offline and a Small Model Online
Approach
Treat query understanding as semantic parsing into a structured query:
"protein food under 30 min"
→ { attributes: [high_protein], max_eta_min: 30, intent: attribute_browse }
"spicy biryani near me"
→ { dish: biryani, attributes: [spicy], sort_hint: distance, intent: dish }
"cheap vegan lunch"
→ { dietary: [vegan] (hard), price: low (soft), meal: lunch, intent: attribute_browse }
Each slot is marked hard (a filter: dietary requirements, explicit time or price limits) or soft (a ranking signal: "spicy," "cheap," "healthy").
- Offline, an LLM parses the head and torso of the query distribution (the top few hundred thousand distinct queries) into this schema. Results are reviewed on a sample and cached in a key-value store keyed by the normalized query. A large share of traffic hits this cache.
- Online, for cache misses, a small fine-tuned seq2seq model (or the slot tagger above) produces the same schema in under 20 ms. It's trained on the LLM's parses plus human-labeled queries, effectively a distillation of the LLM.
- The free-text remainder ("something light") goes to the query embedding, so vague intent still drives dense retrieval.
Challenges
The LLM can mis-parse in confident ways ("Thai Basil" parsed as the cuisine Thai with an attribute "basil"); reviewing a sample of head-query parses and checking them against the local restaurant-name index catches most of it. The cache must be refreshed as the catalog changes (a new restaurant named "Protein House" changes what "protein food" means locally). And hard vs soft is a judgment call: treat only explicit dietary requirements and explicit numeric limits as hard.
Retrieval
Bad Solution: Lexical Search Only
Approach
Index dishes and restaurants in Elasticsearch or OpenSearch with BM25 over names, descriptions and categories, filtered to restaurants that deliver to the user.
Challenges
Great for names and exact dishes, and it should stay in the system. But it fails on vocabulary mismatch: "protein food" doesn't match "grilled chicken bowl" or "paneer tikka," "something warm" doesn't match "pho." Synonym lists help and never end.
Good Solution: Dense Vector Retrieval
Approach
Train a two-tower model: a query encoder and a dish encoder (name, description, category, restaurant cuisine, and optionally an image embedding), trained so that the dot product is high for (query, ordered dish) pairs. Index dish embeddings in an ANN index (HNSW, via a vector database or a vector field in OpenSearch) and fetch the nearest few hundred to the query embedding.
Challenges
It captures meaning, but it's fuzzy where users want precision. "Domino's" may retrieve other pizza places above Domino's; "under $15" means nothing to an embedding; numbers, rare dish names and new restaurants with little training data are weak spots. And the geo and availability filters must be applied inside the ANN search, not after, or you fetch 500 nearest dishes and find that 480 don't deliver to this user.
Great Solution: Hybrid Retrieval With Structured Filters
Approach
Run several retrievers in parallel, all restricted to the user's deliverable set and to the hard constraints:
- Lexical (BM25) on names and descriptions, with normalized dish entities and synonyms from query understanding.
- Dense (two-tower ANN) on the query embedding, including the free-text remainder.
- Attribute retrieval: a structured query on tags ("high_protein AND open_now AND eta ≤ 30"), ordered by popularity, which handles pure attribute queries where neither text nor embeddings are great.
Merge them with reciprocal rank fusion (each candidate scores the sum of 1 / (k + rank) across lists) or simply union them and let the ranker decide; the ranker sees which retrievers found each candidate as a feature.
For filtered vector search at this scale, partition the index by city or delivery zone, so each ANN search runs over a few hundred thousand vectors that are mostly deliverable, and apply the remaining filters (open, ETA) during the search. Most vector databases support filtered HNSW search; partitioning keeps the filter selective enough to be fast.
Challenges
Three retrievers mean three indexes to keep fresh and three latency tails. The ETA filter is on a predicted value that changes every minute, so it doesn't belong in the index; it's applied from the online store to the merged candidates before ranking. Keep a per-query candidate cap so one retriever can't flood the ranker.
A common interview trap is "just embed everything and do vector search." Ask what happens with a restaurant name, a price limit and a dietary filter. Hybrid retrieval with hard filters in front is the standard answer for a reason.
Ranking
Ranking runs in two passes over a few thousand candidates:
- First pass: a GBDT learning-to-rank model (LambdaMART in LightGBM or XGBoost) over all the features above: lexical scores, embedding similarity, which retrievers found it, attribute matches with the parsed slots, rating, ETA, price, per-category conversion, user affinities and context. It's fast (well under a millisecond per candidate on CPU) and trims the list to about 100.
- Second pass: a cross-encoder over the top 100. A small transformer reads the query together with the dish's name, description and restaurant, producing a relevance score that understands nuance a dot product can't ("spicy" vs "not spicy," "chicken" vs "chicken-free"). Its score is combined with personalization and conversion features in a final small model. Trained mostly on LLM and human relevance labels, it's the part of the system that keeps conversion from overriding relevance.
The final score is effectively relevance gate × (conversion and personalization): candidates below a relevance threshold drop out, and among the relevant ones, the user's tastes, ETA, price and context decide the order.
Re-ranking and presentation then applies business logic: group matching dishes under their restaurants (top 3 dishes per restaurant), cap how many results come from one chain, diversify cuisines for broad queries, and remove anything that's closed, sold out or that fails a hard constraint.
Training
Two-tower retrieval. Train on (query, ordered dish) and (query, added-to-cart dish) pairs with a softmax over in-batch negatives, corrected for popularity (logQ correction) so popular dishes aren't unfairly penalized. Add hard negatives: dishes that are lexically close but wrong ("chicken biryani" for a "veg biryani" query) and dishes shown but skipped. Augment the long tail with synthetic queries: an LLM writes plausible searches for each dish ("high protein lunch bowl," "spicy lamb rice"), which gives new and rarely searched dishes training signal.
Cross-encoder. Fine-tune on graded relevance labels (LLM judgments calibrated against human labels) with a pointwise or pairwise loss, then distill into a smaller model if latency demands it.
LTR ranker. LambdaMART with the graded engagement labels (order = 3 down to none = 0), position-bias weights from the propensity model, and the cross-encoder score as a feature. Because LambdaMART optimizes NDCG directly, it focuses on getting the top of the list right.
Query parser. Fine-tune on human-labeled queries plus a larger set of LLM-parsed queries. Retrain when the slot schema changes.
Cadence. Retrain the ranker weekly. Recompute dish embeddings daily, and immediately for new or edited menu items (only the dish tower needs to run). Refresh the head-query parse cache daily. Retrain the two-tower model monthly or when evaluation shows recall slipping.
Evaluation
Offline Metrics
- Query understanding: slot-level precision and recall and whole-query exact match on a labeled set, with separate numbers for hard constraints (a missed "vegan" is much worse than a missed "cheap").
- Retrieval: recall@K (did the dish the user ordered, or the dishes raters marked relevant, appear in the top K candidates?), per retriever and for the merged list.
- Ranking: NDCG@10 on graded human and LLM relevance labels, and NDCG or MRR on engagement labels from held-out sessions. Both, because relevance and conversion can disagree.
- Constraint satisfaction: the share of results that actually meet the hard constraints (every result under 30 minutes, every "vegan" result really vegan). Target 100%.
- Null-result rate on a replay of real queries.
Slice everything by query type (name, dish, attribute, constrained), city, language and query frequency (head, torso, tail). The tail is where natural-language search earns its keep.
Online Metrics and A/B Testing
- Primary: search conversion rate, GMV per search.
- Secondary: click-through rate, time from search to add-to-cart, reformulation rate, null-result rate.
- Guardrails: p95 latency, filter-chip removal rate (users removing a filter we inferred suggests we misread them), complaints about dietary mismatches, restaurant-side exposure concentration.
Interleaving is a fast way to compare two rankers: merge their result lists for the same query and see which one's results get more clicks and orders. It needs far less traffic than an A/B test to detect a difference, which helps for query slices with little traffic. Confirm winners with a regular user-level A/B test, since interleaving can't measure effects like reformulation.
Serving
The flow for one search:
- The Search API normalizes the query (lowercase, Unicode normalization, spelling correction) and looks it up in the parse cache. On a miss, the query understanding model parses it.
- Retrieval fans out in parallel to the lexical index, the vector index (the user's zone partition) and the attribute index, all filtered to restaurants that deliver to the user's address and to hard dietary constraints.
- Candidates are merged and deduplicated. The service fetches features in one multi-get: open status, availability, ETA and fee for this address, popularity, user features.
- Candidates failing real-time hard constraints (closed, sold out, ETA over the limit) are dropped.
- The GBDT ranker scores the rest; the cross-encoder scores the top 100 on GPU.
- Re-ranking groups, diversifies and returns the page with the parsed filter chips.
Latency budget (300 ms p95):
| Step | Budget |
|---|---|
| Normalize, spell-correct, parse (cache hit or small model) | ~20 ms |
| Retrievers in parallel | ~60 ms |
| Merge + feature fetch (incl. ETAs) | ~40 ms |
| GBDT ranker on ~2,000 candidates | ~20 ms |
| Cross-encoder on top 100 (GPU, batched) | ~50 ms |
| Re-rank, assemble | ~10 ms |
| Network and slack | the rest |
Keeping the index fresh. Menu edits stream through Kafka into the lexical and attribute indexes as partial document updates, and through the dish tower into the vector index, within minutes. Open status and sold-out flags change too often to reindex; they're read from the online store at query time. ETAs come from the ETA service, cached per (restaurant, customer cell, couple of minutes).
Caching results. Full result pages aren't cacheable across users (personalization, location), but the expensive non-personal parts are: parses per query, and retrieval candidates per (normalized query, delivery zone) for a minute or two. That removes most retrieval load for head queries at peak.
Fallbacks. If the query model times out, fall back to the regex parse. If the vector index is slow, return lexical and attribute results only. If the cross-encoder is slow, use the GBDT order. Search should degrade to "good keyword search," never to an error.
Potential Deep Dives
1) How do we handle hard constraints like "under 30 min" or "under $15"?
Constraints are where users lose trust fastest: one 45-minute result in an "under 30 min" search and the feature looks broken.
- Filter, don't boost. Hard constraints are filters applied after retrieval and before ranking. Ranking can't put a 45-minute restaurant at position 8.
- Predicted values need a margin. The ETA is a prediction with uncertainty. Filter on a high quantile (say the p80 ETA ≤ 30), so "under 30" is a promise we usually keep, not a coin flip.
- Know what the number means. "Under $15" could mean the dish price or the total with fees. Pick the dish price and say so in the filter chip ("Dishes under $15"), so users can see our interpretation.
- Relax gracefully. If the constraints leave too few results, show what's there and then a clearly labelled section: "A bit longer: 30-40 min." Never silently drop the constraint.
- Make the parse visible. Filter chips the user can tap to remove make a wrong parse cheap to fix, and removal rates are a great signal for improving the parser.
2) How do we use context like weather and time of day?
Context helps the most for vague queries ("something warm," "dinner") and the least for specific ones ("Domino's").
Bad Solution: Hand-Written Context Rules
Approach
If it's raining, boost soups and comfort food; at breakfast, boost breakfast items.
Challenges
Rules are easy to explain and quickly become a pile of guesses nobody tests. They apply the same boost to every query, so a user searching "sushi" in the rain gets ramen in their results.
Good Solution: Context as Ranker Features
Approach
Feed weather, temperature, hour and meal period into the ranker alongside everything else. It learns from data how much rain shifts conversion toward soups, and only where it matters.
Challenges
The model learns context effects averaged over all queries. Since specific queries dominate traffic, those effects can be weak in exactly the vague queries where context should matter most.
Great Solution: Context Features Crossed With Query Intent
Approach
Cross context with the intent class from query understanding (attribute browse, cuisine, vague) so the ranker can learn that context matters a lot for "something warm" and hardly at all for a restaurant name. For truly vague queries, retrieval can add a context-aware source: dishes whose embeddings are close to what users ordered in similar conditions (rainy weekday evenings in this city).
Challenges
Weather effects are seasonal and local, so evaluate in slices (rainy days in each city), and keep context from overriding explicit intent: the relevance gate from the cross-encoder ensures the user's words still come first.
3) How do we tag dishes with attributes the menu doesn't state?
"High protein," "spicy" and "comfort food" rarely appear in a menu. We infer them offline:
- An attribute model (an LLM or a fine-tuned VLM over name, description, category, restaurant cuisine and photo) assigns attribute tags with confidence: spice level, approximate protein content, "light," "comfort food." It runs on every new or edited dish, batched, and the results are reviewed on a sample.
- Reviews add evidence: "the spiciest vindaloo I've had" supports a high spice level.
- Inferred tags are soft signals. They drive ranking and attribute retrieval, never hard filters.
- Dietary and allergen tags are different. "Vegan," "gluten-free," "halal" and allergen claims come only from the merchant (or a verified source), because a wrong guess can hurt someone. If a user searches "vegan," the hard filter uses only declared tags; dishes that are probably vegan but undeclared can appear in a separate section with clear wording, or not at all, depending on policy.
Drawing the line between inferred attributes (good for ranking) and declared dietary claims (required for filtering) is the kind of judgment interviewers look for. It's also an easy place to show you've thought about user harm, not just NDCG.
4) How do we handle misspellings, transliterations and mixed languages?
Food names travel across languages and alphabets: "biryani," "biriyani," "briyani," "बिरयानी"; "pho" typed as "fo"; "chikn."
- Spelling correction from query logs: users who type a misspelling often immediately retype it correctly. Mining these reformulation pairs gives a correction dictionary specific to food, which a general spellchecker doesn't have.
- Character n-gram matching in the lexical index catches small typos.
- Multilingual, character-aware encoders for the query tower, trained on queries in all the app's languages, so transliterations and native scripts land near each other in embedding space.
- Entity normalization in query understanding maps every variant to one dish entity, which makes all downstream features consistent.
5) Should we just put an LLM in the query path?
It's tempting: an LLM understands "protein food under 30 min" out of the box. But at 1,500 QPS with a 300 ms budget, a per-query LLM call is too slow and too expensive for most of the traffic, and it adds a new class of failure (confident misreadings) to the most-used box in the app.
Where LLMs pay off is around the query path:
- Parsing head and torso queries offline into the parse cache.
- Generating synthetic queries to train retrieval for new dishes.
- Labeling relevance at scale for the cross-encoder and for evaluation.
- Tagging dish attributes.
Live LLM calls make sense for a separate conversational experience (a shopping assistant), where users expect a second or two and a multi-turn dialogue. For the search box, a distilled small model is the right trade-off.
6) How do new restaurants and dishes get found?
A new restaurant has no clicks, no orders and no per-category conversion rate, so a ranker trained on engagement will bury it.
- Content-based signals: dish embeddings and attribute tags work from the menu alone, so retrieval finds new dishes on day one.
- Priors: use the cuisine's and the area's average conversion as a starting estimate, shrunk toward the restaurant's own data as it accumulates.
- Exploration: give new restaurants a small, bounded boost in relevant searches for their first weeks, and measure whether they convert.
What is Expected at Each Level?
Mid-level
You should split the problem into query understanding, retrieval and ranking, explain why keyword search alone fails on descriptive queries, and propose embeddings plus a lexical index. You should use clicks and orders as labels, suggest a GBDT learning-to-rank model, and measure NDCG and search conversion.
Senior
You should design hybrid retrieval with geo and hard-constraint filters, parse queries into hard and soft slots, and explain the relevance-vs-conversion tension with a relevance gate. Expect to discuss position bias in click labels, hard negatives for the two-tower model, filtering on a quantile of the predicted ETA, a latency budget for a two-pass ranker, and why an LLM shouldn't sit in the hot path.
Staff+
You should drive the trade-offs across the whole system: where LLMs earn their cost (offline parsing, labeling, tagging, synthetic data) and how to distill them, how to keep inferred attributes from becoming unsafe dietary claims, how context interacts with intent, and how evaluation combines human labels, LLM judges, interleaving and A/B tests. Expect to discuss index freshness for availability, graceful degradation, exploration for new restaurants and how search and the home feed share models without competing for the same metrics.