CJE BENCHMARK EXAM 2 QUESTIONS
AND CORRECT ANSWERS LATEST
UPDATE
1. In a Declarative Pipeline, which directive is used to define global options such as a build
timeout or retry limit?
A. environment
B. options
C. parameters
D. triggers
Answer: B
Conceptual Explanation: The ‘options’ directive in a Declarative Pipeline is used to
configure Pipeline-specific options, such as ‘timeout’, ‘retry’, and ‘buildDiscarder’.
2. When using Jenkins Shared Libraries, where must global variables (accessible as steps) be
defined within the library structure?
A. src/org/library/
B. resources/
C. lib/
D. vars/
,Answer: D
Conceptual Explanation: Global variables defined in the ‘vars/’ directory are exposed as
custom steps in the Pipeline DSL.
3. Which Jenkins feature allows for the automatic tracking of artifact usage across different
jobs, provided md5 checksums are recorded?
A. Artifact Archiver
B. Copy Artifact Plugin
C. Pipeline Graph
D. Fingerprinting
Answer: D
Conceptual Explanation: Fingerprinting uses md5 hashes to track where artifacts are
produced and where they are consumed across the Jenkins environment.
4. What happens if a Declarative Pipeline does not specify an ‘agent’ at the top level but
specifies them at the stage level?
A. The Pipeline will fail to parse.
B. The Pipeline must define ‘agent none’ at the top level.
C. The Pipeline will run on the built-in node by default.
D. The Pipeline will prompt the user for an agent.
Answer: B
, Conceptual Explanation: In Declarative Pipeline, an ‘agent’ directive is mandatory at the
top level. If stages define their own agents, the top level must be ‘agent none’.
5. Which environment variable provides the unique ID for a specific build in a Jenkins job?
A. BUILD_NUMBER
B. EXECUTOR_NUMBER
C. JOB_NAME
D. BUILD_ID
Answer: D
Conceptual Explanation: BUILD_ID is the unique identifier for the build, often
represented as a timestamp or a sequential number depending on the Jenkins version.
6. How can you prevent a Jenkins agent from being used by any job except those specifically
restricted to it via a label?
A. Set the agent’s Usage to ‘Only build jobs with label expressions matching this node’.
B. Remove all labels from the agent.
C. Disconnect the agent when not in use.
D. Use a Matrix project to lock the node.
Answer: A
Conceptual Explanation: The ‘Usage’ configuration (Mode) determines if a node is
available for any job or only those that specifically request its label.
AND CORRECT ANSWERS LATEST
UPDATE
1. In a Declarative Pipeline, which directive is used to define global options such as a build
timeout or retry limit?
A. environment
B. options
C. parameters
D. triggers
Answer: B
Conceptual Explanation: The ‘options’ directive in a Declarative Pipeline is used to
configure Pipeline-specific options, such as ‘timeout’, ‘retry’, and ‘buildDiscarder’.
2. When using Jenkins Shared Libraries, where must global variables (accessible as steps) be
defined within the library structure?
A. src/org/library/
B. resources/
C. lib/
D. vars/
,Answer: D
Conceptual Explanation: Global variables defined in the ‘vars/’ directory are exposed as
custom steps in the Pipeline DSL.
3. Which Jenkins feature allows for the automatic tracking of artifact usage across different
jobs, provided md5 checksums are recorded?
A. Artifact Archiver
B. Copy Artifact Plugin
C. Pipeline Graph
D. Fingerprinting
Answer: D
Conceptual Explanation: Fingerprinting uses md5 hashes to track where artifacts are
produced and where they are consumed across the Jenkins environment.
4. What happens if a Declarative Pipeline does not specify an ‘agent’ at the top level but
specifies them at the stage level?
A. The Pipeline will fail to parse.
B. The Pipeline must define ‘agent none’ at the top level.
C. The Pipeline will run on the built-in node by default.
D. The Pipeline will prompt the user for an agent.
Answer: B
, Conceptual Explanation: In Declarative Pipeline, an ‘agent’ directive is mandatory at the
top level. If stages define their own agents, the top level must be ‘agent none’.
5. Which environment variable provides the unique ID for a specific build in a Jenkins job?
A. BUILD_NUMBER
B. EXECUTOR_NUMBER
C. JOB_NAME
D. BUILD_ID
Answer: D
Conceptual Explanation: BUILD_ID is the unique identifier for the build, often
represented as a timestamp or a sequential number depending on the Jenkins version.
6. How can you prevent a Jenkins agent from being used by any job except those specifically
restricted to it via a label?
A. Set the agent’s Usage to ‘Only build jobs with label expressions matching this node’.
B. Remove all labels from the agent.
C. Disconnect the agent when not in use.
D. Use a Matrix project to lock the node.
Answer: A
Conceptual Explanation: The ‘Usage’ configuration (Mode) determines if a node is
available for any job or only those that specifically request its label.