← Uber Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at Uber for a backend role. The whole thing was basically one big cart service question that branched into like six different conversations. More open-ended than I expected, less algorithmic.

Questions Asked (7)

Q1

Design the shopping cart service for a food delivery app like Uber Eats, including adding, updating, and removing items with quantities and per-item customizations, scoped to a single restaurant.

System DesignData ModelingAPI & Integrations
Author's notes

This is the core question and it sounds straightforward until you realize how many edge cases are hiding in 'per-item customizations.' I started with a basic CRUD API and a document store, which was fine, but I spent too long on the data model before they nudged me toward the harder parts.

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 endpoints for cart operations scoped to a single restaurant. Focus on how to handle item customizations, quantity updates, and concurrency, and discuss trade-offs like stateless vs. stateful carts and consistency guarantees.

Pro tip: Emphasize idempotency and optimistic concurrency control to handle duplicate requests and race conditions, which are critical in high-throughput food delivery systems. Also, consider how cart data will be persisted and expired to align with business rules like restaurant availability.

1. Clarify Requirements and Scope

Ask questions to understand expected scale, latency, consistency needs, and edge cases like multiple devices or concurrent modifications. Confirm that the cart is scoped to a single restaurant and that customizations are per-item.

2. Design Data Model

Define entities: Cart, CartItem, and Customization. Specify fields, relationships, and how to represent quantities and customizations (e.g., nested objects or separate tables). Consider using a unique cart ID per user-restaurant pair.

3. Define API Endpoints

Outline RESTful endpoints for adding, updating, and removing items, with request/response schemas. Include idempotency keys for mutating operations and discuss versioning or ETags for concurrency control.

4. Address Concurrency and Consistency

Explain how to handle concurrent updates (e.g., optimistic locking with version numbers) and ensure atomicity of operations. Discuss trade-offs between strong and eventual consistency for cart data.

5. Discuss Storage and Scalability

Choose a storage solution (e.g., Redis for speed, DynamoDB for scalability) and justify it. Cover data expiration, caching, and how to scale horizontally while maintaining low latency.

Key Points to Mention

  • Idempotency of API operations to handle retries safely
  • Optimistic concurrency control (e.g., versioning) to prevent lost updates
  • Data model for customizations: how to store and validate them
  • Cart scoping: one cart per user per restaurant, with restaurant ID as part of the key
  • Storage choice: Redis for low-latency, persistent store for durability, or a combination
  • Expiration and cleanup policies for abandoned carts

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

Q2

How would you handle a user editing their cart from multiple devices at the same time? Walk through the tradeoffs between optimistic and pessimistic concurrency control here.

System DesignTechnical Trade-offs
Author's notes

I fumbled the pessimistic side a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, such as consistency needs, latency tolerance, and conflict resolution rules. Then compare optimistic and pessimistic concurrency control, explaining how each would work for a multi-device cart scenario, and recommend a hybrid approach based on the tradeoffs. Conclude with how you would handle conflicts and ensure a good user experience.

Pro tip: Mention that the cart is not a bank ledger—slight inconsistency is often acceptable, and the business may prefer availability over strict consistency. Propose a pragmatic solution like optimistic concurrency with automatic merge and user notification for conflicts, showing you balance technical rigor with product sense.

1. Clarify requirements and constraints

Ask about consistency requirements, latency sensitivity, and whether the cart is shared across devices or per-user. Determine if real-time collaboration is needed or if eventual consistency is acceptable.

2. Explain optimistic concurrency control

Describe how it works: each cart update includes a version number; on write, check if the version matches; if not, reject and retry or merge. Highlight benefits: high concurrency, low latency, no locks. Drawbacks: conflicts require resolution, potential for lost updates if not handled.

3. Explain pessimistic concurrency control

Describe locking: acquire a lock on the cart before editing, release after. Benefits: prevents conflicts, ensures consistency. Drawbacks: locks can cause contention, deadlocks, and poor user experience if a device holds a lock (e.g., user abandons session).

