PCAP • Timed Hard Questions
This is a timed practice session. You have 15 minutes to answer 25 questions — approximately 1 minute per question, matching real PCAP exam pace. Answer every question before time expires.
Time remaining
15:00
Exam-pace drill
Allow 1 minute per question. On the real PCAP exam you have approximately 72 seconds per question — this session trains you to maintain that pace under pressure.
An application uses a heavy-weight class DatabaseConnection that establishes a network connection upon instantiation. The class is used in multiple places, and the developer wants to ensure that only one instance of DatabaseConnection exists throughout the application. They implement a Singleton pattern using a class attribute _instance and a class method get_instance(). However, they notice that the network connection is being established multiple times. After debugging, they find that the singleton is not being enforced because the __init__ method is called every time the class is instantiated, even if the same instance is returned. They want to fix this so that the connection is established only once. Which modification should they make?
15 minute time limit — choose an answer to begin.
25 questions · 15 minute exam-pace drill.