Overload == Polymorphism?
Just went through another interview process today (I am averaging 3-4 a day for past few weeks!).
After conducting so many interviews, especially past 6 months, I have kinda developed an interview model which works for me:
- Ask about the project they have worked in the past year (Kinda Ice breaker).
- Ask about the architecture of the application or what they found to be most interesting in that project.
- Move on to the platform specific questions, where the questions are more on the framework then any thing else.
- Maybe even drill down to certain important API’s.
- Give some problem for solving on an implementation level.
- A generic scenario from which a class diagram needs to be generated. I like this one as it tells me if the candidate has an innate knowledge of design or not. You will be surprised by how people think of a hierarchy. Seems to be a simple “as-is” relationship, but reasons for justifying a base class! Even what base classes people can come up with (Whew).
Anyways, everytime what gets my goat is when we discuss Polymorphic behavour, especially in C++ or C# or Java, I hear about overloading being polymorphic. I still haven’t figured our how this term has come into being: static polymorphism?
In math we define Morphism as something which can retain the same structure but the underlying mathematical structure (functions for e.g.) can change. This basically means in our modern OOPS language polymorphism is alwyas be the usage of virtual functions (overriding).
Well, unfortunately all the new texts in India use this term liberally with overloading
go figure.
Refrencing Links:
http://en.wikipedia.org/wiki/Morphism
http://en.wikipedia.org/wiki/Polymorphism