Tier 1 · Foundations

Core Concepts

OOP Pillars

SOLID Principles

Creational Patterns

Structural Patterns

Behavioral Patterns

Tier 2

Tier 3

Tier 4

Tier 5

Phase 1: Requirements & Use Cases

Interviewer: "Design a vending machine. Walk me through your approach."

Candidate: "Sure. Let me restate the problem to confirm scope. A vending machine is a self-service device that holds inventory of products, accepts payment from a customer, dispenses the selected product, and returns change if the customer overpaid. I'm designing the software model for this machine — not its hardware or a networked inventory system. Does that match your intent?"

Interviewer: "Yes. What actors are involved?"

Candidate: "There are two actors: the Customer who interacts with the machine to buy products, and an Admin or technician who restocks the machine and adjusts pricing. The machine itself is the primary system.

The core use cases I want to cover are:

  1. Customer selects a product
  2. Customer inserts money (coins/bills)
  3. Machine dispenses product and returns change
  4. Customer cancels and gets a refund
  5. Machine rejects selection when out of stock or insufficient funds
  6. Admin restocks inventory and updates prices"

Interviewer: "What about networked restocking alerts or mobile payment?"

Candidate: "I'd scope those out. Mobile payment introduces an external payment gateway — that's a systems integration concern, not an OOD problem. Restocking alerts are an infrastructure/notification feature. I'll model restocking as a direct admin action on the machine."

WHY: Keeping the scope tight lets us explore the core behavioral complexity — state transitions — which is what the interviewer is testing here.

Interviewer: "What assumptions are you making?"

Candidate: "I'm assuming: (1) single machine, not a…

In the full tutorial

  • Phase 2: Object Modeling
  • Phase 3: Class Design & Relationships
  • Phase 4: Design Patterns Application
  • Phase 5: Key Implementation
  • Phase 6: Extensibility & Trade-offs

Glossary history

Click dotted jargon to save explanations here.