All question banksCore Subjects
OOPS Questions A comprehensive collection of Object-Oriented Programming questions covering core principles, inheritance, and encapsulation. Designed for technical interview preparation.
1. What is Object-Oriented Programming? Beginner 2. What are the main principles of OOP? Beginner 3. What is a class? Beginner 4. What is an object? Beginner 5. What is the difference between a class and an object? Beginner 6. What is encapsulation? Intermediate 7. What is abstraction? Intermediate 8. What is inheritance? Intermediate 9. What is polymorphism? Intermediate 10. What is the difference between abstraction and encapsulation? Advanced 11. What are the advantages of OOP? Beginner 12. What are the disadvantages of OOP? Beginner 13. What is a constructor? Beginner 14. What is a destructor? Intermediate 15. What is the difference between constructor and method? Intermediate 16. What is method overloading? Intermediate 17. What is method overriding? Intermediate 18. What is the difference between overloading and overriding? Advanced 19. What is a static method? Intermediate 20. What is a static variable? Intermediate 21. What are access modifiers? Beginner 22. What is the difference between public, private, and protected? Intermediate 23. What are getter and setter methods? Beginner 24. Why should we use private variables with public getters/setters? Intermediate 25. What is data hiding? Intermediate 26. Can we override private methods? Intermediate 27. What is the purpose of the protected access modifier? Intermediate 28. What is package-private/default access modifier? Intermediate 29. Can we have private constructors? If yes, why? Advanced 30. What is information hiding in OOP? Advanced 31. How does encapsulation provide security? Intermediate 32. What is the difference between data hiding and encapsulation? Advanced 33. Can we access private members outside the class? Intermediate 34. What happens if we don't use access modifiers? Beginner 35. Can we change the access modifier while overriding? Advanced 36. What is single inheritance? Beginner 37. What is multiple inheritance? Intermediate 38. What is multilevel inheritance? Intermediate 39. What is hierarchical inheritance? Intermediate 40. What is hybrid inheritance? Advanced 41. Does Java support multiple inheritance? Why or why not? Advanced 42. What is the diamond problem? Advanced 43. How can we achieve multiple inheritance in Java? Advanced 44. What is the super keyword? Intermediate 45. What is the difference between this and super? Intermediate 46. Can we inherit constructors? Intermediate 47. What is constructor chaining? Advanced 48. What is the order of constructor execution in inheritance? Intermediate 49. Can we override static methods? Advanced 50. What is method hiding? Advanced 51. Can a subclass access private members of its parent class? Intermediate 52. What is the final keyword in inheritance? Intermediate 53. Can we inherit from a final class? Intermediate 54. What is the purpose of inheritance? Beginner 55. When should we use inheritance vs composition? Advanced 56. What is compile-time polymorphism? Intermediate 57. What is runtime polymorphism? Intermediate 58. What is dynamic method dispatch? Advanced 59. What is static binding? Intermediate 60. What is dynamic binding? Intermediate 61. What is the difference between early binding and late binding? Advanced 62. How is polymorphism achieved in OOP? Intermediate 63. What is operator overloading? Intermediate 64. Does Java support operator overloading? Beginner 65. What is covariant return type? Advanced 66. Can we achieve polymorphism without inheritance? Advanced 67. What is the role of inheritance in polymorphism? Intermediate 68. Can we override main method? Intermediate 69. Can we overload main method? Intermediate 70. What happens if we change the return type while overriding? Advanced 71. What is an abstract class? Intermediate 72. What is an interface? Intermediate 73. What is the difference between abstract class and interface? Advanced 74. Can we create an object of an abstract class? Beginner 75. Can an abstract class have a constructor? Intermediate 76. Can we have abstract methods in a non-abstract class? Intermediate 77. Can we have non-abstract methods in an abstract class? Intermediate 78. What are marker interfaces? Advanced 79. Can an interface extend another interface? Intermediate 80. Can a class implement multiple interfaces? Beginner 81. What is a friend function in C++? Intermediate 82. What is a friend class? Advanced 83. What are the advantages of friend functions? Intermediate 84. What are the disadvantages of friend functions? Intermediate 85. Can a friend function access private members of a class? Beginner 86. Does friend function violate encapsulation? Advanced 87. Can we have friend functions in Java? Intermediate 88. What is the difference between member function and friend function? Advanced 89. What is the syntax for declaring a friend function? Intermediate 90. What is composition? Intermediate 91. What is aggregation? Intermediate 92. What is the difference between composition and aggregation? Advanced 93. What is association in OOP? Intermediate 94. What is the difference between association and aggregation? Advanced 95. What is dependency injection? Advanced 96. What is tight coupling vs loose coupling? Intermediate 97. What is cohesion in OOP? Advanced 98. What is the Law of Demeter? Advanced 99. What is object cloning? Intermediate 100. What is shallow copy vs deep copy? Advanced 101. What is a copy constructor? Intermediate 102. What is the virtual keyword? Intermediate 103. What is a virtual function? Intermediate 104. What is a pure virtual function? Advanced 105. What is a virtual destructor and why is it needed? Advanced 106. What is an abstract method? Beginner 107. What is the difference between virtual function and pure virtual function? Intermediate 108. What is a vtable (virtual table)? Advanced 109. What is late binding in virtual functions? Advanced 110. What are design patterns? Intermediate 111. What is the Singleton pattern? Intermediate 112. What is the Factory pattern? Intermediate 113. What is the Observer pattern? Advanced 114. What is the Strategy pattern? Advanced 115. What is the Decorator pattern? Advanced 116. What are SOLID principles? Intermediate 117. What is the Single Responsibility Principle? Intermediate 118. What is the Open/Closed Principle? Intermediate 119. What is the Liskov Substitution Principle? Advanced 120. What is the Interface Segregation Principle? Advanced 121. What is the Dependency Inversion Principle? Advanced 122. What is DRY principle? Beginner 123. What is KISS principle? Beginner 124. What is YAGNI principle? Beginner 125. What is the difference between stack and heap memory? Intermediate 126. Where are objects stored in memory? Intermediate 127. What is garbage collection? Beginner 128. What is a memory leak in OOP? Intermediate 129. What is the finalize method? Advanced 130. What is object serialization? Intermediate 131. What is object deserialization? Intermediate 132. What is reflection in OOP? Advanced 133. What is introspection? Advanced 134. What is a namespace? Beginner 135. What is a package? Beginner 136. What is the difference between namespace and package? Intermediate 137. What is an inner class? Intermediate 138. What is a nested class? Intermediate 139. What is an anonymous class? Advanced 140. What is multiple dispatch? Advanced 141. What is mixin? Advanced 142. What is trait? Advanced 143. What is protocol-oriented programming? Advanced 144. What is the difference between OOP and procedural programming? Intermediate 145. What is the difference between OOP and functional programming? Advanced 146. What is method chaining? Intermediate 147. What is fluent interface? Advanced 148. What is immutability in OOP? Intermediate 149. What are value objects vs entities? Advanced