Sign in to keep reading
“Yelp” is free with an account. Your progress and bookmarks follow you across devices.
Sign in to continueDesign a location-based business discovery platform like Yelp - covering geospatial search, reviews, and ratings at scale.
“Yelp” is free with an account. Your progress and bookmarks follow you across devices.
Sign in to continueThink Beyond the Happy Path
Could you answer these today? Tick what you already know.
Design a business discovery platform like Yelp that allows users to:
This is a classic system design question that tests your understanding of geospatial data handling, search optimization, and building read-heavy systems at scale.
FR1 - Search for business entities by location
Users can search for businesses near their current location or a specified address. The search supports filtering by category (restaurants, hotels, etc.), rating, price range, and current availability (open now). Results should be sortable by distance, rating, or relevance.
FR2 - View business details
Users can view comprehensive business information including exact location on a map, contact details, operating hours, menu or service offerings, photos, and a summary of reviews. This page serves as the primary conversion point for users deciding whether to visit a business.
FR3 - Review a business with rating and optional text
Authenticated users can submit reviews consisting of a 1-5 star rating and optional text commentary. Users may also attach photos to their reviews. To maintain review integrity, each user can only submit one review per business within a configurable time window.
NFR1 - Availability over Consistency
The system should prioritize high availability for all client operations. Search and view operations must remain available even during partial system failures. Review display can be eventually consistent - it's acceptable for new reviews to take a few seconds to appear to all users.
In a business review system, users don't expect to see reviews appear instantaneously across all devices. A delay of a few seconds is acceptable because:
This allows us to use caching aggressively and replicate data asynchronously, significantly improving read performance and availability.
NFR2 - Scalability
The system should support 10 million businesses and 100 million monthly active users. Based on real-world data (Yelp has ~60M MAU as of 2024), this provides comfortable headroom for growth.
NFR3 - Performance (Read-Heavy)
Search and view operations should complete within 1-2 seconds. Given the read-to-write ratio (searches vastly outnumber reviews), the system must be optimized for read performance.
Let's estimate the query load:
QPS Calculation:
A well-optimized PostgreSQL instance can handle 10-20K QPS for spatial queries, so a single primary with read replicas should suffice initially.
NFR4 - Fault Tolerance
The system should gracefully handle component failures without complete service disruption. Failed components should be automatically detected and traffic rerouted to healthy instances.
NFR5 - Compliance
Each user can rate a business only once within a configurable time period to prevent rating manipulation and spam.