Interview Questions - OOP
Disclaimer
These are my revision notes for my job interviews. As a contractor, I have job interviews more often than a permanent employee. Writing down the revision notes does not imply that I am incapable of answering these questions naturally. During interviews, I naturally get nervous, and due to my introversion, I often struggle to clearly articulate what I already know and understand. I simply want to avoid those situations and prepare myself to present myself in the best possible way.
What is polymorphism
- An object can behave differently in different contexts
- Compile-Time Polymorphism: method overloading. multiple methods with the same name but different parameters
- Run-Time Polymorphism: method overriding. or different objects that implement the same interface
- Structure code to be more flexible and easier maintain