PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/Uber

Design cart and pricing engine classes

Last updated: May 4, 2026

Quick Overview

This question evaluates object-oriented system design and domain modeling skills related to cart operations, item customizations, composable pricing rules (surge, promotions, membership) and producing an itemized receipt.

  • medium
  • Uber
  • System Design
  • Software Engineer

Design cart and pricing engine classes

Company: Uber

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

Design the core classes and interfaces for a cart & pricing engine for a food delivery marketplace (e.g., Uber Eats). The final checkout price is not simply the sum of menu items. It is dynamically computed based on: - **Item customizations**: add/remove ingredients, size upgrades, dietary substitutions. Each customization may add $0 or an extra cost. - **Marketplace dynamics**: e.g., **surge pricing** as a multiplier applied to a subtotal (e.g., 1.2×). - **Promotions**: coupon codes such as **$5 off**, **10% off**, **Buy 1 Get 1 Free (BOGO)**, and possibly tiered delivery fees. - **Membership benefits**: e.g., subscribers get **0 delivery fee** and **5% off eligible items**. Requirements: 1. **Cart operations**: add/remove items and quantities; apply item-level customizations. 2. **Flexible pricing strategies**: support multiple independent pricing rules (surge, membership discount, coupons, BOGO, delivery fee rules). Rules should be composable and easy to extend. 3. **Receipt breakdown**: return an itemized checkout receipt showing at least: base price, add-ons, fees, discounts, and final total. Provide an object-oriented design: key classes, interfaces, and how they collaborate. Clarify how pricing rules are ordered/combined and how the receipt is produced.

Quick Answer: This question evaluates object-oriented system design and domain modeling skills related to cart operations, item customizations, composable pricing rules (surge, promotions, membership) and producing an itemized receipt.

Related Interview Questions

  • Design an Uber Eats Cart Service - Uber (medium)
  • Design A URL Shortener - Uber (medium)
  • Design Restaurant Search and Monitoring - Uber (hard)
  • Design Nearby Restaurant Search - Uber
  • Design a Food Delivery Cart - Uber (medium)
Uber logo
Uber
Jan 11, 2026, 12:00 AM
Software Engineer
Onsite
System Design
21
0

Design the core classes and interfaces for a cart & pricing engine for a food delivery marketplace (e.g., Uber Eats).

The final checkout price is not simply the sum of menu items. It is dynamically computed based on:

  • Item customizations : add/remove ingredients, size upgrades, dietary substitutions. Each customization may add $0 or an extra cost.
  • Marketplace dynamics : e.g., surge pricing as a multiplier applied to a subtotal (e.g., 1.2×).
  • Promotions : coupon codes such as $5 off , 10% off , Buy 1 Get 1 Free (BOGO) , and possibly tiered delivery fees.
  • Membership benefits : e.g., subscribers get 0 delivery fee and 5% off eligible items .

Requirements:

  1. Cart operations : add/remove items and quantities; apply item-level customizations.
  2. Flexible pricing strategies : support multiple independent pricing rules (surge, membership discount, coupons, BOGO, delivery fee rules). Rules should be composable and easy to extend.
  3. Receipt breakdown : return an itemized checkout receipt showing at least: base price, add-ons, fees, discounts, and final total.

Provide an object-oriented design: key classes, interfaces, and how they collaborate. Clarify how pricing rules are ordered/combined and how the receipt is produced.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Uber•More Software Engineer•Uber Software Engineer•Uber 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.