Quote:
She asked me if I invoke the overridden function of the derived class which is cast into its base class type, the base's or the derived's gets run. I said the derived's. She said good, then asked what if this is in C++. I said it'd be the same and she said NO, C++ works in the opposite way. I hereby seek enlightenment from you guys.
The interviewer is correct. What she was asking about is type slicing, where an object of a derived class is cast to an object of its base class. Polymorphism in C++ works via pointers and references, so if she presented a case where a pointer to a derived class is cast to a pointer to the base class, then your answer would be correct.