Tata Group interview question

oops concepts