Whatever language you code in, the technical interview will almost certainly include questions on Object-Oriented Programming (OOPs). TCS, Infosys, Wipro, Accenture, Cognizant and product companies all use OOP questions to check whether you understand how real software is structured โ not just whether you can write a loop. This guide covers 25 OOPs interview questions for freshers in 2026, with short answers and examples you can explain in your own words.
Key takeaways
- The four pillars of OOP โ encapsulation, abstraction, inheritance and polymorphism โ are asked in almost every fresher technical interview.
- Overloading vs overriding and abstract class vs interface are the two most common comparison questions.
- Interviewers expect a one-line definition plus a small real-world or code example for each concept.
- Linking OOP concepts to your own project is the best way to make answers stand out.
How to use this list
Read each answer, then close the page and explain it aloud in under 30 seconds with an example. Most answers use Java syntax because it is the most common interview language, but notes for C++ and Python are included where they differ. If your basics in any language are shaky, start with our Python for Placement course.
OOPs basics (Q1โQ5)
1. What is Object-Oriented Programming (OOP)?
OOP is a way of designing programs around objects โ bundles of data (fields) and behaviour (methods). Instead of writing one long list of steps, you model real things like a Student or a BankAccount, which makes code easier to reuse, test and extend.
2. What are the four pillars of OOP?
Encapsulation, abstraction, inheritance and polymorphism. Interviewers love asking you to explain each in one line with an example โ practise that.
3. What is the difference between a class and an object?
A class is a blueprint; an object is a real instance created from it. Car is a class; myCar = new Car() is an object with its own colour and speed values. A class takes no memory for data until objects are created.
4. What is encapsulation?
Encapsulation means keeping data and the methods that work on it together, and hiding the data from direct outside access. In Java you make fields private and expose public getters/setters, so you can validate input (for example, reject a negative balance).
5. What is abstraction? How is it different from encapsulation?
Abstraction shows only what an object does and hides how it does it โ you call list.sort() without knowing the algorithm. Encapsulation is about protecting data; abstraction is about simplifying the interface.
Inheritance and polymorphism (Q6โQ11)
6. What is inheritance?
Inheritance lets a child class reuse and extend a parent class. class Dog extends Animal gets eat() from Animal and adds bark(). It models an "is-a" relationship.
7. What are the types of inheritance?
Single, multilevel, hierarchical, multiple and hybrid. Java supports multiple inheritance only through interfaces, while C++ supports it with classes. Python supports multiple inheritance and resolves methods using the MRO (method resolution order).
8. Why doesn't Java support multiple inheritance with classes?
To avoid the diamond problem: if two parent classes have the same method, the child wouldn't know which one to use. Java solves this with interfaces, and since Java 8 forces you to override a clashing default method.
9. What is polymorphism?
Polymorphism means "one name, many forms". The same method call behaves differently depending on the object. A shape.area() call returns a circle's area for a Circle and a rectangle's area for a Rectangle.
10. What is the difference between compile-time and runtime polymorphism?
Compile-time polymorphism is method overloading โ the compiler picks the method by its parameters. Runtime polymorphism is method overriding โ the JVM picks the child's version based on the actual object at runtime.
11. Method overloading vs method overriding?
Overloading: same method name, different parameter lists, in the same class. Overriding: a child class redefines a parent method with the same signature. Overloading is about convenience; overriding is about specialised behaviour.
Constructors and keywords (Q12โQ15)
12. What is a constructor?
A special method that runs when an object is created, used to set initial values. It has the same name as the class (in Java/C++) and no return type. In Python, the equivalent is __init__.
13. What are the types of constructors?
Default (no arguments), parameterised (takes arguments) and, in C++, the copy constructor. Java has no built-in copy constructor, but you can write one yourself.
14. What is constructor chaining?
Calling one constructor from another โ this(...) for the same class and super(...) for the parent class in Java. It avoids repeating initialisation code.
15. What is the use of the this and super keywords?
this refers to the current object (useful when a parameter has the same name as a field). super refers to the parent class, to call its constructor or an overridden method.
Abstract classes, interfaces and access (Q16โQ21)
16. What is an abstract class?
A class that cannot be instantiated and may contain both abstract methods (no body) and normal methods. It is used as a common base, e.g. an abstract Payment class with an abstract pay() method.
17. What is an interface?
A contract that lists methods a class must implement. A class can implement many interfaces, which is how Java achieves multiple inheritance of type. Since Java 8, interfaces can also have default and static methods.
18. Abstract class vs interface โ when do you use which?
Use an abstract class when related classes share code and state. Use an interface when unrelated classes should share a capability, like Comparable or Runnable. A good one-line answer: abstract class = "is-a with shared code", interface = "can-do".
19. What are access modifiers?
They control visibility: private (same class), default/package-private (same package), protected (same package + subclasses) and public (everywhere). C++ uses private, protected and public.
20. What is the difference between static and instance members?
Static members belong to the class and are shared by all objects (like a counter of how many students were created). Instance members belong to each object separately.
21. What is a final keyword in Java?
A final variable can't be reassigned, a final method can't be overridden, and a final class can't be extended (for example, String).
Design and language-specific questions (Q22โQ25)
22. What is the difference between composition and inheritance?
Inheritance is "is-a" (a Car is a Vehicle); composition is "has-a" (a Car has an Engine). Many design guides prefer composition because it keeps classes loosely coupled.
23. What is a virtual function in C++?
A function declared with virtual in a base class so that the derived class's version is called through a base pointer or reference at runtime. A pure virtual function (= 0) makes the class abstract.
24. What is a destructor? Does Java have one?
A destructor runs when an object is destroyed, to free resources โ ~ClassName() in C++. Java has no destructor; the garbage collector frees memory, and you use try-with-resources to close files and connections.
25. Explain OOP with a real project example.
This is a favourite closing question. Example: in a library app, Book and Member are classes, fields are private (encapsulation), DigitalBook extends Book (inheritance), calculateFine() behaves differently for students and staff (polymorphism), and a PaymentService interface hides UPI/card details (abstraction). Use your own project in the interview.
Common mistakes freshers make
- Giving textbook definitions with no example โ always add a one-line example.
- Mixing up abstraction and encapsulation โ remember "simplify" vs "protect".
- Saying Java has no multiple inheritance at all โ it does, through interfaces.
- Not connecting OOP to your own project when asked "where have you used this?"
Once OOP is solid, move on to coding rounds with our DSA for Placement course and company-wise patterns on the placement preparation page.
Related guides
- 25 Java Interview Questions for Freshers (2026) โ With Simple Answers and Code
- 25 Python Interview Questions for Freshers (2026) โ With Simple Answers
- 25 DSA Interview Questions for Freshers (2026) โ With Simple Answers and Code
- Infosys SP & DSE Hiring 2026: Salary, Eligibility, Prep
- How to Start Coding in College
FAQ
Which OOPs questions are asked most in fresher interviews?
The four pillars, class vs object, overloading vs overriding, abstract class vs interface, and constructors come up most often.
Should I answer OOPs questions in Java, C++ or Python?
Use the language you listed on your resume. The concepts are the same; only syntax and a few rules (like multiple inheritance) differ.
Are OOPs questions asked in TCS, Infosys and Wipro interviews?
Yes. OOP basics are a regular part of technical interviews at service companies, usually alongside DBMS, SQL and questions on your projects. See our TCS preparation page for a company example.
How long does it take to prepare OOPs for interviews?
If you already know one language, 5โ7 days of focused revision with examples is usually enough for fresher-level interviews.
Conclusion
OOPs is one of the easiest interview topics to score well in, because the question set is predictable. Practise these 25 answers aloud, tie them to your project, and you will walk into the technical round with confidence. For guided practice and mock interviews, check out our placement courses.
๐ข Get verified job alerts every day โ free
Fresher drives, internships and IT jobs with official apply links only. No fake links, no fees.
More articles

Infosys Specialist Programmer & DSE Hiring 2026: Up to โน21 LPA โ Eligibility, Selection Process and a 4-Week Prep Plan
Infosys is hiring 2024โ2026 graduates as Specialist Programmers (up to โน21 LPA) and DSEs. Eligibility, selection process and a 4-week prep โฆ
Read article โ
25 DSA Interview Questions for Freshers (2026) โ With Simple Answers and Code
25 most-asked DSA interview questions for freshers in 2026 with simple answers on arrays, linked lists, stacks, trees, graphs, sorting and โฆ
Read article โ