one of the question asked today in interview was how does Inheritance differ from
using decorator pattern?
I said inheritance is adding behaviour during compile time v/s decorator adds behaviour to object at runtime. The interviewer wasnt satisfied. she was hinting more towards what is the drawback of inheritance which makes decorator pattern better? or are they very similar or same?