easy

Design a Coffee Machine

Design a coffee machine that can prepare different beverages (espresso, latte, cappuccino). Include ingredient management, recipe handling, and beverage customization.

Suggested time: 45 minutes

Loading the workspace...

About this problem

A coffee machine sounds simple: press a button, get coffee. But underneath, the system must manage a recipe-driven brewing process, track multiple ingredient levels simultaneously, support drink customizations that adjust ingredient quantities, handle concurrent orders from multiple users, and ensure that ingredient availability checks and deductions happen atomically so the machine never oversells ingredients it does not have. The design challenge is building a flexible recipe system where adding a new drink requires zero code changes.

What your design needs to cover

  • Brew Beverages from Recipes

  • Track and Deduct Ingredients

  • Customize Beverages

  • Refill and Status Display

Key challenges the editorial covers

Learn from other designs

Related problems

Guides