← Google Interview Insights

Google·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Jun 2026

Summary

System design round at Google for a software engineering role. The problem was building a surge pricing calculator, which sounds straightforward but has a lot of moving parts once you start thinking about real-time data at scale.

Questions Asked (1)

Q1

Design a system that computes surge pricing for a ride-sharing platform, where the price multiplier is derived from the ratio of active users (app opens) to available drivers in a given geographic area.

System DesignTechnical Trade-offsPricing & Monetization
Author's notes

The ratio formula itself is simple enough, but I got tripped up on the geo-bucketing part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then propose a high-level architecture that ingests real-time location and app-open events, computes supply/demand ratios per geohash, and applies a pricing multiplier. Dive into data flow, storage, and scaling considerations, and discuss trade-offs like latency vs. accuracy and fairness.

Pro tip: Emphasize the importance of smoothing and hysteresis to avoid price oscillations, and mention how to handle edge cases like driver collusion or sudden demand spikes.

1. Clarify Requirements

Ask about scale (users, drivers, geographic granularity), latency requirements, and business rules (e.g., max multiplier, fairness constraints).

2. High-Level Design

Outline components: event ingestion (app opens, driver locations), stream processing to compute ratios per area, pricing service, and data stores.

3. Detailed Component Design

Explain how to partition by geohash, use sliding windows for real-time counts, and apply smoothing algorithms to compute stable multipliers.

4. Scaling and Reliability

Discuss horizontal scaling, fault tolerance, and how to handle hot spots (e.g., city centers) with techniques like sharding and caching.

5. Trade-offs and Extensions

Address trade-offs (latency vs. accuracy, simplicity vs. fairness) and potential extensions like machine learning for demand prediction.

Key Points to Mention

  • Use geohashing or S2 cells to partition geographic areas for efficient aggregation.
  • Leverage stream processing (e.g., Apache Flink, Kafka Streams) for real-time computation of supply/demand ratios.
  • Apply smoothing (e.g., exponential moving average) and hysteresis to prevent rapid price fluctuations.
  • Consider data consistency and staleness: how often to update multipliers and how to handle late-arriving events.
  • Discuss fairness and ethical considerations: caps on multipliers, driver incentives, and avoiding discrimination.
  • Mention monitoring and A/B testing to validate pricing effectiveness and detect anomalies.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.