OOP Pillars
OOP DesignTechnical InterviewCS FundamentalsEasyLast asked 1 year ago
Incorta interview question (Egypt) · stage: Technical Interview · domain: OOP Design and CS Fundamentals · role: Software Engineer and Intern · difficulty: Easy · asked once, last in July 2025
What they ask
The second half of the intern technical call is a conversation, not code: "explain the four pillars of object-oriented programming, with an example for each in the language you used in the assessment."
Expect the interviewer to push on each one:
- Encapsulation: why private fields plus getters instead of public fields? When is a getter itself a smell?
- Abstraction: interface vs abstract class in Java or C#. When would you choose one over the other?
- Inheritance: overriding vs overloading, what
superdoes, why deep hierarchies hurt, and when composition is the better tool. - Polymorphism: compile-time vs run-time dispatch, and a concrete case where a base-class reference calls a subclass method.
For a fresh-grad round they also drift into basics from the same family: what a constructor is, static vs instance members, and how a Map or a hash set behaves.
What they look for
- Definitions that come with a real example, not textbook sentences.
- Knowing the trade-offs (composition over inheritance, interface segregation) rather than only the vocabulary.
- Comfort switching between "what" and "why": if you say "polymorphism lets us treat objects uniformly", be ready to show a two-line snippet that does it.