Interview practice question
Deep inheritance hierarchy is hard to change
Backend Engineering · OOP and Design Patterns · Beginner
Your codebase has a five-level class hierarchy for notification types, and changing the base class breaks things everywhere. What would you do?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Fragile base class problem.
- Flatten using composition.
- Interfaces for capabilities.
- Extract shared behaviour into collaborators.
- Refactor incrementally with tests.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.