PCAP Object-Oriented Programming Practice Question
An abstract base class (ABC) defines an abstract method `process()`. Several subclasses implement it. A function accepts any subclass and calls `process()`. This demonstrates which OOP concept?
⚠ Common exam trap
Python Institute often tests the distinction between inheritance and polymorphism by presenting a scenario where multiple subclasses override a method, leading candidates to mistakenly select 'inheritance' because they see the class hierarchy, but the key behavior is the polymorphic call, not the inheritance itself.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Polymorphism.
Polymorphism allows objects of different subclasses to be treated uniformly through their common interface. When a function accepts any subclass of the ABC and calls `process()`, the correct implementation is resolved at runtime via dynamic dispatch, which is the essence of polymorphism in Python.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Inheritance.
Why it's wrong here
Inheritance is a mechanism for code reuse and establishing a hierarchy; it allows subclasses to inherit the abstract method, but inheritance alone only provides the shared contract, not the ability to have different implementations selected at runtime. Polymorphism is the runtime behavior that occurs when each subclass overrides `pro` with its own version, so the same call dispatches to the correct implementation based on the actual object type. So inheritance is the structural prerequisite, not the concept the question is targeting.
- ✗
Encapsulation.
Why it's wrong here
Encapsulation bundles data and the methods that operate on that data, hiding internal state behind an interface. It does not describe how a single abstract method like `pro` can have multiple implementations across subclasses. The question asks about the relationship between an abstract interface and the different behaviors of subclasses, which is the essence of polymorphism, not encapsulation.
- ✗
Method overloading.
Why it's wrong here
Method overloading typically means multiple methods with the same name but different parameters in the same class, which Python doesn't support in the traditional sense (you'd use default arguments or *args). The abstract method `pro` has a fixed signature, and the variation comes from overriding in different subclasses, not from multiple methods in one class with different signatures. Thus, it is not the pattern being described.
- ✓
Polymorphism.
Why this is correct
Polymorphism allows objects of different classes that share a common abstract base to be used interchangeably, with the correct override of `pro` invoked dynamically at runtime. Because `pro` is abstract, each concrete subclass must provide its own implementation, and the Python runtime dispatches to the specific version based on the actual object type. This is precisely the concept the question is testing.
Visual reference
Go deeper
Related to this question
About these practice questions
This PCAP question is part of Courseiva's 421-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PCAP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCAP exam.