OOP interview questions

21 OOP questions from the PHP bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every OOP question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers