All problems
Foundational·⚙️ Infrastructure·Google · Microsoft · Infosys +1

Design
Coffee Vending Machine

Design a coffee vending machine that accepts coin denominations, lets customers select a beverage, deducts ingredients, dispenses the drink, and returns change. Admins can restock ingredients and collect cash.

#OOP#State Machine#Design Patterns
Start Solving 8F + 3NF requirements inside

01 -  Why interviewers ask this

Coffee/Vending Machine is a classic OOP interview question that tests your ability to model real-world state transitions, enforce business rules (insufficient funds, out-of-stock), and apply design patterns like State and Command in a hardware-software boundary context.

02 -  Where this system exists in the real world

You interact with this design every day.

Embedded systems in office pantries, airports, and hospitals

Foundation for understanding State Machine design in hardware controllers

Blueprint for POS (point-of-sale) systems with inventory management

Demonstrates concurrent resource management in physical device software

03 -  What you'll master

Solve this once. Know it forever.

01

Design a finite state machine with valid transitions and guards

02

Apply the State pattern to eliminate complex conditional logic

03

Handle inventory deduction atomically to prevent partial dispense

04

Separate admin operations from customer-facing flows using modes

04 -  What you'll design

8 functional · 3 non-functional requirements.

Accept multiple coin denominations (₹1, ₹2, ₹5, ₹10)

7 more requirements inside

Sign in to unlock the full brief and start designing

Unlock Requirements

05 -  Companies that ask this

You may face this exact question in your next interview.

G
Google
M
Microsoft
I
Infosys
T
TCS

Ready?

Open the canvas.
Design it yourself.

See all requirements, use staged hints, run your code, and compare with community discussions - all on the same canvas.

Start Solving