← Uber Interview Insights

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

SeniorPrefer not to say
Apr 2026

Summary

Uber system design round, one big question about a cart and pricing engine. The scope was broader than I expected and I kept second-guessing which design patterns to lean on.

Questions Asked (1)

Q1

Design the core classes and interfaces for a cart and pricing engine similar to Uber Eats. The system needs to support item customizations, composable pricing strategies like surge pricing, membership discounts, and coupons, and a receipt-style breakdown that shows each pricing layer applied before the final total.

System DesignTechnical Trade-offsData Modeling
Author's notes

I started with the cart and item models which felt safe, but then the pricing piece got messy fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scope, then model the core domain objects (Cart, CartItem, Customization) and define a PricingEngine that applies a pipeline of composable pricing strategies. Emphasize extensibility, immutability, and a receipt that captures each pricing layer's effect for transparency and debugging.

Pro tip: Discuss how you'd handle pricing strategy ordering and conflicts (e.g., coupon vs. membership discount) and propose a deterministic resolution mechanism, such as priority or explicit sequencing, to avoid ambiguity in production.

1. Clarify Requirements and Scope

Ask questions to understand constraints: expected scale, types of customizations, pricing rules, and whether pricing is computed client-side or server-side. Confirm the need for auditability and real-time updates.

2. Define Core Domain Model

Identify key entities: Cart, CartItem, CustomizationGroup, CustomizationOption, and PriceBreakdown. Specify relationships and invariants, such as a cart containing multiple items, each with selected customizations.

3. Design Pricing Engine and Strategies

Define a PricingStrategy interface with a method to apply pricing to a cart and return a modified breakdown. Implement concrete strategies for base price, surge, membership discount, and coupons. Use a pipeline or chain of responsibility to compose them.

4. Model Receipt and Breakdown

Create a PriceBreakdown class that records each applied strategy, the amount changed, and the running total. Ensure it supports serialization for display and logging.

5. Address Extensibility and Trade-offs

Discuss how to add new strategies without modifying existing code (Open/Closed Principle). Consider performance implications of strategy ordering, caching, and concurrency. Mention alternative designs like rule engines or DSLs.

Key Points to Mention

  • Composability via Strategy pattern and pipeline execution
  • Immutability of cart and pricing breakdown for thread safety and auditability
  • Ordering and conflict resolution of pricing strategies (e.g., priority, explicit sequence)
  • Receipt as a first-class object capturing each layer's impact
  • Extensibility: adding new strategies without changing core engine
  • Trade-offs: performance vs. flexibility, client vs. server pricing, and testing strategies

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