Common OOP interview questions

1 minute read

  1. What is object-oriented programming (OOP)?
  2. What is class? Give a real life example.
  3. What is an object? Give a real life example.
  4. Explain the basic features of OOPs.
  5. What is the relationship between a class and an object?
  6. What is difference between OOP and procedural Language?
  7. What is encapsulation? Why encapsulation is necessary, explain with example?
  8. Tell about excess modifier.
  9. What is value type and reference type, explain with example?
  10. What is method overloading, explain with example?
  11. What is method overriding, explain with example?
  12. What is polymorphism, explain with example?
  13. What is run time polymorphism, explain with example?
  14. How is method overriding different from method overloading?
  15. What is inheritance, explain with example?
  16. What is interface? Why interface is used?
  17. What is abstract class? Why abstract class is used?
  18. What is static member? Why static member? How static member is accessed?
  19. Can you specify the accessibility modifier for methods inside the interface?
  20. What is constructor? Why constructor is used?
  21. What is constructor overloading?
  22. Is it possible for a class to inherit the constructor of its base class?
  23. Is it possible for a class to inherit the constructor of its base class?
  24. What is the difference between arrays and collection?
  25. What are collections and generics?
  26. How can you prevent your class to be inherited further?
  27. What is the index value of the first element in an array?