Automation | Actual Q&A with Rationale
(D522 Exam 3) | Western Governors
University
1. A developer is writing a script to verify that a function returns the expected list of users.
Which method from the Python unittest module should be utilized to check for exact equality
between the returned list and the expected list?
A. assertIs()
B. assertTrue()
C. assertContains()
D. assertEqual()
Answer: D
Rationale: The assertEqual method is specifically designed to compare two objects for
equality. In the context of unit testing, it verifies that the actual output matches the
expected value. This is the most common assertion used to validate functional correctness
in Python automation scripts.
2. When managing infrastructure, what is the primary benefit of using a declarative
configuration management tool like Puppet?
A. It allows the user to specify the exact sequence of commands to execute.
,B. It requires manual intervention for every change made to the server.
C. It focuses on the final state of the system rather than the steps to get there.
D. It is primarily used for graphical user interface automation.
Answer: C
Rationale: Declarative tools allow administrators to define what the system should look
like. The tool itself then determines the necessary actions to reach that state. This approach
simplifies complex deployments by abstracting the implementation details from the user.
3. A system administrator notices a script is running slowly and suspects a specific block of
code is the bottleneck. Which debugging technique involves adding timestamps to track
execution duration?
A. Binary search debugging
B. Integration testing
C. Static analysis
D. Profiling
Answer: D
Rationale: Profiling is the process of measuring the space or time complexity of a program.
By using profilers, developers can identify which functions consume the most resources.
This data is essential for optimizing script performance in production environments.
, 4. In the context of troubleshooting, what is the ‘binary search’ method used for?
A. Repeatedly dividing a search space in half to isolate a faulty component.
B. Searching for binary files within a hidden directory.
C. Sorting a list of error messages alphabetically.
D. Converting decimal error codes into binary format for analysis.
Answer: A
Rationale: Binary search in troubleshooting is an efficient way to find the source of an
issue by splitting the potential problem area. By testing the midpoint, the technician can
eliminate half of the possibilities in each step. This significantly reduces the time required
to locate a bug in large codebases or complex systems.
5. Which Puppet component is responsible for gathering system information, such as IP
addresses and OS versions, to be used in manifests?
A. Hiera
B. MCollective
C. PuppetDB
D. Facter
Answer: D
Rationale: Facter is a cross-platform profiling library that discovers and reports per-node
facts. These facts are then available as variables in Puppet manifests to allow for