4. Compare tradeoffs in the cart context

Discuss how optimistic is better for high read/write throughput and low latency, but may lead to conflicts when the same user edits from multiple devices. Pessimistic avoids conflicts but can block edits and reduce availability. Consider that cart edits are typically low-frequency and per-user, so conflicts are rare.

5. Recommend a solution and conflict resolution

Propose a hybrid or optimistic approach with automatic merge (e.g., last-write-wins per item, or merge quantities) and user notification for irreconcilable conflicts. Mention using versioning (ETags) and idempotent operations. Emphasize monitoring and metrics to detect conflict rates.

Key Points to Mention

  • Optimistic concurrency uses version numbers or timestamps to detect conflicts at write time.
  • Pessimistic concurrency uses locks to prevent concurrent edits, ensuring serializability.
  • Tradeoffs: optimistic offers higher throughput and lower latency but requires conflict resolution; pessimistic ensures consistency but can cause contention and blocking.
  • Cart operations are typically idempotent and can be merged (e.g., add item, remove item) rather than replacing the entire cart.
  • User experience: avoid blocking edits; instead, merge automatically and notify user of conflicts.
  • Consider using a distributed lock service (e.g., Redis) for pessimistic control, but be aware of failure modes and lock timeouts.

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

Q3

If a menu item goes out of stock or its price changes while the user has it in their cart, how do you reconcile that at checkout?

System DesignTechnical Trade-offs
Author's notes

My first instinct was to validate everything at checkout and surface errors to the user, which they seemed okay with.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, such as consistency vs. availability and user experience. Then propose a reconciliation strategy that validates the cart at checkout, handles discrepancies gracefully, and ensures data integrity. Discuss trade-offs between different approaches and how you would implement them at scale.

Pro tip: Emphasize idempotency and atomicity in the checkout process to prevent double-charging or inconsistent states, and mention how you would use event-driven architecture to propagate price and inventory changes in near real-time.

1. Clarify Requirements and Constraints

Ask about business priorities: is it more important to avoid overselling or to honor the price shown? What is the acceptable latency for updates? This shows you consider product and business context.

2. Design Cart Validation at Checkout

Propose that the cart is re-validated against the latest inventory and pricing at checkout. This can be done by querying the inventory and pricing services or using a cached version with a short TTL.

3. Handle Discrepancies Gracefully

Define the user experience for out-of-stock or price-changed items: notify the user, allow them to remove the item or accept the new price, and possibly offer alternatives. Ensure the system can handle partial checkouts.

4. Ensure Data Consistency and Idempotency

Use transactions or idempotent operations to update inventory and process payment. Implement optimistic locking or versioning to handle concurrent modifications.

5. Discuss Scalability and Trade-offs

Talk about how to scale the solution: using event-driven updates, caching, and eventual consistency. Compare strong vs. eventual consistency and their impact on user experience and system complexity.

Key Points to Mention

  • Event-driven architecture for real-time inventory and price updates
  • Idempotency and atomicity in checkout to prevent double-charging
  • Optimistic locking or versioning to handle concurrent cart modifications
  • User experience considerations: clear communication and options for discrepancies
  • Trade-offs between consistency, availability, and latency (CAP theorem)
  • Caching strategies with TTL to balance freshness and performance

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

Q4

What storage solution would you choose for the cart service, and how would you handle TTL for abandoned carts?

System DesignData Modeling
Author's notes

Went with a document store for flexibility on the customization fields, plus a KV layer for fast session reads.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying functional and non-functional requirements (e.g., cart size, read/write ratio, consistency needs, scale). Then propose a primary storage solution (e.g., a key-value store like Redis or DynamoDB) with justification, and describe a TTL strategy for abandoned carts using a combination of lazy expiration and background cleanup.

