CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/System Design Interview Classics

πŸ“ System Design Interview Classics Β· C4 Architecture Β· Pro

Ride Matching System (Uber-style)

The core of a ride-hailing app: drivers stream their locations, a geo index finds nearby drivers, and a matching service offers the trip to the best one.

More System Design Interview Classics templates

C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.

Drawing diagram…

What this diagram shows

  • Driver locations are updated every 4 seconds into a geo index
  • Matching offers the trip to one driver at a time with a timeout
  • Trips and payments are handled by separate services

Prompt used

Ride-hailing design: driver apps send GPS every 4 seconds to a location service that updates a geospatial index in Redis (geohash). Rider apps request a trip through the trip service. The matching service finds nearby available drivers, ranks them by ETA and offers the trip to one driver at a time. Accepted trips are stored in PostgreSQL. A pricing service computes fare and surge, and a payment service charges the rider at the end.

Mermaid code
C4Container
title Ride Matching
Person(rider, "Rider", "Requests trips")
Person(driver, "Driver", "Accepts trips")
System_Boundary(rh, "Ride Platform") {
  Container(loc, "Location Service", "Go", "Ingests driver GPS")
  ContainerDb(geo, "Geo Index", "Redis GEO", "Available drivers by area")
  Container(trip, "Trip Service", "Java", "Trip requests and status")
  Container(match, "Matching Service", "Go", "Finds and offers best driver")
  Container(price, "Pricing Service", "Python", "Fare and surge")
  Container(pay, "Payment Service", "Java", "Charges riders")
  ContainerDb(db, "Trip DB", "PostgreSQL", "Trips and history")
}
System_Ext(maps, "Maps API", "Routes and ETA")
Rel(driver, loc, "GPS every 4 s", "WebSocket")
Rel(loc, geo, "Updates position")
Rel(rider, trip, "Requests trip", "HTTPS")
Rel(trip, price, "Gets fare")
Rel(trip, match, "Find driver")
Rel(match, geo, "Nearby drivers")
Rel(match, maps, "ETA")
Rel(match, driver, "Trip offer")
Rel(trip, db, "Saves trip")
Rel(trip, pay, "Charge at end")

Inside this diagram

A C4 architecture diagram of Ride Matching with 2 people, 7 building blocks, 1 outside system and 10 relationships.

People

  • Rider: Requests trips
  • Driver: Accepts trips

Inside the system

  • Location Service (Go): Ingests driver GPS
  • Trip Service (Java): Trip requests and status
  • Matching Service (Go): Finds and offers best driver
  • Pricing Service (Python): Fare and surge
  • Payment Service (Java): Charges riders

Databases and queues

  • Geo Index (Redis GEO): Available drivers by area
  • Trip DB (PostgreSQL): Trips and history

Outside systems

  • Maps API: Routes and ETA

Boundaries

  • Ride Platform

How they connect

  • Driver β†’ Location Service: GPS every 4 s (WebSocket)
  • Location Service β†’ Geo Index: Updates position
  • Rider β†’ Trip Service: Requests trip (HTTPS)
  • Trip Service β†’ Pricing Service: Gets fare
  • Trip Service β†’ Matching Service: Find driver
  • Matching Service β†’ Geo Index: Nearby drivers
  • Matching Service β†’ Maps API: ETA
  • Matching Service β†’ Driver: Trip offer
  • Trip Service β†’ Trip DB: Saves trip
  • Trip Service β†’ Payment Service: Charge at end

Make your own diagram like this

Describe your own system in plain English and the AI C4 diagram generator draws it in seconds, in the same style as this template.

Related templates

C4 ArchitectureProSystem Design Interview Classics

URL Shortener System Design

The classic interview design for a service like bit.ly: short code generation, fast redirects from a cache, and click analytics processed separately.

SequenceSystem Design Interview Classics

Chat App Message Delivery (WhatsApp-style)

How a one-to-one chat message is delivered in a WhatsApp-style system, with sent, delivered and read ticks, and push notifications when the receiver is offline.

Data FlowSystem Design Interview Classics

Social News Feed (Twitter-style)

How posts reach followers' feeds: fan-out on write for normal users, fan-out on read for celebrities, and a ranked feed built from a cache.

FlowchartSystem Design Interview Classics

API Rate Limiter (Token Bucket)

How a token bucket rate limiter decides whether to let an API request through, using Redis so all servers share the same counts.

DeploymentProSystem Design Interview Classics

Notification Service Design

A notification system that sends email, SMS and push messages at scale: one API, a queue per channel, user preferences, and retries.

Data FlowSystem Design Interview Classics

Search Autocomplete (Typeahead)

How search suggestions appear as you type: a prefix index built offline from past searches, served from memory, and refreshed regularly.