Why interviewers ask this
It tests core programming concepts common in many languages.
How to approach it
Name encapsulation, abstraction, inheritance and polymorphism and give a tiny example for each.
Example answer
Encapsulation hides data behind methods, abstraction exposes only what is needed, inheritance reuses behaviour from a parent class, and polymorphism lets different classes respond to the same method differently.
What a weak answer sounds like
OOP is about classes and objects.
It is vague, has no example and gives the interviewer nothing to remember.
Common mistake
Listing the terms with no examples.
Follow-up questions to expect
- Give an example of polymorphism in a project.
- What is the difference between abstraction and encapsulation?
- When would you prefer composition over inheritance?
How to practise
Explain each pillar using an example from a project you have actually built.
Use this as a pattern, not a script. Answer in your own words with your own examples.