# Crack OOD Interviews: A Teacher’s Checklist You Must Follow

# Crack OOD Interviews: A Teacher’s Checklist You Must Follow

<img src="https://bugfree-s3.s3.amazonaws.com/mermaid_diagrams/image_1767138037015.png" alt="Object Oriented Design cover" style="max-width:700px; width:100%; height:auto; border-radius:8px;" />

Object-oriented design (OOD) interviews reward structure and explanation more than improvisation. Follow this teacher-approved checklist to design confidently, pick the right patterns, and clearly communicate trade-offs.

## The 4 OOP pillars — your foundation
- Encapsulation: hide internal state; expose behavior through clear interfaces.
- Abstraction: model concepts at the right level; remove unnecessary detail.
- Inheritance: share and reuse behavior when there’s a true “is-a” relationship.
- Polymorphism: program to interfaces so you can swap implementations easily.

Always name which pillar you’re applying and why while designing.

## Core patterns cheat sheet (what and when)
- Singleton — Global manager or shared resource (e.g., a single configuration or registry). Use sparingly; watch for testability and concurrency issues.
- Factory — Create objects when construction is complex or when you want to decouple creation from use (e.g., ProductFactory for different product types).
- Observer — Event/notification systems (e.g., inventory change notifications, due-date alerts). Good for decoupling publishers from subscribers.
- Strategy — Encapsulate interchangeable algorithms (e.g., pricing strategies, search strategies). Useful for runtime behavior changes.

Mention alternatives and trade-offs (e.g., dependency injection vs. Singleton for global access).

## Step-by-step interview checklist
1. Clarify requirements (2–4 minutes)
   - Ask: core functionality, edge cases, scale, performance, persistence, concurrency, and what to ignore.
   - Confirm constraints and success criteria.
2. Identify domain entities and relationships
   - Listen for nouns -> classes/objects. Sketch entities and associations (1–2 minutes).
3. Define responsibilities (classes & methods)
   - For each class, state its responsibility and main public methods.
4. Pick data structures & interfaces
   - Explain choices: lists, maps, sets, queues, indexes. Mention complexity (O-notation) where relevant.
5. Apply patterns where they fit
   - Name the pattern, justify why, and show the places it will be used.
6. Consider non-functional requirements
   - Scalability, availability, persistence, caching, consistency, and concurrency.
7. Walk through common scenarios
   - Show how core flows work: success, failure, and edge cases.
8. Review trade-offs and extension points
   - Explain alternatives, bottlenecks, and how the design can evolve.

Narrate each step. Your design is only as strong as your explanation.

## Quick example approaches
- Library system
  - Key classes: Book, User, Catalog, Loan, Reservation, NotificationService
  - Patterns: Singleton for Catalog/Index; Observer for due-date notifications; Factory for Book/Loan creation; Strategy for search algorithms.
  - Concerns: concurrent checkouts, reservation queues, indexing for search speed.

- Parking lot
  - Key classes: Vehicle, ParkingSpot, ParkingLot, Entrance, Ticket, PaymentProcessor
  - Patterns: Factory for Vehicle/Spot allocation; Strategy for pricing policies; Observer for spot sensors/availability updates.
  - Concerns: real-time availability, capacity limits, reservation vs. first-come.

- Shopping cart
  - Key classes: Cart, Item, ProductCatalog, InventoryService, Order, PaymentProcessor
  - Patterns: Strategy for payment methods; Observer for inventory alerts; Factory for Order creation.
  - Concerns: cart expiration, concurrency on inventory updates, eventual consistency for orders.

## How to narrate your decisions (short script)
- "First, I’ll clarify requirements: X users, Y ops/sec, and persistence in Z."
- "Next, the main entities are A, B, and C — their responsibilities are..."
- "I’ll use Pattern P here because... Alternatives include ..., but I prefer P for these reasons..."
- "This approach gives O(...) complexity for the main operations. Trade-offs: ..."

## Final checklist to practice aloud
- Clarify requirements → Identify entities → Assign responsibilities → Pick patterns & data structures → Walk through flows → Explain trade-offs.

Practice with 5–10 prompts (library, parking lot, cart, chatroom, rate limiter). Time yourself, speak your rationale out loud, and iterate on brevity and clarity. With this checklist, you’ll present structured designs and convincing explanations — the combination interviewers reward.