Pro tip: Mention that TTL should be based on business rules (e.g., 30 days) and that you'd use a two-tier approach: short TTL for active carts and a longer TTL for abandoned carts, with a scheduled job to archive or delete them. Also highlight the importance of monitoring and metrics to tune TTL.

1. Clarify Requirements

Ask about expected scale (e.g., millions of users), read/write patterns, latency requirements, and consistency needs. Determine if carts are ephemeral or need durability.

2. Choose Storage Solution

Propose a primary store (e.g., Redis for speed, DynamoDB for scalability) and justify based on requirements. Consider a hybrid approach if needed (e.g., Redis for active carts, DynamoDB for persistence).

3. Design Data Model

Define the cart schema (e.g., user ID as key, cart items as value) and access patterns. Ensure efficient updates and reads.

4. Implement TTL Strategy

Use native TTL features (e.g., Redis EXPIRE, DynamoDB TTL) for automatic cleanup. Set TTL based on business rules (e.g., 30 days of inactivity). For active carts, refresh TTL on each update.

5. Handle Edge Cases and Monitoring

Address scenarios like cart recovery, TTL extension, and data archival. Set up monitoring for TTL hits and adjust as needed.

Key Points to Mention

  • Choice of storage: Redis (in-memory, fast) vs. DynamoDB (durable, scalable) vs. Cassandra (write-heavy).
  • TTL implementation: native TTL support, lazy expiration vs. active expiration, and background cleanup jobs.
  • Data consistency: eventual vs. strong consistency, and how to handle concurrent updates.
  • Scalability: sharding, replication, and partitioning strategies.
  • Cost considerations: storage costs, especially for long TTLs, and trade-offs between memory and disk.
  • Monitoring and metrics: tracking cart abandonment rates, TTL expiration rates, and system performance.

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 cart operations to be idempotent so client retries don't cause duplicate mutations?

API & IntegrationsSystem Design
Author's notes

Talked through idempotency keys on the write endpoints.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining idempotency in the context of cart operations and explain how to achieve it using idempotency keys and server-side deduplication. Then, walk through the design of the API endpoints, including request/response formats, storage of idempotency records, and handling of concurrent requests. Finally, discuss trade-offs and edge cases such as key expiration and error handling.

Pro tip: Emphasize that idempotency should be scoped to the client and operation, and that the server must store the idempotency key with the response to return the same result on retries. Also, mention that idempotency keys should have a TTL to avoid unbounded storage growth.

1. Define Idempotency and Scope

Clarify what idempotency means for cart operations (e.g., add item, remove item, update quantity) and that it applies to retries of the same request. Specify that the client generates a unique idempotency key per operation.

2. Design API Contract

Incorporate the idempotency key into the request, either as a header (e.g., Idempotency-Key) or as part of the request body. Define the response format to include the result of the operation and possibly the idempotency key for reference.

3. Server-Side Deduplication

On the server, before processing the request, check if the idempotency key has been seen. If yes, return the stored response; if no, process the request and store the key with the response in a persistent store (e.g., database or Redis) with a TTL.

4. Handle Concurrency and Failures

Use locking or atomic operations to handle concurrent requests with the same key. Ensure that if the initial request fails, the idempotency key is not stored, allowing retries to attempt processing again.

5. Discuss Trade-offs and Edge Cases

Address key expiration, storage overhead, and how to handle partial failures. Consider whether to use a distributed cache for scalability and how to ensure consistency across services.

Key Points to Mention

  • Idempotency keys should be unique per client and operation, often a UUID generated by the client.
  • Store the idempotency key along with the response and a timestamp, with a TTL to manage storage.
  • Use a fast, persistent store like Redis or a database with unique constraints to check and store keys atomically.
  • Handle concurrent requests with the same key using locks or by leveraging database transactions.
  • Return the same response for retries, including status code and body, to ensure consistency.
  • Consider idempotency for all mutating operations (POST, PUT, DELETE) but not for safe methods (GET).

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 how does that integrate with order placement and payment?

