CJE BENCHMARK EXAM 3 QUESTIONS
AND CORRECT ANSWERS LATEST
UPDATE
1. In a Declarative Pipeline, which directive is used to specify that a stage should only execute
if a certain environment variable is set to a specific value?
A. when
B. expression
C. condition
D. check
Answer: A
Conceptual Explanation: The ‘when’ directive allows the Pipeline to determine whether
the stage should be executed depending on given conditions, such as environment
variables, branch names, or custom expressions.
2. When using a Jenkins Shared Library, where should the global variables (custom steps) be
stored within the repository structure?
A. /src
B. /vars
C. /resources
,D. /lib
Answer: B
Conceptual Explanation: In a Jenkins Shared Library, the ‘/vars’ directory is used for
scripts that define global variables and custom steps that can be invoked directly in a
Pipeline.
3. Which annotation is used in a Jenkins Shared Library to prevent a method from being
transformed by the Pipeline’s CPS (Continuation Passing Style) transformation?
A. @IgnoreCPS
B. @NonCPS
C. @StaticGroovy
D. @PipelineSkip
Answer: B
Conceptual Explanation: The @NonCPS annotation is used for methods that perform
operations not supported by Pipeline serialization, such as complex loops or using certain
non-serializable Groovy features.
4. In a Jenkins Master/Agent architecture, what is the primary benefit of ‘Distributed Builds’?
A. To ensure that the Jenkins Master has enough disk space for logs.
B. To allow multiple users to edit the same Pipeline simultaneously.
C. To offload build processing from the Master to dedicated Agent nodes.
, D. To automatically backup the Jenkins configuration to a remote server.
Answer: C
Conceptual Explanation: Distributed builds allow the Jenkins Master to delegate the
actual execution of build jobs to Agents, preserving Master resources for orchestration and
UI handling.
5. Which security realm allows Jenkins to delegate authentication to the underlying operating
system?
A. LDAP
B. Jenkins’ own user database
C. Delegated Identity Provider
D. Unix user/group database
Answer: D
Conceptual Explanation: The ‘Unix user/group database’ security realm allows Jenkins to
authenticate users based on the OS-level users existing on the machine where Jenkins is
running.
6. In a Declarative Pipeline, what happens if the ‘agent none’ directive is defined at the top
level?
A. The build will fail immediately.
B. Jenkins will automatically assign the build to the master node.
AND CORRECT ANSWERS LATEST
UPDATE
1. In a Declarative Pipeline, which directive is used to specify that a stage should only execute
if a certain environment variable is set to a specific value?
A. when
B. expression
C. condition
D. check
Answer: A
Conceptual Explanation: The ‘when’ directive allows the Pipeline to determine whether
the stage should be executed depending on given conditions, such as environment
variables, branch names, or custom expressions.
2. When using a Jenkins Shared Library, where should the global variables (custom steps) be
stored within the repository structure?
A. /src
B. /vars
C. /resources
,D. /lib
Answer: B
Conceptual Explanation: In a Jenkins Shared Library, the ‘/vars’ directory is used for
scripts that define global variables and custom steps that can be invoked directly in a
Pipeline.
3. Which annotation is used in a Jenkins Shared Library to prevent a method from being
transformed by the Pipeline’s CPS (Continuation Passing Style) transformation?
A. @IgnoreCPS
B. @NonCPS
C. @StaticGroovy
D. @PipelineSkip
Answer: B
Conceptual Explanation: The @NonCPS annotation is used for methods that perform
operations not supported by Pipeline serialization, such as complex loops or using certain
non-serializable Groovy features.
4. In a Jenkins Master/Agent architecture, what is the primary benefit of ‘Distributed Builds’?
A. To ensure that the Jenkins Master has enough disk space for logs.
B. To allow multiple users to edit the same Pipeline simultaneously.
C. To offload build processing from the Master to dedicated Agent nodes.
, D. To automatically backup the Jenkins configuration to a remote server.
Answer: C
Conceptual Explanation: Distributed builds allow the Jenkins Master to delegate the
actual execution of build jobs to Agents, preserving Master resources for orchestration and
UI handling.
5. Which security realm allows Jenkins to delegate authentication to the underlying operating
system?
A. LDAP
B. Jenkins’ own user database
C. Delegated Identity Provider
D. Unix user/group database
Answer: D
Conceptual Explanation: The ‘Unix user/group database’ security realm allows Jenkins to
authenticate users based on the OS-level users existing on the machine where Jenkins is
running.
6. In a Declarative Pipeline, what happens if the ‘agent none’ directive is defined at the top
level?
A. The build will fail immediately.
B. Jenkins will automatically assign the build to the master node.