Multiple ChoiceHard 45s
Deep inheritance hierarchies
A four-level inheritance hierarchy forces subclasses to override methods they do not need and to know about unrelated parent behavior. What is the best refactor direction?
Options
- 1Add more intermediate base classes to share behavior
- 2Push all behavior into the root class so nothing is overridden
- 3Make every method abstract so subclasses must implement everything
- 4Replace the hierarchy with composition and small focused interfaces used where needed
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.