Deloitte interview question

Inheritance vs Composition