CSE Roadmap

Core tier · about 4 hours · 6 parts

Part 1 of 6 · 1 min read

Why this page comes eighth in Level 7

In this module you will

  • Turn a food-delivery question into requirements for menus, carts, orders and totals.
  • Separate the cart (a draft) from the order (a record that is fixed once placed).
  • Take stock for the whole order in one atomic step, and put it back on cancel.
  • Model the order life cycle as a state machine and tell interested parties about each change.
  • Price an order with a discount rule and a delivery fee, all in whole cents.

A food-ordering question is a tour of the whole toolbox: values and entities, a draft that becomes a record, an all-or-nothing stock step, a state machine, and listeners. It repeats ideas from Level 4 (strategy, observer, state) and Level 5 (immutability, atomic steps) in a setting every interviewer knows. No book was supplied for this track, so the content is common practice, not from the books. The Java code was compiled and run before it was written here. Numbers marked "made up" only show the idea.