Other Parts of This Series:


Object Oriented Design (Photo Credit: Coding Ninjas)

Object Oriented Design (Photo Credit: Coding Ninjas)

What is OOD (Object-Oriented Design)?

Object-Oriented Design (OOD) is the process of designing a system by breaking it down into objects (classes) that interact with each other to solve a problem.

In Simple Terms, OOD is the modeling of real-world problems using objects, behaviors, and relationships.

Key Components of OOD

  1. Objects: Represent real-world entities like: User, Car, Order
  2. Classes: Blueprint of objects
  3. Encapsulation: Hide internal data, expose behavior
  4. Relationships: How objects interact? Means is it “has-a” (composition) or “is-a” (inheritance)

Goal of OOD

  • Manage complexity
  • Improve maintainability
  • Make system extensible

How Are OOD Interviews Different From Other Interviews?

AspectCoding InterviewOOD Interview
GoalSolve problemDesign system
FocusLogicStructure
OutputCodeClasses + relationships
EvaluationCorrectnessDesign quality
TimeFast solutionThoughtful design

What Interviewers Look For in OOD?

  • Clear thinking
  • Proper abstraction
  • Clean class design
  • Use of principles (Like: SOLID)
  • Communication
  • Extensibility
  • Balance of Cohesion & Coupling

Difference Between OOD and System Design

AspectOODSystem Design
LevelLow-levelHigh-level
FocusClassesServices
ScaleSingle systemDistributed
ConcernCode structureScalability & reliability

How To Prepare For An OOD Interview?

  • Step 1: Master OOP Fundamentals
  • Step 2: Learn OOP Principles
  • Step 3: Learn Key Design Patterns
  • Step 4: Practice Core OOD Problems
  • Step 5: Add Advanced Thinking
  • Step 6: Practice Communication
  • Step 7: Do Mock Interviews
  • Step 8: Build Real Projects (Best ROI)

Let’s discuss each step in brief.


Step 1: Master OOP Fundamentals

You must be very comfortable with:

  • Encapsulation: Hide internal state and expose only necessary behavior
  • Abstraction: Focus on what, not how
  • Inheritance: “is-a” relationship
  • Polymorphism: Same interface, different behavior

I had some detailed articles on OOP fundamentals. Please read if you are really interested.


Step 2: Learn OOP Principles

Design principles provide high-level guidelines to design better software applications. They do not provide implementation guidelines and are not bound to any programming language. SOLID is a well known design principle term.

I had a detailed article on OOP design principles. Please read if you are really interested.


Step 3: Learn Key Design Patterns

Design patterns provide low-level solutions related to the implementation of commonly occurring object-oriented problems.

I had a detailed article series on OOP design patterns. Please read if you are really interested.


Step 4: Practice Core OOD Problems

Start with:

  • Parking Lot
  • Elevator System
  • Library Management
  • Ride Sharing (Uber)
  • ATM System
  • Notification System
  • Movie System
  • Vending Machine
  • Restaurant Management System

Step 5: Add Advanced Thinking

Once basic design is clear:

  • Concurrency
  • Scalability
  • Fault Tolerance & Recovery
  • Persistence

Step 6: Practice Communication

This is critical. Always structure your answer:

  • Clarify requirements
  • Define use cases
  • Identify classes
  • Add relationships
  • Apply patterns
  • Discuss edge cases

I had some detailed articles on presenting and soft skills. Please read if you are really interested.


Step 7: Do Mock Interviews

  • Speak out loud
  • Time yourself (30–45 mins)
  • Explain decisions

Step 8: Build Real Projects (Best ROI)

Learn by doing is the best learning approach. So, practice by build real-world project.


Common Mistakes to Avoid

  • Assuming requirements & not asking clarification questions
  • Jumping into coding too early
  • Overengineering
  • Ignoring edge cases
  • Not explaining decisions
  • Using patterns blindly
  • Ignoring advance cases like: concurrency, scalability
  • Not discussing future improvement scopes of the solution

