Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Map Points-of-Interest Catalog

Serve hotels and tourist attractions as pins on a pannable, zoomable map, backed by a catalog that merges several partner feeds and editor corrections.

Problem statement

For this exercise, assume a travel web app shows a world map of places. Every map item is a place: either a tourist attraction or a hotel, with a name, type, category, location, and rating.

Place data comes from several partner feeds and from in-house editors, and the same real-world place often appears in more than one feed.

A visitor pans and zooms the map and sees the places in the visible rectangle as pins, filtered by type and minimum rating; when too many places fit, the response groups nearby places into counted clusters instead. Tapping a pin opens a place card.

When the visitor has entered travel dates, each hotel pin may also show a from-price that a separate pricing service supplies; the map backend only calls that service. Design the entities, APIs, architecture, and data flow for the read-heavy map, and for how feed and editor changes become one trusted place.

Exclude drawing map tiles, routing and travel time, free-text search, reviews, room availability, booking, and computing prices.

What to build

  1. A visitor can request the places inside a rectangular map area at a zoom level, filtered by type and minimum rating, and receives either individual pins or counted clusters, never more than a fixed number of items.
  2. A visitor can open one place by its identifier and read its details, including a place that was merged from several feeds.
  3. Partner feeds can add, update, and retire places, and editors can correct a place's name, location, type, or category; copies of the same real-world place from different feeds appear as one place, and an editor's correction is not undone by a later feed update.
  4. When travel dates are supplied, hotel pins show a from-price from the pricing service for up to the 100 highest-rated hotels in view, and a slow or failed price lookup leaves the pins on the map without prices instead of failing the request.

At scale

  • For this exercise, assume the catalog holds 8 million places and a viewport response carries at most 500 items.
  • Assume peak traffic is 20,000 viewport requests per second, mostly overlapping rectangles over popular city centers at common zoom levels, and a viewport response should return within 200 milliseconds at the 95th percentile.
  • Assume feeds deliver on average 300 place records per second, most of them repeats of data the catalog already holds, a partner re-sending its whole file can burst to 5,000 per second, and a real change should show on the map within 5 minutes.
  • Assume one price lookup covers up to 100 hotels and is allowed at most 150 milliseconds, so a response with more hotel pins prices only the 100 highest-rated in view and shows the rest without a price, and the pricing service may be slow or unavailable.