Restaurant Menu Cart Pricing
Problem statement
Build a marketplace-style restaurant menu and cart. Users should filter restaurants, add available menu items, change quantities, and see pricing update immediately.
The cart must derive subtotal, tax, service fee, and final total from item quantities. Out-of-stock items should be visible but disabled so the user understands why they cannot add them.
This is a practical state-modeling exercise: the cart should store item ids and quantities, while display rows and totals are derived from source menu data.
Requirements & constraints
- Search restaurants and menu items by text.
- Filter restaurants by cuisine.
- Disable adding out-of-stock menu items.
- Add items to cart and change quantities.
- Remove items when quantity reaches zero.
- Derive subtotal, tax, service fee, and total from cart state.
How to approach Restaurant Menu Cart Pricing
The strategy an interviewer expects you to reach for.
How to Think About This Problem This is a state-modeling problem from marketplace apps. The menu is source data. The cart is user intent. Pricing is derived. Keeping those three separate makes the app predictable. A junior implementation often copies the entire menu item into the cart and stores subtotal in state. That works briefly, but it becomes fragile when price, availability, or fee rules change.
The full solution is part of HelloFrontend Pro
The question above is free to read in full. Upgrade to unlock the interactive workspace and the senior-level walkthrough that go with it.
- Live React sandbox pre-wired for this component
- Time-boxed checkpoints that mirror a real 45-minute round
- Interviewer scoring criteria and a full reference implementation
Already a member? Log in to open the workspace.