OOD Interview Framework

Having a clear framework for the OOD interview is more important than many realize. Without structure, the interview can feel disorganized and difficult for you and the interviewer to follow.


1. Understand & Clarify the Problem (Very First Step)

Goal: Avoid wrong assumptions.

Ask questions like:

  • What are the core features?
  • Who are the users/actors?
  • What are the inputs/outputs?
  • Any constraints

Example:

“Are we designing a parking lot for a single building or multiple locations?”

Tips:

  • Never jump into coding/design immediately.
  • Repeat the problem in your own words.
  • Identify functional vs non-functional requirements.

2. Identify Use Cases (Behavior First)

Think in terms of what the system does (verb), not classes (noun) yet.

Example (Parking Lot):

  • Vehicle enters
  • Vehicle exits
  • Assign parking spot
  • Calculate fee

Tips:

  • Start with happy path, then edge cases.
  • Mention at least 1–2 edge cases:
  • Full parking
  • Invalid ticket

3. Identify Core Entities/Objects (Nouns → Classes)

Extract nouns from the problem.

Example:

  • ParkingLot
  • Vehicle
  • ParkingSpot
  • Ticket

Tips:

  • Don’t over-design early.
  • Keep it minimal and extendable.

4. Define Relationships (Linking)

Think in terms of:

  • Association
  • Composition
  • Inheritance

Example:

  • ParkingLot has many ParkingSpots (Composition)
  • Vehicle → Car, Bike (Inheritance)

✅ Tips:

  • Prefer composition over inheritance unless there’s a strong “is-a” relationship.
  • Avoid deep inheritance chains.

5. Define Class Responsibilities (SRP)

Each class should have one clear responsibility.

Example:

  • ParkingLot → manages spots
  • Ticket → stores entry/exit info
  • FeeCalculator → calculates cost

Tips:

  • Follow Single Responsibility Principle (SRP).
  • If a class is doing too much → split it.

6. Define Key Methods & Interfaces

Now define behavior.

Example:

1
2
3
4
class ParkingLot {
    ParkingSpot assignSpot(Vehicle v);
    void releaseSpot(Ticket t);
}

Tips:

  • Keep methods high-level first, refine later.
  • Use interfaces for flexibility.

7. Apply Design Patterns (Only When Needed)

Use patterns only when justified.

Common OOD Patterns:

  • Factory Pattern → Object creation
  • Strategy Pattern → Replace conditional logic
  • Singleton → Shared resource (e.g., ParkingLot instance)
  • Observer → Event-driven systems

Example:

  • Fee calculation → Strategy Pattern

Tips:

  • Don’t force patterns.

Say:

“We can use Strategy Pattern here to make fee calculation extensible.”


8. Handle Edge Cases & Constraints (Deep-dive)

Think deeper:

  • What if system scales?
  • What if concurrency happens?

Example:

  • Two cars trying to take the same spot → need locking

Tips:

  • Mention thread safety
  • Mention data consistency
  • Mention failures

9. Persistence (Optional but Strong Signal)

Mention how data is stored:

  • In-memory vs DB
  • Caching

Example:

  • Store tickets in DB
  • Cache available spots

Tips:

  • Keep it simple (simple language data type like map) unless interviewer pushes deeper.

10. Write Clean Code (If Asked)

Focus on:

  • Readability
  • Modularity

Example:

1
2
3
interface FeeStrategy {
    double calculateFee(Ticket t);
}

11. Walk Through Example

Simulate:

“Car enters → spot assigned → ticket created → exit → fee calculated”

Tips:

  • This shows practical correctness.

12. Discuss Trade-offs

This is what senior engineers do.

Example:

  • Why composition over inheritance?
  • Why Strategy pattern?

Conclusion

OOD interviews are not about perfection, they are about how you think, structure, and evolve a design.

So follow the 4 step rules: Learn → Practice → Explain → Improve.

Further Readings

  • Book: Object-Oriented Design Interview by Alex Xu (ByteByteGo)