← Uber Interview Insights

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

Senior
May 2026

Summary

System design round at Uber for a software engineering role, focused entirely on designing the shopping cart service for a food delivery app. Pretty intense scope, lots of moving parts, and they pushed hard on the tradeoffs.

Questions Asked (6)

Q1

Design the shopping cart service for an Uber Eats-style food delivery application.

System DesignTechnical Trade-offsData Modeling
Author's notes

The core question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying functional and non-functional requirements, then design the data model and API for cart operations, ensuring consistency and scalability. Discuss trade-offs between consistency models, storage choices, and how to handle concurrent updates and pricing changes.

Pro tip: Emphasize the need for idempotent operations and optimistic concurrency control to handle duplicate requests and concurrent cart modifications, which is critical in a high-traffic food delivery system.

1. Clarify Requirements

Ask questions to understand scope: single restaurant vs multi-restaurant carts, guest vs authenticated users, real-time menu updates, and expected scale. Define functional (add/remove items, update quantity, checkout) and non-functional (latency, consistency, availability) requirements.

2. Design Data Model and API

Propose a schema for carts, cart items, and menu items, considering relationships and denormalization for performance. Define RESTful or GraphQL APIs for cart operations, including idempotency keys for mutations.

3. Choose Storage and Consistency Model

Select a database (e.g., DynamoDB, Cassandra, or PostgreSQL) based on access patterns and consistency needs. Discuss trade-offs between strong consistency (for accurate pricing) and eventual consistency (for availability), and how to handle menu price changes.

4. Address Scalability and Concurrency

Explain how to partition data (e.g., by user ID) to scale horizontally. Implement optimistic concurrency control (versioning) or distributed locks to handle concurrent cart updates, and use caching for read-heavy operations.

5. Handle Edge Cases and Integration

Cover scenarios like item availability changes, price updates, cart expiration, and merging guest carts upon login. Discuss integration with order service, payment, and inventory systems, ensuring idempotency and fault tolerance.

Key Points to Mention

  • Idempotency of cart operations to prevent duplicate items from retries
  • Optimistic concurrency control (e.g., version numbers) for handling concurrent updates
  • Data partitioning strategy (e.g., by user ID) for horizontal scalability
  • Trade-offs between strong and eventual consistency for pricing and availability
  • Caching strategies (e.g., Redis) for frequently accessed cart data
  • Handling guest carts and merging upon user login

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

Q2

How would you handle two devices editing the same cart simultaneously, and what are the tradeoffs between optimistic and pessimistic concurrency control here?

System DesignTechnical Trade-offs
Author's notes

Said optimistic first, then kind of walked it back when they asked what happens on conflict.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints of the cart editing scenario, then compare optimistic and pessimistic concurrency control in terms of user experience, system complexity, and consistency. Finally, propose a hybrid or context-specific solution, such as optimistic locking with conflict resolution for most cases, and explain the tradeoffs.

Pro tip: Demonstrate awareness of real-world constraints like network latency and user experience by suggesting a strategy that minimizes user friction, such as optimistic concurrency with automatic merge or user-assisted conflict resolution.

1. Clarify Requirements and Constraints

Ask questions to understand the expected frequency of concurrent edits, tolerance for conflicts, and user experience goals. This shows you don't jump to solutions without context.

2. Explain Optimistic Concurrency Control

Describe how it works (e.g., version numbers, timestamps) and its benefits: high concurrency, no locking overhead. Mention drawbacks: potential conflicts requiring resolution, possible lost updates if not handled.

3. Explain Pessimistic Concurrency Control

Describe locking mechanisms (e.g., database locks, distributed locks) and its benefits: strong consistency, no conflicts. Mention drawbacks: reduced concurrency, potential deadlocks, and poor user experience if locks are held long.

4. Compare Tradeoffs in the Cart Context

Discuss how each approach affects user experience, system scalability, and complexity. For example, optimistic is better for low-contention scenarios, while pessimistic may be needed for high-contention or critical sections.

5. Propose a Solution and Justify

Recommend a specific approach or hybrid (e.g., optimistic with conflict resolution UI, or pessimistic for specific operations) and explain why it fits the cart use case, considering Uber's scale and user expectations.

