← Uber Interview Insights

Uber·Backend Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Apr 2026

Summary

Uber backend round, object-oriented design for a parking lot. Felt manageable at first but the concurrency and extensibility parts caught me flat-footed near the end.

Questions Asked (5)

Q1

Design and implement an object-oriented model for a parking lot with multiple levels, spot size categories, vehicle types, and a full park/leave/query API.

System DesignData ModelingAPI & Integrations
Author's notes

I started with the class hierarchy and it went fine, Vehicle and Spot and Ticket are all pretty natural.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then define core entities and their relationships using object-oriented principles. Design a clean API that encapsulates parking logic, and discuss scalability, concurrency, and extensibility. Walk through a concrete example to demonstrate correctness.

Pro tip: Emphasize separation of concerns: keep spot allocation, pricing, and persistence as independent services or modules. This shows you think beyond basic OOP and consider real-world maintainability and scalability.

1. Clarify Requirements

Ask about expected scale, vehicle types, spot sizes, levels, pricing rules, and concurrency needs. Confirm functional and non-functional requirements.

2. Identify Core Entities

Define classes like ParkingLot, Level, ParkingSpot, Vehicle, Ticket, and Payment. Establish relationships (e.g., ParkingLot has Levels, Level has Spots).

3. Design the API

Specify methods for park(vehicle), leave(ticket), and query methods like getAvailableSpots(vehicleType). Ensure the API is intuitive and covers all use cases.

4. Handle Allocation and Concurrency

Describe strategies for finding suitable spots (e.g., first-fit, best-fit) and ensuring thread safety with locks or atomic operations.

5. Discuss Extensibility and Scalability

Mention how to extend for new vehicle types or spot sizes, and how to scale horizontally (e.g., sharding by level or using a distributed lock).

Key Points to Mention

  • Use of inheritance and polymorphism for vehicle and spot hierarchies (e.g., Vehicle base class, Car/Truck subclasses; SpotSize enum).
  • Design patterns like Strategy for allocation algorithms and Factory for creating vehicles/spots.
  • Concurrency control: locking mechanisms (e.g., per-level locks) to prevent double-booking.
  • Database schema and persistence: how to store spots, tickets, and transactions; indexing for fast queries.
  • Pricing and payment integration: how fees are calculated based on duration and vehicle type.
  • Error handling and edge cases: full lot, invalid ticket, lost ticket, etc.

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

Q2

How would you search for the next available spot efficiently across levels and spot types?

Algorithms & Data StructuresSystem Design
Author's notes

Talked about keeping a per-level queue of free spots indexed by type.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: define what 'next available spot' means (e.g., nearest in time or space) and the data model (levels, spot types, availability). Then propose an efficient data structure like a segment tree or priority queue per level and spot type, and discuss query and update complexities, scalability, and concurrency.

Pro tip: Mention that in a real system like Uber, you'd likely use a distributed cache (e.g., Redis) with sorted sets for fast lookups, and handle consistency with optimistic locking or versioning to avoid race conditions when multiple users search simultaneously.

1. Clarify requirements and constraints

Ask questions to understand the scale (number of levels, spot types, spots), definition of 'next available' (e.g., nearest, earliest), and read/write patterns. This ensures you design the right solution.

2. Choose data structures

Propose efficient structures like a segment tree or Fenwick tree for range queries per level and spot type, or a priority queue (min-heap) for earliest availability. Consider a hash map for O(1) access to level-type combinations.

3. Design the search algorithm

Outline how to query across levels and spot types: e.g., iterate over levels and types, query each structure for the next available spot, and compare results to find the global best. Discuss time complexity (e.g., O(log n) per query).

4. Address scalability and concurrency

Explain how to scale horizontally (sharding by level or region) and handle concurrent updates (e.g., locking, optimistic concurrency, or atomic operations). Mention caching for hot data.

5. Discuss trade-offs and alternatives

Compare your approach with alternatives (e.g., database indexes, in-memory grids) and justify choices based on latency, consistency, and cost. Mention monitoring and fallback strategies.

Key Points to Mention

  • Time and space complexity of the proposed data structures and algorithms
  • Handling multiple spot types and levels efficiently (e.g., nested data structures or composite keys)
  • Concurrency control to prevent double-booking (e.g., distributed locks, CAS operations)
  • Scalability considerations: sharding, replication, and caching (e.g., Redis sorted sets)
  • Trade-offs between consistency and availability (CAP theorem) in a distributed setting
  • Real-world example: Uber's H3 geospatial indexing or similar for location-based searches

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

Q3

Two vehicles arrive at the same level simultaneously. How do you ensure a spot is assigned atomically without double-booking?

System DesignTechnical Trade-offs
Author's notes

This is where I felt the pressure.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, such as whether the assignment must be strictly atomic and what consistency guarantees are needed. Then propose a solution using a database transaction with row-level locking or a distributed lock, and discuss trade-offs like latency, scalability, and failure handling. Finally, mention alternative approaches like optimistic concurrency control or a queue-based system.

Pro tip: Emphasize that true atomicity often requires a single source of truth, and discuss how you would handle edge cases like network partitions or lock timeouts to show depth.

1. Clarify Requirements

Ask about the expected scale, latency requirements, and whether the system is distributed. Confirm that the goal is to prevent double-booking and ensure atomicity.

2. Propose a Locking Mechanism