System DesignTechnical Trade-offsPricing & Monetization
Author's notes

Scoped this to a pricing service that gets called at checkout rather than storing computed prices in the cart.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, such as scale, consistency needs, and failure handling. Then propose a modular pricing service that computes the final order amount by applying promotions, coupons, taxes, and delivery fees in a defined sequence, and integrate it with order placement and payment through a saga or orchestration pattern to ensure atomicity and idempotency.

Pro tip: Emphasize idempotency and auditability: every pricing calculation should be idempotent and logged with a breakdown, so that order placement and payment can safely retry without double-charging or inconsistent totals.

1. Clarify Requirements and Constraints

Ask about scale, consistency requirements, failure scenarios, and whether pricing rules are static or dynamic. This ensures your design addresses the right trade-offs.

2. Design the Pricing Engine

Propose a modular service that applies promotions, coupons, taxes, and delivery fees in a deterministic order. Discuss how to handle stacking rules, exclusions, and tax calculations based on location.

3. Integrate with Order Placement

Explain how the order service calls the pricing engine to get the final amount, stores the breakdown for audit, and handles failures with retries or compensation.

4. Integrate with Payment

Describe how payment is initiated only after pricing is finalized, using idempotent payment requests and handling asynchronous payment outcomes with webhooks or polling.

5. Ensure Consistency and Reliability

Discuss using a saga pattern or distributed transactions to maintain consistency across pricing, order, and payment services, and how to handle partial failures and rollbacks.

Key Points to Mention

  • Idempotency keys for pricing and payment operations to prevent duplicate charges.
  • Order of operations: apply promotions and coupons before taxes and delivery fees, as taxes may depend on discounted subtotal.
  • Use of a pricing service with a clear API and versioned pricing rules for auditability.
  • Saga pattern or orchestration to coordinate order placement and payment, with compensating actions for failures.
  • Caching of pricing rules and tax rates to improve performance, with invalidation strategies.
  • Event-driven architecture for asynchronous communication between services, ensuring scalability and decoupling.

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

Q7

How would you scale this cart service across multiple regions with low-latency reads?

System DesignTechnical Trade-offs
Author's notes

Kept it high level: regional replicas, read from local, write to primary with async replication.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: read/write patterns, consistency needs, and latency targets. Then propose a multi-region architecture with data replication and caching, discussing trade-offs like consistency vs. availability and cost. Finally, outline how to handle writes and ensure data synchronization across regions.

Pro tip: Emphasize that cart data is often eventually consistent and can be partitioned by user ID, enabling local reads and writes with asynchronous replication. This shows you understand the domain and can make pragmatic trade-offs.

1. Clarify Requirements

Ask about read/write ratio, latency SLAs, consistency requirements, and scale (QPS, data size). This ensures your design meets actual needs.

2. High-Level Architecture

Propose a multi-region deployment with regional caches and databases, using a global data store or replication. Consider active-active vs. active-passive.

3. Data Partitioning and Replication

Partition cart data by user ID to keep related data together. Use asynchronous replication across regions to minimize write latency, accepting eventual consistency.

4. Read Latency Optimization

Implement regional read replicas and caching (e.g., Redis) to serve reads locally. Use CDN for static assets if applicable.

5. Trade-offs and Failure Handling

Discuss consistency vs. latency, conflict resolution (e.g., last-write-wins), and failover strategies. Mention monitoring and alerting.

Key Points to Mention

  • Eventual consistency and conflict resolution strategies (e.g., CRDTs, last-write-wins)
  • Data partitioning by user ID to enable local reads/writes
  • Regional caching with Redis or Memcached to reduce database load
  • Asynchronous cross-region replication (e.g., using Kafka or database replication)
  • Read replicas in each region for low-latency reads
  • Trade-offs: latency vs. consistency, cost, and complexity

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