Q2Should you prefer composition or inheritance?
Inheritance creates tight coupling (IS-A, fragile base class, single only). Composition creates loose coupling (HAS-A, swappable, multiple). Prefer composition. Use inheritance only for true IS-A relationships with shared state.