PCPP2 · domain
Advanced OOP And Performance
Practise Python Institute Certified Professional in Python Programming 2 (PCPP2) (PCPP2) Advanced OOP And Performance practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.
Focused practice
Practice Advanced OOP And Performance questions
Scored sessions drawing only from this domain — pick a length below.
Start 20-question practice test →What this domain covers
What to know about Advanced OOP And Performance
Advanced OOP And Performance questions test whether you can apply the concept in context, not just recognise a definition.
How the topic appears in realistic exam-style scenarios.
Which detail in the question changes the correct answer.
How to eliminate plausible but wrong options.
How to connect the question back to the wider exam objective.
Watch out for
Common Advanced OOP And Performance exam traps
- ▸Answering from memory before reading the full scenario.
- ▸Missing a constraint such as cost, availability, security, scope or command context.
- ▸Choosing a broad answer when the question asks for the most specific fix.
- ▸Ignoring why the wrong options are tempting.
Question index
All Advanced OOP And Performance questions (32)
Click any question to see the full explanation, or start a practice session above.
You are utilizing abstract base classes (ABCs). How do you enforce that a subclass implements a specific method?
Hard2You need to prevent an object's attribute from being modified after it is set. Which approach provides the most robust implementation?
Hard3You have an object that behaves like a function. Which magic method must be implemented to make this possible?
Medium4You need to ensure that a class can only be instantiated once throughout the application lifecycle. Which design pattern is most appropriate?
Easy5When managing resources like file handles, what is the best practice to ensure they are always closed?
Easy6When using inheritance, how can you explicitly call a method from a specific parent class that is not the immediate superclass?
Medium7You need to implement a custom class that behaves like a sequence, allowing indexing and length checking. Which magic methods are required?
Hard8In a multi-threaded application, you need to ensure that shared state is modified safely. Which tool is the most appropriate for this task?
Hard9When writing a metaclass, what is the 'cls' parameter in the __new__ method referring to?
Hard10Which THREE of the following are features of the 'threading' module in Python?
Hard11Which operator is used to perform bitwise AND operations?
Easy12You are handling large datasets and want to improve memory efficiency. Which Python feature allows you to iterate over a large sequence without loading it entirely into memory?
Medium13Which magic method is used to define how an object is displayed for developers (for debugging)?
Easy14Which keyword is used to raise an exception in Python?
Easy15You are designing a class hierarchy where a subclass needs to ensure it calls the constructor of its parent in a multiple inheritance scenario. Which mechanism is the standard Pythonic approach to handle this dynamically?
Medium16Which TWO of the following are valid ways to create a generator in Python?
Medium17You need to ensure that a method can be called on the class directly, without requiring an instance. Which decorator should be used?
Medium18Which TWO of the following are true about the 'descriptor protocol' in Python?
Hard19You need to compare two objects for equality based on a custom attribute. Which method should you override?
Medium20When writing a context manager using the @contextlib.contextmanager decorator, what should the function do to pass a value to the 'as' clause?
Medium21You are using 'slots' to save memory. What is a significant side effect of defining __slots__ in a class?
Hard22You want to store an object in a set. What must the object implement?
Medium23You are profiling your code and identify that a specific method is called millions of times. You decide to use a descriptor to optimize attribute access. What must the descriptor implement to intercept attribute assignment?
Hard24When optimizing Python code, which tool should you use to identify hot spots in the execution path?
Easy25Which TWO of the following are Python object-oriented concepts?
Easy26Which THREE of the following are true about Python metaclasses?
Hard27You have a performance-critical application using heavy objects. You want to reduce memory footprint by preventing the creation of __dict__ for every instance. How should you proceed?
Hard28You need to dynamically add methods to a class at runtime. Which mechanism allows you to modify the class object before it is fully constructed?
Medium29Which built-in function allows you to retrieve an attribute from an object by its string name?
Easy30Which THREE of the following can be used to improve the performance of a Python application?
Medium31Which TWO of the following statements about the Python Method Resolution Order (MRO) are true?
Hard32Which THREE of the following are benefits of using __slots__?
MediumOther domains
All PCPP2 exam domains
Frequently asked questions
- What does the Advanced OOP And Performance domain cover on the PCPP2 exam?
- Advanced OOP And Performance questions test whether you can apply the concept in context, not just recognise a definition.
- How many questions are in this domain?
- This page lists all 32 Advanced OOP And Performance questions in the PCPP2 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
- What is the best way to practise this domain?
- Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
- Can I practise only Advanced OOP And Performance questions?
- Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.