Phase 1: Requirements & Use Cases
Interviewer: "Design the Amazon Locker system."
Candidate: "Sure. The Amazon Locker service lets customers have packages delivered to a secure self-service locker kiosk instead of their home address. A delivery agent deposits the package, the customer receives a code, and they retrieve it within a time window. Does that capture the core scenario?"
Interviewer: "Yes. What clarifying questions do you have?"
Candidate: "A few: Are there multiple locker sites (different locations), or is this a single site? I'll design for multiple sites. Do lockers come in different sizes? Yes — I'll use Small, Medium, Large as the standard tiers. What's the package retention period? Based on real Amazon Locker policy, packages expire after 3 days, triggering an automatic return. And is the code a one-time-use OTP or a persistent PIN? I'll model it as a one-time-use code cleared when the door closes."
Interviewer: "What happens if no locker is available at the customer's preferred site?"
Candidate: "The delivery fails gracefully — the system returns 'no available locker' and the order falls back to home delivery. I'd make that a clear failure case rather than silently queuing the delivery."
WHY: Transparent failure on locker unavailability prevents silent delivery loops. The ordering system needs an explicit signal to trigger the fallback path.
Interviewer: "What actors are in this system?"
Candidate: "Three: a Customer (selects locker site at order time, picks up package), a Delivery Agent (deposits package and scans it into a locker), and a System/Admin (manages locker…
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