ProblemFeeds and search
Nearby places
Find the restaurants and shops near someone, with reviews and ratings, in any city, as they move the map.
The brief
Local discovery · suggested for Mid-level
Design a nearby places service
Design a nearby places service: people search about 200 million places near them or on the map, about 60,000 times a second at peak, with filters, ratings, reviews and photos.
A service helps people find places near them: restaurants, cafés, shops, dentists. They search near where they are, or in the part of the map they are looking at, by keyword and category, and filter by open now, price and rating; results are ranked by how close, how good and how relevant each place is. A place page shows its details, hours, rating, reviews and photos. Signed-in users write reviews with a star rating and add photos; owners change their details and hours, or mark the place closed. Design the service: how places, reviews and photos are stored, how a search finds and ranks places near someone, how ratings stay right as reviews arrive, and how it holds up in the busiest and emptiest parts of the world.
Functional requirements
- CorePeople search for places near where they are, or in the part of the map on screen, by keyword and category.
- CoreResults can be filtered by open now, price and minimum rating, and are ranked by a mix of distance, rating and relevance, a page at a time.
- CoreA place page shows its details, hours, rating, reviews (newest or most useful first) and photos.
- CoreSigned-in users write reviews with a star rating, edit or delete them, and add photos.
- CoreOwners change their place’s details and hours, including holiday hours, or mark it closed.
- CoreFake or paid reviews don’t count toward a place’s rating.
Non-functional requirements
- LatencyA search returns within about 200 ms at p99.
- ConsistencyA new review appears on its place’s page within about a minute, and in its rating within a few minutes.
- ConsistencyA change to hours, or a closure, shows in search within about 10 minutes.
- AvailabilitySearch keeps working when reviews or photos are slow or down.
- LatencyPhotos load quickly anywhere in the world.
- SecurityReviews that are fake or paid for don’t count toward a place’s rating.
Scale
- ScaleAbout 200 million places worldwide; the busiest square kilometre (Midtown Manhattan) has about 10,000, while rural areas can have none within 20 km.
- ScaleAbout 100 million daily users; about 20,000 searches a second on average and about 60,000 at the evening peak, moving the map included.
- ScaleAbout 1 billion reviews, about 2 million new a day; about 5 billion photos, about 5 million new a day.
- ScaleAbout 1 million place edits a day.
- ScaleOn New Year’s Eve, about 20,000 searches a second come from around Times Square.
- ScaleUsers worldwide; the service runs in three regions (US, EU and Asia).
Nice to mention (below the line)
- Below the lineReservations and ordering.
- Below the lineMessaging owners.
- Below the lineAds and paid placement.
Out of scope
- Out of scopePersonalised recommendations.
The variant
One fully specified brief, with the level it suits best. You can practise it at any level.
- Local discoverySuggested for Mid-level
A service for finding about 200 million places nearby: search near you or on the map, filter and rank, read reviews and see photos, and write your own.
7 steps · 4 must-pass · about 38 min at Mid-level
What each level is graded on
Local discovery, step by step. A result at a level needs its must-pass steps answered, and only the steps you answer count. Going up a level adds steps or holds them to a stricter bar.
| Step | Entry level | Your levelMid-level | Senior | Staff |
|---|---|---|---|---|
| The numbers that shape the design (optional) | Graded | Graded | Graded | Graded |
| Places, reviews and photos | Graded | Graded | Graded | Graded |
| The search and place calls | Graded | Graded | Graded | Graded |
| From “pizza near me” to a result page | Must-passcan block | Must-passcan block | Must-passcan block | Must-passcan block |
| Midtown and Montana | Must-pass | Must-pass | Must-passcan block | Must-passcan block |
| Best pizza, open now | Must-pass | Must-pass | Must-pass | Must-pass |
| Reviews pour in | — | Must-pass | Must-pass | Must-pass |
| New Year’s Eve in Times Square | — | — | Must-pass | Must-pass |
| Every city, three regions | — | — | — | Must-pass |
| At this level | 6 steps 3 must-pass about 32 min | 7 steps 4 must-pass about 38 min | 8 steps 5 must-pass about 44 min | 9 steps 6 must-pass about 51 min |
Entry level6 steps · 3 must-pass · about 32 min
- The numbers that shape the design (optional)Graded
- Places, reviews and photosGraded
- The search and place callsGraded
- From “pizza near me” to a result pageMust-passcan block
- Midtown and MontanaMust-pass
- Best pizza, open nowMust-pass
Mid-levelYour level7 steps · 4 must-pass · about 38 min
- The numbers that shape the design (optional)Graded
- Places, reviews and photosGraded
- The search and place callsGraded
- From “pizza near me” to a result pageMust-passcan block
- Midtown and MontanaMust-pass
- Best pizza, open nowMust-pass
- Reviews pour inMust-pass
Senior8 steps · 5 must-pass · about 44 min
- The numbers that shape the design (optional)Graded
- Places, reviews and photosGraded
- The search and place callsGraded
- From “pizza near me” to a result pageMust-passcan block
- Midtown and MontanaMust-passcan block
- Best pizza, open nowMust-pass
- Reviews pour inMust-pass
- New Year’s Eve in Times SquareMust-pass
Staff9 steps · 6 must-pass · about 51 min
- The numbers that shape the design (optional)Graded
- Places, reviews and photosGraded
- The search and place callsGraded
- From “pizza near me” to a result pageMust-passcan block
- Midtown and MontanaMust-passcan block
- Best pizza, open nowMust-pass
- Reviews pour inMust-pass
- New Year’s Eve in Times SquareMust-pass
- Every city, three regionsMust-pass
- Must-pass
- a result at that level needs this step answered.
- Can block
- a miss there is a Blocking issue at that level.
Going up a level
- Mid-level
- Adds “Reviews pour in”, must-pass.
- Senior
- A miss on “Midtown and Montana” can now block the result.Adds “New Year’s Eve in Times Square”, must-pass.
- Staff
- Adds “Every city, three regions”, must-pass.
Skills this problem practises
Your coach tracks readiness per skill across every problem you practise. Each links to the lesson that teaches it.
- Capacity estimation
- API design
- Data modelling
- Choosing storage
- Indexing
- Sharding and partitioning
- High-level architecture
- Queues and async messaging
- Caching
- Traffic surges and backpressure
- Consistency and concurrency
- Observability and operations
- Rate limiting and abuse
Worked solution
Try it first: practise a variant, then read the walkthrough and compare it with your own design. Reading it first makes the practice much less useful.
Learn: Design YelpYour history
Sign in to see your sessions on this problem.