Key Points to Mention

  • Optimistic concurrency control: versioning, compare-and-swap, conflict detection and resolution strategies (e.g., merge, user prompt).
  • Pessimistic concurrency control: locking granularity (row-level, cart-level), lock timeouts, deadlock avoidance.
  • Tradeoffs: latency vs consistency, user experience (blocking vs conflict resolution), system complexity, scalability.
  • Real-world examples: how e-commerce platforms handle cart conflicts (e.g., Amazon's approach).
  • Hybrid approaches: using optimistic for most operations and pessimistic for critical sections (e.g., checkout).
  • Uber's context: high concurrency, need for low latency, and potential for distributed systems challenges.

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

Q3

If a menu item's price changes while a user is in the middle of checking out, how does your system handle that?

System DesignTechnical Trade-offs
Author's notes

Blanked for a second.

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 price change is allowed to affect in-progress checkouts and what the business rules are. Then, propose a design that handles the race condition, such as versioning or locking, and discuss trade-offs between consistency and user experience. Finally, outline how you would implement and test the solution.

Pro tip: Demonstrate awareness of the business impact: sometimes it's better to honor the original price to avoid user frustration, even if it means a small loss. Mentioning this shows you think beyond pure technical correctness.

1. Clarify requirements and constraints

Ask questions to understand the expected behavior: Should the user see the new price? Is the old price honored? What are the consistency requirements? This shows you don't jump to solutions.

2. Identify the race condition and failure modes

Explain that the price change can happen concurrently with checkout, leading to inconsistency. Discuss scenarios like user seeing old price but being charged new price, or vice versa.

3. Propose a technical solution

Suggest approaches like optimistic concurrency control (versioning), pessimistic locking, or snapshot isolation. Explain how you would implement it, e.g., storing the price at checkout initiation and validating at payment.

4. Discuss trade-offs

Compare consistency vs. availability, user experience vs. business rules, and complexity vs. correctness. Mention that sometimes a business decision (e.g., honor original price) simplifies the technical solution.

5. Outline testing and monitoring

Describe how you would test the solution (e.g., race condition tests, load tests) and monitor for price mismatches in production.

Key Points to Mention

  • Race condition between price update and checkout process
  • Optimistic vs. pessimistic concurrency control
  • Versioning or timestamping of menu items
  • Snapshot of price at checkout initiation
  • Business rules: honor original price or update user
  • User experience and communication (e.g., notifying user of price change)
  • Idempotency and consistency in payment processing

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

Q4

Walk me through your storage choices for the cart service, considering write-heavy workloads and low-latency read requirements.

System DesignData Modeling
Author's notes

This part actually went well.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the cart service's access patterns and consistency requirements, then propose a hybrid storage architecture that separates the write-heavy cart updates from low-latency reads. Justify each choice with trade-offs around scalability, latency, and cost, and mention how you would handle data consistency and failure scenarios.

Pro tip: Emphasize that you would use an in-memory data store like Redis for the active cart with write-behind persistence to a durable store like Cassandra or DynamoDB, and highlight how this aligns with Uber's need for real-time, high-throughput cart operations.

1. Clarify Requirements

Ask about expected write throughput, read latency SLA, data size, and consistency needs (e.g., eventual vs. strong). This shows you don't jump to solutions without understanding the problem.

2. Propose Primary Store for Writes

Choose a write-optimized store such as Cassandra or DynamoDB for durable persistence, explaining how its LSM-tree or SSD-based design handles high write volumes and provides tunable consistency.

3. Add Caching Layer for Low-Latency Reads

Introduce an in-memory cache like Redis or Memcached to serve reads with sub-millisecond latency, and describe cache invalidation strategies (e.g., TTL, write-through) to keep data fresh.

4. Address Consistency and Data Flow

Explain how writes propagate from cache to durable store (e.g., write-behind, change data capture) and how you handle conflicts, idempotency, and eventual consistency for cart operations.

5. Discuss Scalability and Trade-offs

Cover partitioning/sharding by user ID, replication for availability, and trade-offs like cost, operational complexity, and potential data loss in the cache layer.

Key Points to Mention

  • Write-heavy workload: use LSM-tree based stores (Cassandra, ScyllaDB) or DynamoDB for high write throughput.
  • Low-latency reads: employ in-memory caching (Redis) with appropriate eviction policies and data structures (e.g., hashes for cart items).
  • Data consistency: choose eventual consistency for cart updates with idempotent operations, or strong consistency if required for checkout.
  • Partitioning strategy: shard by user ID to distribute load and ensure locality for cart operations.
  • Durability and recovery: persist cart data asynchronously to a durable store and use write-ahead logging or change data capture.
  • Trade-offs: balance latency, cost, and complexity; consider fallback to durable store if cache misses or failures occur.

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

Q5

How would you design the API for the cart service, and how do you ensure idempotency for client retries?

API & IntegrationsSystem Design
Author's notes

Went with REST, scoped cart operations to a cart ID with item-level endpoints.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (e.g., scale, consistency needs, client types) and then outline a RESTful API with core cart operations (add, update, remove, get). For idempotency, propose using idempotency keys for write operations, ensuring that retries with the same key produce the same result without side effects.

Pro tip: Mention that idempotency keys should be stored with a TTL and that the server should return the original response for duplicate requests, not just a success code. Also, highlight the importance of handling concurrent requests with the same key using locking or atomic operations.

1. Clarify Requirements

Ask about expected traffic, consistency requirements, and client behavior to tailor the design. This shows you consider context before diving into solutions.

2. Design Core API Endpoints

Define resource-oriented endpoints for cart operations (e.g., POST /carts/{cartId}/items, PATCH /carts/{cartId}/items/{itemId}, DELETE /carts/{cartId}/items/{itemId}, GET /carts/{cartId}). Specify request/response schemas and status codes.

3. Introduce Idempotency Mechanism

Explain that clients generate a unique idempotency key (e.g., UUID) for each write request and include it in a header (e.g., Idempotency-Key). The server stores the key and the response, and on duplicate requests, returns the stored response.

4. Address Concurrency and Storage

Discuss how to handle concurrent requests with the same key (e.g., using distributed locks or atomic writes) and where to store keys (e.g., Redis with TTL, database). Mention trade-offs between consistency and latency.

5. Summarize and Discuss Trade-offs

Wrap up by summarizing the design and highlighting trade-offs (e.g., storage overhead, TTL choices, failure scenarios). This demonstrates holistic thinking.

Key Points to Mention

  • Use of idempotency keys for POST/PATCH/DELETE requests to ensure retries are safe.
  • Storing idempotency keys with a TTL to avoid unbounded growth and to handle key expiration.
  • Returning the same response (including status code and body) for duplicate requests to maintain consistency.
  • Handling concurrent requests with the same idempotency key using locking or atomic operations to prevent race conditions.
  • Choosing appropriate HTTP methods and status codes (e.g., 201 Created, 200 OK, 409 Conflict for duplicate in-flight requests).
  • Considering scalability and performance implications of idempotency storage (e.g., using Redis for low-latency access).

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

Q6

How would you apply promotions, coupons, taxes, and delivery fees at checkout, and where does that logic live in your architecture?

System DesignAPI & Integrations
Author's notes

I put this in a separate pricing service called at checkout time rather than baking it into the cart.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scope and requirements, then propose a modular architecture where pricing logic is centralized in a dedicated service. Walk through the checkout flow, explaining how each component (promotions, coupons, taxes, delivery fees) is applied in a deterministic order, and discuss trade-offs like consistency, latency, and scalability.

Pro tip: Emphasize idempotency and auditability: ensure that applying these adjustments is idempotent to handle retries, and log every calculation for debugging and compliance. Also, mention that taxes and fees may vary by region, so the system should be configurable and extensible.

1. Clarify Requirements and Constraints

Ask about expected scale, consistency needs, regulatory requirements, and whether real-time or batch processing is acceptable. Confirm the order of applying promotions, coupons, taxes, and fees.

2. Design the Pricing Service

Propose a dedicated Pricing Service that encapsulates all logic for promotions, coupons, taxes, and delivery fees. It should expose APIs for calculating the final price given a cart and user context.

3. Define the Calculation Pipeline

Outline a deterministic sequence: apply promotions, then coupons, then taxes, then delivery fees. Explain how each step may depend on previous ones and how to handle stacking rules and exclusions.

4. Address Data and Integration

Discuss how the service retrieves promotion rules, coupon validity, tax rates, and delivery fee schedules from databases or external services. Mention caching and fallback strategies for performance and resilience.

5. Ensure Reliability and Scalability

Talk about idempotency, versioning of pricing rules, auditing, and horizontal scaling. Consider using event-driven updates for rule changes and handling high concurrency during peak times.

Key Points to Mention

  • Order of operations: promotions -> coupons -> taxes -> delivery fees, with clear rules for stacking and exclusions.
  • Idempotency and auditability: every calculation should be reproducible and logged for compliance and debugging.
  • Separation of concerns: pricing logic in a dedicated service, decoupled from checkout and payment systems.
  • Configurability and regional variations: tax rates and fee structures vary by location, so rules should be data-driven.
  • Performance and scalability: caching, precomputation, and asynchronous updates to handle high traffic.
  • Error handling and fallbacks: graceful degradation if external services (e.g., tax API) are unavailable.

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