PrepZone Logo
PrepZone

SOLID as Diagnostic Questions

Five questions to ask about every class — with interview framing, not textbook definitions.

Why this matters

  • SRP smell — detailed pointwise breakdown in the section below.
  • OCP smell — detailed pointwise breakdown in the section below.
  • LSP smell — detailed pointwise breakdown in the section below.
  • ISP smell — detailed pointwise breakdown in the section below.
  • SOLID is scored as refactor skill, not acronym recall.
Single responsibilityOne reason to change
Open / closedExtend, do not edit
Liskov substitutionSubtype keeps the promise
Interface segregationSmall, focused contracts
Dependency inversionDepend on abstractions
ResultSwappable, testable units
Read them as questions about a single class: does it have one job, can I extend it without editing it, and does it depend on contracts rather than concrete types?

Overview

Five questions to ask about every class — with interview framing, not textbook definitions. Study each section below in order — every list is interview-ready reference material.

SRP smell

Points to cover

  • Definition — what SRP smell means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design

OCP smell

Points to cover

  • Definition — what OCP smell means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design

LSP smell

Points to cover

  • Definition — what LSP smell means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design

ISP smell

Points to cover

  • Definition — what ISP smell means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design

DIP smell

Points to cover

  • Definition — what DIP smell means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design
Java
// CampusOS — apply "SRP smell" on paper first, then in code
public final class SolidInterviewLensExample {
    // 1. Name entities from the problem statement
    // 2. Draw relationships before writing methods
    // 3. Introduce patterns only when a force appears
}

Quick recall

Everything you need if you only revisit this box.

  1. SRP smell — review this slice before mock interviews.
  2. OCP smell — review this slice before mock interviews.
  3. LSP smell — review this slice before mock interviews.
  4. ISP smell — review this slice before mock interviews.
  5. DIP smell — review this slice before mock interviews.

Test yourself

Answer these before moving on — recall is what makes it stick.