All challenges
Multiple ChoiceBeginner 45s

Composition over inheritance

Which is the main reason to prefer composition over deep inheritance hierarchies?
Options
  1. 1Inheritance is simply not supported in most of the modern programming languages used today
  2. 2Composition always consumes noticeably less runtime memory than inheritance does in practice
  3. 3Deep inheritance hierarchies cannot be meaningfully unit tested in any practical real-world way
  4. 4Composition avoids fragile base-class coupling and allows behavior changes at runtime

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.

Play this in a 3-minute battle