Jenkins Certified Engineer (CJE) Exam-style mock test
Jenkins Certified Engineer (CJE) Practice Exams|Practice test
Full explanations
Exam format
Pass line 65%
33 USD One-time · lifetime access
Enroll →
Sample questions
Example1 · Jenkins Fundamentals & Administration
At the B2B SaaS company Nimbus, an administrator wants to back up everything needed to fully restore a Jenkins controller after a disk failure, including job configurations, build history, plugins, and credentials. Which location contains all of this persisted controller state?
✓The JENKINS_HOME directory, which stores job configs, build records, plugins, and system configuration
Correct. JENKINS_HOME is the root directory where Jenkins persists all controller state including jobs/, plugins/, users/, secrets/, and config.xml, so backing it up captures a restorable snapshot.
・The workspace directory on each connected build agent used by the configured pipeline jobs
Incorrect. Agent workspaces hold checked-out source and intermediate build files that are recreated on demand, not the authoritative controller configuration.
・The system temp directory that Jenkins uses for transient build artifacts and caches
Incorrect. The temp directory holds transient data that is safe to discard and is not part of the durable controller state.
・The web server document root where the Jenkins WAR file and its static assets are deployed
Incorrect. The WAR deployment location holds the application binaries, not the persisted job history, credentials, or plugin set.
Explanation
JENKINS_HOME is the single directory that holds all persistent Jenkins controller data, making it the correct backup target for a full restore.
Example2 · Pipelines & Jenkinsfile (Declarative/Scripted)
A B2B SaaS team at NimbusDesk is standardizing their CI setup and wants a Jenkinsfile that most new engineers can read, validate in a linter, and extend with built-in structure for stages, agents, and post-build actions. Which pipeline syntax best fits a convention-driven, easy-to-govern approach?
・Scripted pipeline, because its Groovy-based flexibility lets each team invent its own control flow and structure freely
Incorrect. Scripted pipelines maximize flexibility but offer no enforced structure, which works against the team's standardization goal.
✓Declarative pipeline, because its predefined structure and validation support standardized, readable builds
Correct. Declarative pipelines impose a predefined, validatable structure that makes builds readable and easy to govern across teams.
・A Freestyle project, because its web form UI avoids the need for engineers to learn any pipeline syntax at all
Incorrect. Freestyle projects are not Jenkinsfile pipelines and lack the stage/post structure and version-controlled governance the team wants.
・Scripted pipeline wrapped in a shared library, because only shared libraries can enforce reusable stage structure
Incorrect. Shared libraries help reuse, but structure can be enforced in Declarative directly; this overstates that only Scripted libraries can do so.
Explanation
Declarative syntax provides a fixed, lintable structure (pipeline, agent, stages, post) that suits standardized, readable builds, whereas Scripted trades structure for programmatic flexibility.
Example3 · Build, Test & Integration
At a B2B SaaS company, developers push to the shared Git repository many times per hour, but the pipeline job only runs when someone clicks Build Now. The team wants every push to the main branch to start a build without any manual action. Which approach should the Jenkins administrator configure?
・Enable the Poll SCM trigger and set it to the busiest working hours only, so builds queue overnight and run in a single batch the following morning
Incorrect. Restricting Poll SCM to certain hours and batching builds overnight delays feedback and does not build on each push as required.
✓Configure a webhook from the Git server to Jenkins so that each push event notifies Jenkins and triggers the job immediately
Correct. A webhook sends a push event from the Git server to Jenkins, triggering the job immediately after every commit without manual action.
・Turn on the Build periodically trigger with a cron expression of H/5 * * * * to approximate commits
Incorrect. Build periodically runs on a fixed schedule regardless of whether code changed, so it wastes builds and still misses true per-commit triggering.
・Ask every developer to manually trigger the job after each push using a shared checklist stored in the team wiki
Incorrect. Relying on developers to click Build Now keeps the process manual and unreliable, which is exactly the problem being solved.
Explanation
A webhook pushes the commit event to Jenkins, giving immediate per-commit builds; polling and periodic schedules are indirect and delayed, and manual triggering is not automation.
Example4 · Distributed Builds, Agents & Plugins
A healthcare services firm runs Jenkins inside a locked-down subnet where the controller cannot open outbound connections to build machines in the clinical data zone. The platform team needs those machines to join as agents. Which approach fits this network constraint?
・Use SSH agents so the controller initiates the connection outbound to each clinical build machine over port 22
Incorrect. SSH agents require the controller to open an outbound connection to the machine, which is exactly what this subnet blocks.
✓Use inbound agents that start the agent process on the machine and have it dial back to the controller's TCP port
Correct. Inbound (JNLP) agents launch locally and connect back to the controller's agent port, suiting networks where the controller cannot initiate connections.
・Configure a cloud plugin to spin up ephemeral agents on demand whenever a pipeline requests a labeled executor
Incorrect. A cloud plugin provisions ephemeral nodes but still relies on a connection method; it does not itself solve the inbound-only constraint.
・Attach the machines as a single shared node and let the controller push the agent binary to each one automatically
Incorrect. There is no mechanism for the controller to push an agent binary to a passive node in a blocked-outbound setup.
Explanation
Inbound agents are the correct pattern when the controller cannot reach out to the machine; the agent starts locally and connects back to the controller.
Example5 · Security, Credentials & Best Practices
At a healthcare services firm, a pipeline must authenticate to an internal patient-records API using a username and password. A security reviewer insists the secret never appear as plain text in the Jenkinsfile or in the build log. How should the engineer configure the credential reference in a declarative pipeline?
✓Store a Username with password credential and read it in the pipeline using the credentials() helper to bind it as an environment variable
Correct. A Username with password credential bound via the credentials() helper injects the value as a masked environment variable so it is never written as plain text in the Jenkinsfile or exposed in logs.
・Store the username and password directly as two environment variables declared at the top of the Jenkinsfile and commit them
Incorrect. Declaring secrets directly as environment variables and committing them places the plain-text secret into source control, which is exactly what the reviewer prohibits.
・Store a Secret file credential containing the password and echo its contents into a variable during the build step
Incorrect. A Secret file is intended for file-based secrets, and echoing its contents into a variable risks printing the secret into the build log.
・Store the password as a Jenkins global property under Manage Jenkins and reference it by name inside the sh block
Incorrect. Global properties are not encrypted credential storage and are visible in configuration, so they do not protect the secret from exposure.
Explanation
The Credentials system with the credentials() binding keeps secrets encrypted at rest and masks them in logs, satisfying the requirement that the value never appear in plain text.
Example6 · Jenkins Fundamentals & Administration
A healthcare services firm installs a fresh Jenkins controller to build its patient-portal application. On first startup the browser shows an 'Unlock Jenkins' screen asking for an initial administrator password. Where should the administrator retrieve this one-time password?
・From the Jenkins global security configuration page under the realm settings in Manage Jenkins
Incorrect. The global security page is only reachable after the setup wizard is completed, so it cannot provide the unlock password required to get past the initial screen.
✓From the initialAdminPassword file written by Jenkins into its home directory during startup
Correct. Jenkins writes the generated one-time secret to secrets/initialAdminPassword inside JENKINS_HOME and also prints it to the startup log for the administrator to copy.
・From the welcome email that the Jenkins installer dispatches to the configured SMTP address
Incorrect. Jenkins has no mail server configured on a fresh install, so no welcome email containing the unlock password is ever sent to an SMTP address.
・From the output of the jenkins-cli who-am-i command executed against the controller URL
Incorrect. The CLI requires an authenticated session that does not yet exist before the wizard runs, so who-am-i cannot surface the initial unlock secret.
Explanation
The initial unlock password is stored in secrets/initialAdminPassword under JENKINS_HOME and echoed to the console log on first boot.
Example7 · Jenkins Fundamentals & Administration
At the retailer UrbanThread, the platform team is explaining the Jenkins controller's role to new hires during onboarding. Which statement best describes the primary responsibility of the Jenkins controller in a standard distributed build setup?
・It compiles application source code locally and then streams the resulting build artifacts directly to each connected build agent for packaging.
Incorrect. The controller does not compile code centrally and stream artifacts to agents; agents perform the actual build work in their own workspaces.
✓It schedules jobs, dispatches builds to agents, and serves the web UI while delegating the actual build execution to agents.
Correct. The controller orchestrates scheduling, dispatches work to agents, and serves the UI, while build execution happens on agents.
・It stores every build log inside a relational database cluster and prohibits any pipeline from running on the controller node itself.
Incorrect. Jenkins stores build data on the filesystem under JENKINS_HOME by default, not in a mandatory relational database cluster.
・It runs all pipeline stages on its own node and uses agents only as passive mirrors of the controller's local workspace.
Incorrect. In a distributed setup execution is delegated to agents; agents are not passive mirrors of the controller workspace.
Explanation
The controller is the orchestration brain: it schedules jobs, dispatches builds to agents, and serves the web UI, while agents carry out the actual build execution.
Example8 · Jenkins Fundamentals & Administration
UrbanThread's administrator wants a reliable backup strategy so the Jenkins instance can be restored after a disk failure. Which approach captures the configuration, job definitions, and credentials needed to rebuild the instance?
・Export only the global tool configuration page as XML and store that single file in the company's version control repository.
Incorrect. The tool configuration page alone omits job definitions, credentials, and most global settings needed to restore the instance.
・Copy the console output of the three most recent builds for each job and archive those text logs to cloud storage nightly.
Incorrect. Archiving recent console logs preserves build output but not the configuration, jobs, or secrets required to rebuild Jenkins.
✓Back up the entire JENKINS_HOME directory, which holds global config, job definitions, plugins, and secrets.
Correct. JENKINS_HOME contains global configuration, job definitions, plugins, and encrypted secrets, so backing it up enables a full restore.
・Reinstall Jenkins from the package manager and rely on the plugins re-downloading their previous settings automatically.
Incorrect. Reinstalling Jenkins does not recover prior settings; plugins do not automatically restore their previous configuration.
Explanation
Nearly all Jenkins state lives under JENKINS_HOME, so backing up that directory captures config, jobs, plugins, and secrets for a complete restore.
Example9 · Jenkins Fundamentals & Administration
UrbanThread has several heavyweight nightly reporting jobs that must not run on the controller for stability reasons. The administrator wants those jobs to run only on dedicated agents. How should the administrator configure this most appropriately?
・Set the controller's number of executors to a high value so the nightly jobs always have spare capacity to run there.
Incorrect. Raising controller executors encourages jobs to run on the controller, which is the opposite of the stated goal.
✓Assign labels to the dedicated agents and restrict the reporting jobs to run only on nodes matching those labels.
Correct. Labeling the dedicated agents and restricting the jobs to those labels pins execution to the intended nodes.
・Delete the controller node from the node list so that Jenkins is forced to schedule the jobs onto the remaining agents.
Incorrect. The controller node cannot simply be deleted, and doing so does not provide label-based targeting of jobs.
・Increase each reporting job's quiet period until the controller has finished all other work for the evening window.
Incorrect. The quiet period only delays build start; it does not control which node executes the job.
Explanation
Labels plus a per-job node restriction are the standard mechanism to pin specific jobs to specific agents and keep heavy work off the controller.
Example10 · Jenkins Fundamentals & Administration
At a financial services firm, a platform engineer installs a fresh Jenkins controller on a hardened server and opens the web UI for the first time. Jenkins prompts for an initial administrator password before any other setup can proceed. Where is this one-time unlock password located by default?
・It is emailed to the account configured in the installer and must be retrieved from that inbox
Incorrect. Jenkins does not send the initial unlock password by email; no mail server is configured yet at this stage of a fresh install.
✓It is written to a file under the Jenkins home directory named initialAdminPassword that must be read on the server
Correct. The setup wizard writes a randomly generated unlock secret to secrets/initialAdminPassword in the Jenkins home directory, and the admin reads that file on the server.
・It is printed only to the browser console log and should be copied directly from there
Incorrect. The password is not emitted to the browser console; it is stored on the server filesystem and (optionally) echoed in the controller's startup log.
・It is set to the OS root password automatically during the package installation step
Incorrect. Jenkins generates its own random secret and never reuses the operating system root password for the initial unlock step.
Explanation
A fresh Jenkins install generates a random admin unlock secret and writes it to secrets/initialAdminPassword under JENKINS_HOME, which the administrator reads to complete the setup wizard.
Example11 · Jenkins Fundamentals & Administration
A bank's DevOps team wants a disaster-recovery plan that lets them rebuild their Jenkins controller on new hardware with all jobs, build history, credentials, and plugin configuration intact. Which approach captures everything needed to restore the controller's state?
・Export the job list from the dashboard UI and re-run the setup wizard on the new machine afterward
Incorrect. Exporting a job list and re-running the wizard loses build history, credentials, and most configuration that lives on disk.
・Reinstall the same plugins and manually recreate each pipeline job from the team's documentation
Incorrect. Manually recreating jobs is error-prone and still omits build history, stored credentials, and system settings.
✓Back up the entire JENKINS_HOME directory, since it holds configuration, jobs, history, and secrets
Correct. JENKINS_HOME contains all controller configuration, job definitions, build records, plugins, and encrypted secrets, so backing it up fully captures recoverable state.
・Copy only the jobs subfolder, because all other controller state is regenerated automatically on restart
Incorrect. The jobs subfolder alone omits system config, credentials, plugins, and the master key needed to decrypt secrets.
Explanation
JENKINS_HOME is the single source of truth for a controller; backing up the whole directory preserves config, jobs, history, plugins, and secrets for disaster recovery.
Example12 · Jenkins Fundamentals & Administration
A systems administrator at a wholesale auto-parts distributor needs to back up the complete Jenkins controller so a new machine can be restored to the same state. Which location holds the authoritative global config, job definitions, and build history that must be backed up?
✓The JENKINS_HOME directory, which stores global config, job folders, plugins, secrets, and build records
Correct. JENKINS_HOME is the single root directory holding config.xml, per-job directories, plugins, secrets, and build history, so it is the authoritative backup target.
・The /var/log/jenkins directory, which stores rotated controller logs and queued build output
Incorrect. The log directory holds diagnostic output only and does not contain job definitions or global configuration needed to restore state.
・The war file bundled inside the Jenkins distribution archive on the host
Incorrect. The war file is the application binary and carries no instance-specific configuration, jobs, or build data.
・The browser cache of each administrator who has opened the Jenkins dashboard recently
Incorrect. The browser cache is client-side and holds no server-side configuration or build records at all.
Explanation
All Jenkins state that must be restored lives under JENKINS_HOME, making it the correct backup location.
Example13 · Jenkins Fundamentals & Administration
At a manufacturing distributor, the Jenkins controller is becoming overloaded because builds run directly on it. An engineer proposes adding agents. In a healthy distributed setup, what is the controller primarily responsible for?
・Compiling the application source and packaging the deployable artifacts for every pipeline
Incorrect. Compiling and packaging are execution tasks that should be offloaded to agents, not performed by the controller.
✓Scheduling builds, dispatching work to agents, and serving the web UI and configuration
Correct. The controller orchestrates: it schedules jobs, distributes work to agents, stores configuration, and serves the web interface.
・Running the containerized integration tests that exercise the warehouse inventory service
Incorrect. Running integration tests is build execution work meant for agents, keeping the controller free to orchestrate.
・Executing the heavy load-and-performance suites against the staging environment nightly
Incorrect. Heavy performance suites are resource-intensive execution workloads that belong on dedicated agents, not the controller.
Explanation
The controller orchestrates and serves the UI while agents perform the actual build execution, keeping the controller responsive.
Example14 · Jenkins Fundamentals & Administration
A telecom operator runs Jenkins to build firmware for its 5G base stations. The platform team wants the Jenkins controller to coordinate jobs but never execute heavy firmware compilation itself. Which configuration best achieves this separation of responsibilities?
✓Set the number of executors on the built-in node to zero and route all firmware builds to dedicated labeled agents
Correct. Setting built-in node executors to zero prevents the controller from running builds, while labeled agents carry out the firmware compilation workload.
・Install the firmware toolchain directly on the controller and raise the controller executor count to handle every parallel build request
Incorrect. Installing toolchains and running builds on the controller overloads it and defeats the goal of keeping the controller purely for coordination.
・Disable the built-in node entirely so that the controller stops serving the web UI and delegates scheduling to agents
Incorrect. Disabling the built-in node does not stop the web UI, which the controller always serves, and scheduling always stays on the controller.
・Configure every pipeline to run inside the controller JVM while agents are reserved only for archiving build artifacts afterward
Incorrect. Running pipelines inside the controller JVM is exactly the heavy work the team wants to avoid placing on the controller.
Explanation
The controller orchestrates and schedules; setting its executors to zero and using labeled agents keeps compute off the controller without affecting the web UI it always hosts.
Example15 · Jenkins Fundamentals & Administration
A telecom operator has agents labeled 'linux', 'gpu', and 'hsm-signing' for signing firmware with a hardware security module. A pipeline stage must run only on an agent that has both GPU acceleration and HSM access. How should the team express the agent requirement for that stage?
✓Use an agent label expression combining both capabilities, such as 'gpu && hsm-signing', so only agents carrying both labels are selected
Correct. A label expression with '&&' requires an agent that carries both labels, correctly targeting nodes with GPU and HSM capability.
・Assign the stage to the first available agent and rely on the pipeline to fail fast if the chosen agent lacks GPU or HSM support
Incorrect. Grabbing any available agent and failing afterward wastes build capacity and does not guarantee the required capabilities up front.
・Create one new agent labeled 'gpu-hsm' and hardcode that single node name into the stage so scheduling never considers other nodes
Incorrect. Hardcoding a single node name removes redundancy and breaks if that node is offline, which label expressions are designed to avoid.
・List the two labels separated by a space in the agent directive, which Jenkins interprets as requiring either the gpu label or the hsm-signing label
Incorrect. Space-separated labels are treated as an OR condition, so this would match agents having only one of the two capabilities.
Explanation
Label expressions using '&&' require all listed capabilities; spaces imply OR, so combining labels with '&&' correctly targets GPU plus HSM agents.
▶ Try 10 free questions (graded)