Design an Extensible Cinema Ticket Pricing Engine
AmazonSoftware Engineer · Technical ScreenLast updated
Design an extensible cinema pricing engine with validated money and multiplier types, composable policies, explicit calculation and rounding, compatibility checks, versioned configuration, itemized quotes, and boundary tests.
Interview Prompt
Design a ticket-pricing engine where a movie format supplies a base price,
showtime and seat tier each supply a multiplier, and zero or more add-ons supply
fixed prices. The final price is (base price + add-on total) * showtime multiplier * seat-tier multiplier. Explain a type-safe, testable design that can
add new formats, showtimes, tiers, or services without editing a large conditional.
Constraints & Assumptions
- Represent money with integer minor units or decimal arithmetic, never binary floating point.
- Multiplier and rounding policy must be explicit and consistent.
- Unknown or incompatible options are rejected rather than silently defaulted.
- Pricing configuration is versioned so a quote can later be audited.
Clarifying Questions to Ask
- At which step is rounding applied?
- Can an add-on be restricted by format, showtime, or seat tier?
- Must previously issued quotes remain reproducible after configuration changes?
Follow-up questions
- How would coupons and taxes fit without changing every price component?
- How do you prevent a new add-on from being sold with an incompatible seat?
- What should an idempotent quote API return when pricing configuration changes mid-request?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.