Why this matters
- Entity — detailed pointwise breakdown in the section below.
- DTO — detailed pointwise breakdown in the section below.
- Mapping — detailed pointwise breakdown in the section below.
- Leak prevention — detailed pointwise breakdown in the section below.
- Production Java structure interviewers expect in backend LLD.
Dependency direction
Controller / FacadeHTTP or API entry
Serviceuse cases, orchestration
Domainentities, rules, invariants
Repositorypersistence port
Overview
Keep transport shapes separate from domain models. Study each section below in order — every list is interview-ready reference material.
Entity
Points to cover
- Definition — what Entity 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
DTO
Points to cover
- Definition — what DTO 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
Mapping
Points to cover
- Definition — what Mapping 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
Leak prevention
Points to cover
- Definition — what Leak prevention 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 "Entity" on paper first, then in code
public final class DtoEntitySeparationExample {
// 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.
- Entity — review this slice before mock interviews.
- DTO — review this slice before mock interviews.
- Mapping — review this slice before mock interviews.
- Leak prevention — review this slice before mock interviews.
Test yourself
Answer these before moving on — recall is what makes it stick.