For a full example answer with detailed architecture diagrams and deep dives, see our Design Yelp guide. The Yelp guide covers geospatial indexing, search infrastructure, and location-based discovery patterns that form the backbone of a restaurant delivery platform.
Also review the Search, Caching, and Message Queues building blocks for background on geospatial queries, cache invalidation strategies, and event-driven update pipelines.
Design a food delivery marketplace that connects hungry customers with local restaurants. The platform must enable restaurant owners to register their establishments, upload menus with pricing and photos, define delivery zones, and manage operating hours. Customers should discover nearby restaurants through location-based search, filter by cuisine type or dietary preferences, view live availability and estimated delivery times, and browse detailed menus before placing orders.
Your system needs to handle peak dinner hours when millions of concurrent users search for restaurants in dense urban areas. Search results must appear in under 200 milliseconds and reflect real-time changes -- if a restaurant closes, pauses orders due to high volume, or updates its menu, those changes should propagate to user feeds within seconds. The discovery feed is the highest-traffic endpoint in your system, making caching and indexing strategies critical to success while maintaining data freshness.
Based on real interview experiences, these are the areas interviewers probe most deeply:
The core challenge is efficiently finding restaurants that can deliver to a user's location while applying multiple filters. Naive approaches using latitude/longitude calculations in a relational database will fail at scale.
Hints to consider:
The discovery feed serves orders of magnitude more reads than writes, with certain geographic areas (downtown districts) being exponentially hotter than others. Simple caching will not suffice given frequent updates to availability and pricing.
Hints to consider:
Restaurant data changes frequently throughout the day -- operating hours shift, menus get updated, kitchens pause orders during rushes. These changes must propagate to the discovery feed without introducing race conditions or overwhelming downstream systems.
Hints to consider:
Bringing a new restaurant online involves multiple steps across different services -- geocoding addresses, verifying business licenses, processing menu uploads, generating search keywords, and activating payment processing. This is a classic distributed transaction problem.
Hints to consider:
Start by confirming scope and constraints with your interviewer. Ask about expected scale -- how many restaurants and concurrent users? Clarify what "nearby" means -- fixed radius or dynamic based on delivery time? Understand update frequency for different data types -- how often do menus change versus open/closed status? Determine if you need to handle real-time order capacity or just static restaurant information. Confirm whether delivery zone boundaries are simple circles or complex polygons.
Sketch the major components: a Restaurant Service that owns restaurant profiles, menus, and operating hours with a PostgreSQL database as the source of truth; a Discovery Service that handles location-based search requests; a Search Index (Elasticsearch) optimized for geospatial and text queries; a Cache Layer (Redis) for hot geographic regions; and an Event Bus (Kafka) for propagating changes. Draw data flows for both the search path (user request to results) and the update path (restaurant changes to index updates).
Walk through how a user search works end-to-end. Explain your geospatial indexing choice -- Elasticsearch with geo_point fields and geo_distance queries combined with term filters for cuisine. Describe the caching strategy -- Redis storing top 50 restaurants per geohash tile with 5-minute TTLs for the full list and 30-second TTLs for status overlays. Detail the ranking algorithm that considers distance, rating, estimated delivery time, and restaurant availability. Discuss how you filter out ineligible restaurants before scoring to avoid wasted computation.
Cover the restaurant onboarding workflow using a state machine or saga pattern with durable execution. Explain how you would monitor data freshness by comparing timestamps between the source database and search index. Discuss scaling strategies -- sharding the search index by geography and adding read replicas for the restaurant database. Address consistency tradeoffs -- why eventual consistency works for menus but activation status needs stronger guarantees. Touch on observability -- tracking cache hit rates, search latency percentiles, and event processing lag.
Deepen your understanding of the patterns used in this problem: