← Questions
Design Yelp: nearby business search and reviews
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Design a local business review service like Yelp. Users find businesses near a location by category and rating, read and write reviews, and upload photos. Reads far outnumber writes.
Requirements
- Functional: search businesses near a point or in a map area, filtered by category, rating, price and open now; business pages with details, ratings, reviews and photos; write and edit reviews; upload photos; business owners update their details.
- Non-functional: low-latency search; read-heavy traffic; tens or hundreds of millions of businesses and reviews; new reviews visible within minutes; ratings resistant to fake reviews.
Clarifying questions
- How many businesses, users and searches per second?
- Is search by radius, by visible map area, or both?
- How fresh must ratings and new reviews be?
- How are results ranked: distance, rating, relevance?
- Do we handle fake review detection in scope?
What a strong answer covers
- A data model: businesses (with location), reviews, photos, users; average rating and review count kept on the business and updated as reviews arrive.
- A geospatial index (geohash, quadtree or a search engine's geo queries) combined with filters, and why businesses, which rarely move, suit a precomputed index.
- Search ranking from distance, rating, review count and text relevance; pagination.
- Read scaling with caches for business pages and popular searches, read replicas, and a CDN for photos.
- The write path for reviews and photos, moderation, and updating ratings and the search index asynchronously.
- Fake review detection signals, and monitoring.
Follow-ups
- Show only businesses open now, across time zones and holidays.
- A business gets thousands of reviews in an hour after going viral.
- Search a dense city center where a small radius holds thousands of results.
- Personalize results for each user.
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. Free with an account: one full answer per company.
What the labs asked this week
A weekly email of what OpenAI, Anthropic and the other top AI labs asked engineers, round by round.
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. Free with an account: one full answer per company.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing

