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.
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:
Requirements:
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.