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
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
// 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.
- SRP smell — review this slice before mock interviews.
- OCP smell — review this slice before mock interviews.
- LSP smell — review this slice before mock interviews.
- ISP smell — review this slice before mock interviews.
- DIP smell — review this slice before mock interviews.
Test yourself
Answer these before moving on — recall is what makes it stick.