CJE BENCHMARK EXAM REVIEW
QUESTIONS AND CORRECT ANSWERS
LATEST UPDATE
1. In a Declarative Pipeline, which directive is used to ensure that a stage executes only if a
specific condition is met, and can optionally be evaluated before the agent is allocated?
A. condition
B. check
C. when
D. if
Answer: C
Conceptual Explanation: The ‘when’ directive allows for conditional stage execution and
can include ‘beforeAgent true’ to avoid unnecessary agent provisioning.
2. When using the ‘stash’ step in a Jenkins Pipeline, what is the primary limitation regarding
its scope and usage?
A. Stashed files are only available during the specific build that created them.
B. Stashed files can only be used by the Jenkins controller and not agents.
C. Stashed files are persisted across different Jenkins builds.
D. Stash only supports text-based files, not binaries.
,Answer: A
Conceptual Explanation: The ‘stash’ step saves files for use within the same build,
potentially across different nodes. For cross-build persistence, ‘archiveArtifacts’ should be
used.
3. What is the security implication of the ‘Agent-to-Controller Security Subsystem’ in Jenkins?
A. It encrypts all traffic between the controller and agents via TLS 1.3.
B. It allows agents to automatically approve their own scripts in the sandbox.
C. It prevents agents from accessing sensitive data or performing actions on the controller
without explicit permission.
D. It forces all agents to use the JNLP protocol exclusively.
Answer: C
Conceptual Explanation: This subsystem restricts the commands and file access an agent
can initiate on the controller to prevent a compromised agent from taking over the Jenkins
master.
4. In a Jenkins Shared Library, which directory is intended for holding Groovy source files that
are added to the classpath during compilation?
A. src
B. resources
C. vars
, D. lib
Answer: A
Conceptual Explanation: The ‘src’ directory is a standard Java/Groovy source structure
added to the classpath. ‘vars’ is for global variables (DSL steps) and ‘resources’ is for non-
Groovy files.
5. Which environment variable provides the unique ID for the current build in a Jenkins
Pipeline?
A. BUILD_TAG
B. JOB_NAME
C. BUILD_ID
D. EXECUTOR_NUMBER
Answer: C
Conceptual Explanation: BUILD_ID (in modern Jenkins) or BUILD_NUMBER provides the
unique identifier for a specific execution of a job.
6. What does the ‘failFast true’ option do within a ‘parallel’ block in a Declarative Pipeline?
A. It retries a failed parallel branch immediately.
B. It speeds up the execution of parallel branches by allocating more CPU.
C. It skips testing stages in parallel branches.
D. It causes the entire build to fail if the first parallel branch fails, aborting other branches.
QUESTIONS AND CORRECT ANSWERS
LATEST UPDATE
1. In a Declarative Pipeline, which directive is used to ensure that a stage executes only if a
specific condition is met, and can optionally be evaluated before the agent is allocated?
A. condition
B. check
C. when
D. if
Answer: C
Conceptual Explanation: The ‘when’ directive allows for conditional stage execution and
can include ‘beforeAgent true’ to avoid unnecessary agent provisioning.
2. When using the ‘stash’ step in a Jenkins Pipeline, what is the primary limitation regarding
its scope and usage?
A. Stashed files are only available during the specific build that created them.
B. Stashed files can only be used by the Jenkins controller and not agents.
C. Stashed files are persisted across different Jenkins builds.
D. Stash only supports text-based files, not binaries.
,Answer: A
Conceptual Explanation: The ‘stash’ step saves files for use within the same build,
potentially across different nodes. For cross-build persistence, ‘archiveArtifacts’ should be
used.
3. What is the security implication of the ‘Agent-to-Controller Security Subsystem’ in Jenkins?
A. It encrypts all traffic between the controller and agents via TLS 1.3.
B. It allows agents to automatically approve their own scripts in the sandbox.
C. It prevents agents from accessing sensitive data or performing actions on the controller
without explicit permission.
D. It forces all agents to use the JNLP protocol exclusively.
Answer: C
Conceptual Explanation: This subsystem restricts the commands and file access an agent
can initiate on the controller to prevent a compromised agent from taking over the Jenkins
master.
4. In a Jenkins Shared Library, which directory is intended for holding Groovy source files that
are added to the classpath during compilation?
A. src
B. resources
C. vars
, D. lib
Answer: A
Conceptual Explanation: The ‘src’ directory is a standard Java/Groovy source structure
added to the classpath. ‘vars’ is for global variables (DSL steps) and ‘resources’ is for non-
Groovy files.
5. Which environment variable provides the unique ID for the current build in a Jenkins
Pipeline?
A. BUILD_TAG
B. JOB_NAME
C. BUILD_ID
D. EXECUTOR_NUMBER
Answer: C
Conceptual Explanation: BUILD_ID (in modern Jenkins) or BUILD_NUMBER provides the
unique identifier for a specific execution of a job.
6. What does the ‘failFast true’ option do within a ‘parallel’ block in a Declarative Pipeline?
A. It retries a failed parallel branch immediately.
B. It speeds up the execution of parallel branches by allocating more CPU.
C. It skips testing stages in parallel branches.
D. It causes the entire build to fail if the first parallel branch fails, aborting other branches.