OOP interview questions

21 real OOP questions from the PHP bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Abstract class?

Junior
  1. A.a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
  2. B.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
  3. C.a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
  4. D.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
Reveal the answer + AI explanation — free account

2. Which term means: "a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement"?

Junior
  1. A.Interface
  2. B.Late static binding
  3. C.Visibility modifier
  4. D.Abstract class
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.Abstract class — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
  2. B.Abstract class — a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
  3. C.Abstract class — a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
  4. D.Abstract class — a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
Reveal the answer + AI explanation — free account

4. What is Interface?

Junior
  1. A.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
  2. B.a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
  3. C.a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
  4. D.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Reveal the answer + AI explanation — free account

5. Which term means: "a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own"?

Junior
  1. A.Visibility modifier
  2. B.Interface
  3. C.Readonly property
  4. D.self keyword
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.Interface — a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
  2. B.Interface — a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
  3. C.Interface — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
  4. D.Interface — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
Reveal the answer + AI explanation — free account

7. What is Trait?

Mid
  1. A.the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
  2. B.a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
  3. C.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
  4. D.a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
Reveal the answer + AI explanation — free account

8. Which term means: "a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance"?

Mid
  1. A.Interface
  2. B.self keyword
  3. C.Abstract class
  4. D.Trait
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.Trait — a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
  2. B.Trait — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
  3. C.Trait — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
  4. D.Trait — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Reveal the answer + AI explanation — free account

10. What is Visibility modifier?

Mid
  1. A.a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
  2. B.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
  3. C.the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
  4. D.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
Reveal the answer + AI explanation — free account

11. Which term means: "a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class"?

Mid
  1. A.Late static binding
  2. B.Trait
  3. C.self keyword
  4. D.Visibility modifier
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.Visibility modifier — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
  2. B.Visibility modifier — a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
  3. C.Visibility modifier — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
  4. D.Visibility modifier — a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
Reveal the answer + AI explanation — free account

13. What is Late static binding?

Senior
  1. A.the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
  2. B.a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
  3. C.a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
  4. D.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Reveal the answer + AI explanation — free account

14. Which term means: "the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on"?

Senior
  1. A.Late static binding
  2. B.Interface
  3. C.Trait
  4. D.Readonly property
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Senior
  1. A.Late static binding — a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
  2. B.Late static binding — a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
  3. C.Late static binding — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
  4. D.Late static binding — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
Reveal the answer + AI explanation — free account

16. What is self keyword?

Senior
  1. A.a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
  2. B.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
  3. C.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
  4. D.a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
Reveal the answer + AI explanation — free account

17. Which term means: "a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it"?

Senior
  1. A.Interface
  2. B.Visibility modifier
  3. C.self keyword
  4. D.Abstract class
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Senior
  1. A.self keyword — a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
  2. B.self keyword — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
  3. C.self keyword — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
  4. D.self keyword — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
Reveal the answer + AI explanation — free account

19. What is Readonly property?

Mid
  1. A.a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
  2. B.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
  3. C.the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
  4. D.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Reveal the answer + AI explanation — free account

20. Which term means: "a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed"?

Mid
  1. A.self keyword
  2. B.Readonly property
  3. C.Trait
  4. D.Late static binding
Reveal the answer + AI explanation — free account

21. Which statement is correct?

Mid
  1. A.Readonly property — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
  2. B.Readonly property — a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
  3. C.Readonly property — a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
  4. D.Readonly property — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice OOP free