Suggest using a database transaction with SELECT FOR UPDATE or a distributed lock (e.g., Redis Redlock) to serialize access to the spot assignment.

3. Discuss Trade-offs

Compare locking approaches: database locks are simpler but may not scale; distributed locks add complexity but handle scale. Mention optimistic concurrency as an alternative.

4. Handle Failure and Edge Cases

Explain how to handle lock timeouts, retries, and idempotency to avoid deadlocks or double assignments in failure scenarios.

5. Summarize and Recommend

Conclude with a recommended approach based on the clarified requirements, and note any monitoring or metrics needed to ensure correctness.

Key Points to Mention

  • Database transactions with row-level locking (e.g., SELECT FOR UPDATE)
  • Distributed locking systems like Redis or ZooKeeper
  • Optimistic concurrency control (version numbers or timestamps)
  • Idempotency and retry mechanisms to handle failures
  • Trade-offs between consistency, latency, and scalability
  • Use of a queue or serialization point to process assignments sequentially

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

Q4

How would you extend this design to support EV charging spots, reservations, and license-plate-based entry and exit?

System DesignTechnical Trade-offsAdaptability & Ambiguity
Author's notes

Ran out of steam here a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the existing design and the new requirements (EV charging, reservations, license-plate entry/exit). Then propose extensions to the data model, services, and APIs, focusing on scalability, consistency, and real-time constraints. Discuss trade-offs and potential bottlenecks, and outline how you would validate the design.

Pro tip: Emphasize idempotency and exactly-once processing for license-plate events to avoid double-charging or incorrect spot allocation, and consider using a distributed lock or reservation system to handle concurrency.

1. Clarify Requirements and Assumptions

Ask questions to understand the scale, existing architecture, and specific needs for EV charging (e.g., power levels, payment), reservations (e.g., advance booking, cancellation), and license-plate entry/exit (e.g., accuracy, latency).

2. Extend Data Model

Propose new entities: EVChargingSpot (with attributes like connector type, power), Reservation (with time slots, user, spot), and LicensePlateEvent (with plate number, timestamp, gate ID). Define relationships and indexes for efficient queries.

3. Design Services and APIs

Outline new microservices or extensions: Reservation Service (handles booking, availability), Charging Service (manages charging sessions, billing), and Access Control Service (processes license plate events, validates entry/exit). Define REST/gRPC endpoints and event flows.

4. Address Scalability and Consistency

Discuss partitioning (e.g., by region or spot ID), caching for availability, and consistency models (e.g., strong consistency for reservations, eventual for analytics). Use queues for asynchronous processing of license plate events.

5. Handle Edge Cases and Trade-offs

Cover scenarios like concurrent reservations, license plate misreads, charging session interruptions, and payment failures. Discuss trade-offs between latency and accuracy, and propose monitoring and fallback mechanisms.

Key Points to Mention

  • Idempotency and deduplication for license plate events to prevent double entry/exit processing.
  • Reservation system with optimistic locking or distributed locks to handle concurrent bookings.
  • Integration with payment systems for EV charging and reservations, including pre-authorization and settlement.
  • Real-time availability updates using pub/sub or WebSockets for user-facing apps.
  • Data partitioning and sharding strategies to scale with number of spots and reservations.
  • Fallback mechanisms for license plate recognition failures (e.g., manual override, QR code).

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

Q5

How do you model the pricing policy so that different spot types can have different hourly rates and a minimum charge?

System DesignPricing & Monetization
Author's notes

Made this a separate PricingPolicy class that the Ticket references at checkout.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what are the different spot types, how are rates determined, and how is the minimum charge applied. Then propose a data model that separates pricing rules from spot instances, using a flexible structure like a pricing policy table with rate tiers and minimum charge fields. Finally, discuss how to enforce the minimum charge in the billing logic, considering factors like proration and time granularity.

Pro tip: Mention that the minimum charge should be applied per billing period (e.g., per hour or per day) and consider edge cases like partial hours or early termination. Also, highlight the importance of making the pricing policy versioned and auditable for financial compliance.

1. Clarify Requirements

Ask questions to understand the spot types, how rates vary (e.g., by time of day, location, demand), and the exact semantics of the minimum charge (e.g., per hour, per day, per session).

2. Design Data Model

Propose a schema with a pricing_policy table that includes fields like spot_type, hourly_rate, minimum_charge, and effective dates. Consider using a JSON column for flexible rate tiers or a separate rate_tiers table.

3. Define Billing Logic

Explain how to compute the charge: calculate the duration, multiply by the hourly rate, then apply the minimum charge if the computed amount is lower. Discuss proration for partial hours and how to handle rounding.

4. Handle Edge Cases

Address scenarios like overlapping policies, policy changes mid-billing period, and spot types with no minimum charge. Mention the need for idempotent billing operations.

5. Ensure Scalability and Auditability

Discuss how to cache pricing policies for performance, version policies for audit trails, and log billing decisions for debugging and compliance.

Key Points to Mention

  • Separation of pricing policy from spot instances to allow independent updates.
  • Use of effective dates and versioning to handle policy changes over time.
  • Application of minimum charge as a floor on the calculated amount, not as an additional fee.
  • Consideration of time granularity (e.g., per second, per minute) and rounding rules.
  • Caching strategies to avoid frequent database lookups for pricing policies.
  • Audit logging of billing calculations for financial reconciliation and dispute resolution.

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