Tier: 4 — Hard Domain: E-Commerce / Retail Key Patterns: Strategy, Observer, Factory
Phase 1: Requirements & Use Cases
Interviewer: "Design an online shopping system."
Candidate: "Let me make sure I understand the scope before modeling anything. We're talking about a class-level OOD for a system where customers browse a product catalog, manage a shopping cart, place orders, and pay for them. Think of something in the spirit of Amazon or a mid-sized e-commerce platform — not the infrastructure behind it, just the object model. Does that match your intent?"
Interviewer: "Yes. Walk me through the actors first."
Candidate: "I see four distinct actors:
- Customer — browses the catalog, manages their cart, places and tracks orders
- Guest — can browse and add to cart, but must register before checkout
- Admin — manages product listings, inventory, and categories
- System — processes payments, sends notifications, updates order status
For core use cases, I want to cover six:
- Browse & search catalog — filter by category, keyword, price range
- Manage shopping cart — add, update quantity, remove items
- Checkout — validate cart, apply discounts, confirm shipping address
- Process payment — support multiple payment methods (credit card, PayPal, wallet)
- Manage orders — place, track status, cancel, request return
- Manage inventory — admin adds products, updates stock levels"
Interviewer: "What about product reviews, wishlists, and recommendation engines?"
Candidate: "I'll scope those out. Reviews and wishlists are additive features that don't affect the core transactional model — they'd be separate bounded contexts with their own entities. Recommendation engines require data science infrastructure…
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