Top 150+ Most Asked Object-Oriented Programming Interview Questions

A comprehensive collection of Object-Oriented Programming questions covering core principles, inheritance, and encapsulation. Designed for technical interview preparation.

0%

Overall Progress

0/150

1.What is Object-Oriented Programming?

2.What are the main principles of OOP?

3.What is a class?

4.What is an object?

5.What is the difference between a class and an object?

6.What is encapsulation?

7.What is abstraction?

8.What is inheritance?

9.What is polymorphism?

10.What is the difference between abstraction and encapsulation?

11.What are the advantages of OOP?

12.What are the disadvantages of OOP?

13.What is a constructor?

14.What is a destructor?

15.What is the difference between constructor and method?

16.What is method overloading?

17.What is method overriding?

18.What is the difference between overloading and overriding?

19.What is a static method?

20.What is a static variable?

21.What are access modifiers?

22.What is the difference between public, private, and protected?

23.What are getter and setter methods?

24.Why should we use private variables with public getters/setters?

25.What is data hiding?

26.Can we override private methods?

27.What is the purpose of the protected access modifier?

28.What is package-private/default access modifier?

29.Can we have private constructors? If yes, why?

30.What is information hiding in OOP?

31.How does encapsulation provide security?

32.What is the difference between data hiding and encapsulation?

33.Can we access private members outside the class?

34.What happens if we don't use access modifiers?

35.Can we change the access modifier while overriding?

36.What is single inheritance?

37.What is multiple inheritance?

38.What is multilevel inheritance?

39.What is hierarchical inheritance?

40.What is hybrid inheritance?

41.Does Java support multiple inheritance? Why or why not?

42.What is the diamond problem?

43.How can we achieve multiple inheritance in Java?

44.What is the super keyword?

45.What is the difference between this and super?

46.Can we inherit constructors?

47.What is constructor chaining?

48.What is the order of constructor execution in inheritance?

49.Can we override static methods?

50.What is method hiding?

51.Can a subclass access private members of its parent class?

52.What is the final keyword in inheritance?

53.Can we inherit from a final class?

54.What is the purpose of inheritance?

55.When should we use inheritance vs composition?

56.What is compile-time polymorphism?

57.What is runtime polymorphism?

58.What is dynamic method dispatch?

59.What is static binding?

60.What is dynamic binding?

61.What is the difference between early binding and late binding?

62.How is polymorphism achieved in OOP?

63.What is operator overloading?

64.Does Java support operator overloading?

65.What is covariant return type?

66.Can we achieve polymorphism without inheritance?

67.What is the role of inheritance in polymorphism?

68.Can we override main method?

69.Can we overload main method?

70.What happens if we change the return type while overriding?

71.What is an abstract class?

72.What is an interface?

73.What is the difference between abstract class and interface?

74.Can we create an object of an abstract class?

75.Can an abstract class have a constructor?

76.Can we have abstract methods in a non-abstract class?

77.Can we have non-abstract methods in an abstract class?

78.What are marker interfaces?

79.Can an interface extend another interface?

80.Can a class implement multiple interfaces?

81.What is a friend function in C++?

82.What is a friend class?

83.What are the advantages of friend functions?

84.What are the disadvantages of friend functions?

85.Can a friend function access private members of a class?

86.Does friend function violate encapsulation?

87.Can we have friend functions in Java?

88.What is the difference between member function and friend function?

90.What is the syntax for declaring a friend function?

91.What is composition?

92.What is aggregation?

93.What is the difference between composition and aggregation?

94.What is association in OOP?

95.What is the difference between association and aggregation?

96.What is dependency injection?

97.What is tight coupling vs loose coupling?

98.What is cohesion in OOP?

99.What is the Law of Demeter?

100.What is object cloning?

101.What is shallow copy vs deep copy?

102.What is a copy constructor?

103.What is the virtual keyword?

104.What is a virtual function?

105.What is a pure virtual function?

106.What is a virtual destructor and why is it needed?

107.What is an abstract method?

108.What is the difference between virtual function and pure virtual function?

109.What is a vtable (virtual table)?

110.What is late binding in virtual functions?

111.What are design patterns?

112.What is the Singleton pattern?

113.What is the Factory pattern?

114.What is the Observer pattern?

115.What is the Strategy pattern?

116.What is the Decorator pattern?

117.What are SOLID principles?

118.What is the Single Responsibility Principle?

119.What is the Open/Closed Principle?

120.What is the Liskov Substitution Principle?

121.What is the Interface Segregation Principle?

122.What is the Dependency Inversion Principle?

123.What is DRY principle?

124.What is KISS principle?

125.What is YAGNI principle?

126.What is the difference between stack and heap memory?

127.Where are objects stored in memory?

128.What is garbage collection?

129.What is a memory leak in OOP?

130.What is the finalize method?

131.What is object serialization?

132.What is object deserialization?

133.What is reflection in OOP?

134.What is introspection?

135.What is a namespace?

136.What is a package?

137.What is the difference between namespace and package?

138.What is an inner class?

139.What is a nested class?

140.What is an anonymous class?

141.What is multiple dispatch?

142.What is mixin?

143.What is trait?

144.What is protocol-oriented programming?

145.What is the difference between OOP and procedural programming?

146.What is the difference between OOP and functional programming?

147.What is method chaining?

148.What is fluent interface?

149.What is immutability in OOP?

150.What are value objects vs entities?