System design interview questionHard
Uber

Design Uber Surge Pricing

Design a dynamic pricing engine for a ride-sharing service.

1. Problem Statement

Design a surge pricing system like Uber's for our ride-hailing platform. We need to update prices every minute based on local supply and demand heatmaps.

2. Architecture Discussion Map

Use this as one discussion aid, not a single correct answer. Your design should follow from the requirements, scale, and trade-offs you establish.

Rendering architecture diagram...
Mermaid Source (For AI Bots)
graph TD
    A[Rider/Driver Apps] -->|WebSocket/gRPC| B(API Gateway)
    B --> C[Location Ingestion Service]
    C -->|Kafka Topic: Locations| D[Flink Stream Processor]
    D -->|Aggregates per S2 Cell| E[(Redis: Heatmap Cache)]
    E -.->|Pulls TTL Data| F[Pricing Engine]
    F -->|Updates| G[(Cassandra: Price History)]
    F -->|Pushes Real-time Price| B

3. Key Focus Areas

  • 1
    Geospatial Indexing (Hierarchical Cells or Geohashes)
  • 2
    Supply/Demand Aggregation (Streaming)
  • 3
    Consistency (Price Lock)
  • 4
    Latency (Calculate price < 50ms)
  • 5
    Feedback Loop (Throttling)

4. What the Interviewer Looks For

The interviewer probes these areas, and the report grades the interview against them.

  • Requirements and estimation
  • Geospatial bucketing and aggregation
  • Pricing computation and market stability
  • Quote serving and price lock
  • Reliability, abuse, and audit

Want interactive feedback?

Practice drawing this system component-by-component on a live whiteboard while the interviewer probes at your target level.

Continue to Dashboard

Core Concepts

System DesignReal-time AnalyticsQuote Tokens and Idempotency

Continue preparing

Build a complete software engineer mock interview plan

Related System Design

Design a Cross-Product Tagging System

Design a shared tagging service that lets users apply tags to entities across multiple Atlassian products, with consistent search and deduplication.

Related System Design

Design a Notification System

Design a scalable notification service that sends emails, SMS, and push notifications to millions of users.