MathWorks interview question

oops concepts