Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Map Tiles, Routing, and ETA Service

Design the backend of a map app that serves zoomable map tiles, finds a driving route, and gives an arrival time that follows live traffic.

Problem statement

For this exercise, assume a consumer map app on phones and browsers. A person pans and zooms a base map, enters a start and a destination, receives a recommended driving route with ordered turn steps and an estimated arrival time (ETA), and sees the ETA change during the trip when traffic ahead slows down.

Scope the road network to one country, driving only. The base map and road data are rebuilt as one numbered release every week, and traffic comes from anonymous speed readings sent by devices that are on a trip.

Exclude place search, public transit, street-level imagery, reviews, and sharing a live location with other people.

What to build

  1. Return the map tile for any zoom level from 0 to 18 and any tile position, so the client can draw the viewport the person is looking at.
  2. Return a recommended driving route between two points, with its distance, ordered turn steps, and a line the client can draw.
  3. Return an ETA that reflects current traffic, and let an active trip learn that its ETA changed materially.
  4. Publish each weekly release so that the tiles and routes one person sees in a session come from the same release.

At scale

  • Assume 50 million daily users create 300,000 tile requests per second at peak, mostly for dense city areas.
  • Assume a country-scale road network of about 500 million road segments, 4,000 route requests per second at peak, and a 95th-percentile route response under 1 second.
  • Assume 2 million active trips each send one speed reading every 5 seconds, about 400,000 readings per second, and a traffic change should reach ETAs within 2 minutes.
  • Assume a new release is built every week, and the previous release stays readable for 48 hours so open sessions can finish.