CJE BENCHMARK EXAM PREP
QUESTIONS AND CORRECT ANSWERS
LATEST UPDATE
1. In Jenkins Pipeline, what is the primary purpose of the ‘Continuation Passing Style’ (CPS)
transformation?
A. To convert Declarative Pipeline syntax into Scripted Pipeline syntax for execution.
B. To allow Pipelines to survive Jenkins controller restarts by serializing the execution
state.
C. To optimize the performance of Groovy scripts by compiling them into native machine
code.
D. To provide a sandbox environment for executing untrusted Groovy scripts.
Answer: B
Conceptual Explanation: CPS is a transformation performed by the Jenkins Pipeline
engine that allows the execution state to be persisted to disk, enabling long-running
pipelines to resume after a restart.
2. When developing a Jenkins Shared Library, which directory should contain the Groovy
source files for classes that are instantiated using the ‘new’ keyword?
A. src/
,B. resources/
C. vars/
D. lib/
Answer: A
Conceptual Explanation: The ‘src/’ directory in a Shared Library is added to the classpath
and should contain standard Groovy source files for helper classes and business logic.
3. In a Declarative Pipeline, which directive is used to ensure that a stage only runs when a
specific branch is being built?
A. expression
B. trigger
C. when
D. filter
Answer: C
Conceptual Explanation: The ‘when’ directive allows for conditional execution of stages
based on criteria like branch name, environment variables, or custom expressions.
4. Which mechanism does Jenkins use to prevent Cross-Site Request Forgery (CSRF) attacks
when interacting with the REST API?
A. JWT Tokens
B. OAuth2 Scopes
, C. Crumbs
D. SAML Assertions
Answer: C
Conceptual Explanation: Jenkins uses a ‘Crumb’ (a security token) to protect against CSRF
attacks by ensuring requests come from authenticated and authorized users.
5. What is the effect of the ‘failFast true’ option within a ‘parallel’ block in a Declarative
Pipeline?
A. It causes all parallel branches to be aborted if any single branch fails.
B. It forces the pipeline to continue even if one branch fails, but marks the build as
unstable.
C. It speeds up the execution by skipping the initialization of build agents.
D. It automatically retries failed branches until they succeed.
Answer: A
Conceptual Explanation: The ‘failFast true’ option in a parallel block ensures that if one
branch fails, all other currently executing branches are terminated immediately to save
resources.
6. In Jenkins Distributed Architecture, how does an inbound (JNLP) agent typically initiate
communication with the controller?
A. The controller initiates an SSH connection to the agent’s fixed IP address.
QUESTIONS AND CORRECT ANSWERS
LATEST UPDATE
1. In Jenkins Pipeline, what is the primary purpose of the ‘Continuation Passing Style’ (CPS)
transformation?
A. To convert Declarative Pipeline syntax into Scripted Pipeline syntax for execution.
B. To allow Pipelines to survive Jenkins controller restarts by serializing the execution
state.
C. To optimize the performance of Groovy scripts by compiling them into native machine
code.
D. To provide a sandbox environment for executing untrusted Groovy scripts.
Answer: B
Conceptual Explanation: CPS is a transformation performed by the Jenkins Pipeline
engine that allows the execution state to be persisted to disk, enabling long-running
pipelines to resume after a restart.
2. When developing a Jenkins Shared Library, which directory should contain the Groovy
source files for classes that are instantiated using the ‘new’ keyword?
A. src/
,B. resources/
C. vars/
D. lib/
Answer: A
Conceptual Explanation: The ‘src/’ directory in a Shared Library is added to the classpath
and should contain standard Groovy source files for helper classes and business logic.
3. In a Declarative Pipeline, which directive is used to ensure that a stage only runs when a
specific branch is being built?
A. expression
B. trigger
C. when
D. filter
Answer: C
Conceptual Explanation: The ‘when’ directive allows for conditional execution of stages
based on criteria like branch name, environment variables, or custom expressions.
4. Which mechanism does Jenkins use to prevent Cross-Site Request Forgery (CSRF) attacks
when interacting with the REST API?
A. JWT Tokens
B. OAuth2 Scopes
, C. Crumbs
D. SAML Assertions
Answer: C
Conceptual Explanation: Jenkins uses a ‘Crumb’ (a security token) to protect against CSRF
attacks by ensuring requests come from authenticated and authorized users.
5. What is the effect of the ‘failFast true’ option within a ‘parallel’ block in a Declarative
Pipeline?
A. It causes all parallel branches to be aborted if any single branch fails.
B. It forces the pipeline to continue even if one branch fails, but marks the build as
unstable.
C. It speeds up the execution by skipping the initialization of build agents.
D. It automatically retries failed branches until they succeed.
Answer: A
Conceptual Explanation: The ‘failFast true’ option in a parallel block ensures that if one
branch fails, all other currently executing branches are terminated immediately to save
resources.
6. In Jenkins Distributed Architecture, how does an inbound (JNLP) agent typically initiate
communication with the controller?
A. The controller initiates an SSH connection to the agent’s fixed IP address.