PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/Google

Design nearest-available-taxi lookup with updates

Last updated: Mar 29, 2026

Quick Overview

This question evaluates the ability to design scalable, low-latency geospatial lookup services under high update and query rates, assessing skills in spatial indexing, real-time state management, partitioning/sharding, and availability-versus-consistency trade-offs.

  • medium
  • Google
  • System Design
  • Software Engineer

Design nearest-available-taxi lookup with updates

Company: Google

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Technical Screen

You are building a backend service for a ride-hailing app. Taxis can **come online** (available) or **go offline** (unavailable) at any time. Clients need to query, for a given location, the **distance (or ETA proxy)** to the nearest available taxi. Assume locations are either: - a discrete grid (cells), or - real-world latitude/longitude coordinates (more realistic). ### Requirements - **API** - `UpdateTaxiStatus(taxi_id, location, status)` where `status ∈ {online, offline}` - `GetNearestTaxi(location) -> (taxi_id, distance)` (or return just `distance`) - **Performance** - Low latency for queries (e.g., p99 < 200 ms) - High update rate (taxis frequently move and toggle availability) - **Correctness** - Prefer the nearest *currently online* taxi; allow small staleness if needed. - **Scale** (example) - 1M taxis globally, 100K updates/sec, 50K queries/sec ### Design questions - What data structures and storage would you use to support fast nearest-neighbor queries under frequent updates? - How would you partition/shard the data? - How would you handle online/offline churn, stale data, and deletion (e.g., lazy deletion)? - If the world were a small fixed grid and the query were “distance for every cell,” when (if ever) would you precompute distances with BFS?

Quick Answer: This question evaluates the ability to design scalable, low-latency geospatial lookup services under high update and query rates, assessing skills in spatial indexing, real-time state management, partitioning/sharding, and availability-versus-consistency trade-offs.

Related Interview Questions

  • Design an Online Coding Judge Platform - Google (medium)
  • Design a pub-sub replay system - Google (hard)
  • How to host many domains on one IP? - Google (medium)
  • Design street-view image ingestion and storage system - Google (hard)
  • Design a global real-time notification system - Google (medium)
Google logo
Google
Jan 10, 2026, 12:00 AM
Software Engineer
Technical Screen
System Design
4
0
Loading...

You are building a backend service for a ride-hailing app.

Taxis can come online (available) or go offline (unavailable) at any time. Clients need to query, for a given location, the distance (or ETA proxy) to the nearest available taxi.

Assume locations are either:

  • a discrete grid (cells), or
  • real-world latitude/longitude coordinates (more realistic).

Requirements

  • API
    • UpdateTaxiStatus(taxi_id, location, status) where status ∈ {online, offline}
    • GetNearestTaxi(location) -> (taxi_id, distance) (or return just distance )
  • Performance
    • Low latency for queries (e.g., p99 < 200 ms)
    • High update rate (taxis frequently move and toggle availability)
  • Correctness
    • Prefer the nearest currently online taxi; allow small staleness if needed.
  • Scale (example)
    • 1M taxis globally, 100K updates/sec, 50K queries/sec

Design questions

  • What data structures and storage would you use to support fast nearest-neighbor queries under frequent updates?
  • How would you partition/shard the data?
  • How would you handle online/offline churn, stale data, and deletion (e.g., lazy deletion)?
  • If the world were a small fixed grid and the query were “distance for every cell,” when (if ever) would you precompute distances with BFS?

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Google•More Software Engineer•Google Software Engineer•Google System Design•Software Engineer System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.