Test yourself
Jenkins from scratch
Final exam · 34 questions · answers explained as you pick
Jenkins basics
8 questions
01Two developers argue about whether a nightly build counts as continuous integration. What is the strongest objection?
Correct — CI gets its value from fast feedback tied to few changes.
Incorrect — Per-push builds usually use more. Resources are not the objection.
Incorrect — Cron triggers are available without extra effort.
Incorrect — It can run whatever the pipeline defines.
02A company needs builds inside a network with no inbound internet access. Why might Jenkins fit?
Incorrect — Other CI tools support private repositories too.
Correct — You run everything yourself, on your network.
Incorrect — Self-hosting means you own that maintenance.
Incorrect — Pipelines run on agents.
03An inbound agent is listed as offline. Which side should you check first, and why?
Incorrect — Inbound agents dial the controller. This lab uses that model.
Incorrect — Agent connections do not involve the Git server.
Correct — Check its process, logs and route to the controller.
Incorrect — A job's label does not take an agent offline.
04Why is a Jenkins LTS release the usual choice for a production controller?
Incorrect — Both lines load plugins.
Incorrect — LTS lines need regular upgrades too.
Incorrect — Images exist for both lines.
Correct — The weekly line moves faster, for people who want new features early.
05An image is pinned as
jenkins/jenkins:2.580.2-lts-jdk21@sha256:.... Someone edits only the tag part to a newer version. What will Docker run?Correct — The digest wins, so a bump must re-resolve it.
Incorrect — With both present, Docker uses the digest.
Incorrect — Docker accepts the form and uses the digest.
Incorrect — Local tags are not consulted when a digest is given.
06Which change belongs in the image, and which in JCasC?
Incorrect — A JCasC reload changes a running server.
Correct — The image carries what is installed, and YAML says how it is configured.
Incorrect — JCasC does not install plugins.
Incorrect — That reverses the division used here.
07Jenkins sits behind a reverse proxy, and logins redirect to the wrong host. Which setting is the first to check?
Incorrect — Executors have nothing to do with URLs.
Incorrect — That only sets build retention.
Correct — Jenkins uses it to build its absolute links.
Incorrect — That path is where YAML is read, and it is on the controller.
08A security review asks why agent containers do not mount the Docker socket. What is the correct reason?
Incorrect — Performance is not the issue being raised.
Incorrect — Docker does not treat that image differently.
Incorrect — It holds no Jenkins credentials. It controls Docker.
Correct — Socket access is root-equivalent, so it undoes the isolation.
8 questions · explanations appear as you answer
Pipelines as code
9 questions
01What does a pipeline gain from
disableConcurrentBuilds()?Correct — A later run waits, which matters for anything with shared state.
Incorrect — It applies between runs. Parallel stages in one run still work.
Incorrect — It has no effect on which agents are used.
Incorrect — It only affects this job.
02Why might
post { always { sh 'rm -rf build' } } fail on a run where no agent was ever allocated?Incorrect — They can contain other steps when a node is available.
Correct — The cleanup must run where a node context exists, inside the stage.
Incorrect — The sandbox governs Groovy, not shell commands.
Incorrect —
post runs after the stages.03A declarative stage has both
steps and parallel. What is the outcome?Incorrect — That order isn't a feature; split it into two stages.
Incorrect — The file doesn't get as far as running.
Correct — The linter rejects it: a stage holds exactly one of
steps, stages, parallel or matrix.Incorrect — It reports an error and does not choose.
04A
booleanParam called DEPLOY is read in the shell as $DEPLOY. What must a script compare it with?Incorrect — Jenkins exports the words, not numbers.
Incorrect — False is exported as the word
false.Incorrect — All parameters are exported to the environment.
Correct — Shell variables are text. In Groovy,
params.DEPLOY is a real boolean.05A job has a
string parameter that release managers fill with a version number. What is the best improvement?Correct — Constraining the input stops most bad values at the door.
Incorrect — That accepts
v2; id -un.Incorrect — A value can be hidden and still injected.
Incorrect — The threat here is who can start a build, not who can read it.
06Which statement about
sh "..." with double quotes is true?Incorrect — That describes single quotes.
Correct — The value becomes command text, so metacharacters act as syntax.
Incorrect — The sandbox allows it, and credentials only draw a warning.
Incorrect — Quote style doesn't change where a step runs.
07Polling runs each minute across 200 jobs. What is the better design?
Incorrect — That makes the load problem worse.
Incorrect — That gives up the main benefit of CI.
Correct — Hooks reduce traffic and delay, and a slow poll catches missed events.
Incorrect — Polling is scheduled from the controller regardless.
08A hook authenticates with an API token and not a password. Which benefit is real?
Incorrect — A token acts with its user's permissions.
Incorrect — Plain HTTP exposes it. Use TLS.
Incorrect — Each token authenticates as its owner.
Correct — It also needs no crumb and can belong to a dedicated user.
09A branch is deleted from a repository used by a multibranch pipeline. After the next scan, what becomes of its job?
Correct — Jobs follow branches, subject to that retention setting.
Incorrect — There is no branch to build any more.
Incorrect — The other branches continue normally.
Incorrect — History does not transfer between branch jobs.
9 questions · explanations appear as you answer
Building real pipelines
10 questions
01A job's test report shows 200 passes today and 450 last week, and the build is green. What does this suggest?
Incorrect — Fixed tests stay in the report as passes.
Correct — A green build only reflects the tests that ran.
Incorrect — Discarding affects old builds, not this count.
Incorrect — No such limit exists.
02What does
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') around a scan do?Incorrect — It does not retry anything.
Incorrect — It does the opposite, and the build goes on.
Correct — Use it only for checks that are explicitly non-blocking.
Incorrect — The stage result shows in the UI.
03Why run
cleanWs() at the end of a build on long-lived agents?Incorrect — Archive first, because wiping removes the files.
Incorrect — The controller does not check that.
Incorrect — Workspaces are on the agent and history is on the controller.
Correct — It also removes outputs that later builds might read by mistake.
04A stash of a 3 GB directory slows every build. What is the likely reason?
Correct — Share large outputs through object storage or an artifact repository.
Incorrect — The Git server isn't involved.
Incorrect — It stores one stash per name.
Incorrect — Stashes normally last only for the run.
05A team wants customers to verify releases made by self-hosted Jenkins, with a key held in a KMS. Why is a KMS better than a Jenkins credential?
Incorrect — A signature says nothing about review.
Correct — A compromised pipeline can sign while it runs, but it can't steal the key.
Incorrect — Consumers still need the public key.
Incorrect — They still need permission to use the key.
06Why attest an SBOM rather than just publishing the file next to the release?
Incorrect — It describes contents and changes nothing.
Incorrect — They are ordinary JSON.
Correct — Consumers can check it describes this artifact and that the key holder made it.
Incorrect — It adds to the size rather than reducing it.
07Masking catches
base64 of a token but missed rev in the lab. What is the right lesson?Incorrect — Endless other transforms remain.
Incorrect — That adds nothing, as Jenkins knows that form.
Incorrect — Printing them is the problem, under any condition.
Correct — It reduces accidents, and access control handles intent.
08Where should a token be scoped when only one team's jobs need it?
Correct — Jobs elsewhere can't request it by ID.
Incorrect — IDs are not secrets, so anyone could ask for it.
Incorrect — That commits it to Git.
Incorrect — Parameters are visible on the build page.
09A library step needs extra data about the build. Which placement keeps it least privileged?
Incorrect — Convenience is the wrong reason to add controller-level code.
Correct — Add trusted code only when the sandbox truly can't do it.
Incorrect — That widens the allowlist for every job.
Incorrect — That hands builds an admin credential.
10Why does
implicit: false make a library safer to roll out?Incorrect — Global libraries remain trusted either way.
Incorrect — That is a separate setting.
Correct — Nothing changes for jobs that never declared it.
Incorrect — It doesn't cache anything.
10 questions · explanations appear as you answer
Operating Jenkins
7 questions
01A plugin you installed two years ago has an unfixed advisory, and nothing in the job list uses it. What do you do?
Incorrect — Installed plugins load into the controller, whether jobs use them or not.
Incorrect — That doesn't address a plugin flaw.
Incorrect — Plugins do not run from agents.
Correct — It can't be exploited once it's gone.
02Why test a plugin upgrade on a restored copy of production?
Correct — An empty test server would not show it.
Incorrect — Licensing has nothing to do with this.
Incorrect — Network access isn't the reason.
Incorrect — Speed isn't the benefit here.
03Someone proposes
Overall/Administer for a service account that only needs to start builds. What should it get instead?Incorrect — A leaked token still carries full control.
Correct — Least privilege limits the damage if its token leaks.
Incorrect — Then anyone could start those builds.
Incorrect — Read does not grant build rights.
04Which setup makes settings drift hardest to hide?
Incorrect — People miss things, and nothing corrects them.
Incorrect — That preserves drift rather than exposing it.
Correct — The reload corrects what it manages, and the diff exposes the rest.
Incorrect — That increases the risk of drift.
05Your backup excludes
plugins/. What must be true for a restore to work?Incorrect — Agents don't hold plugins.
Incorrect — Newest may differ from what the data expects.
Incorrect — Any volume will do.
Correct — Keep old images, or rebuild from the matching
plugins.txt.06You restore to a new host, and the old host is still running. What risk should you handle first?
Correct — Deploys and hooks could fire twice.
Incorrect — Copying doesn't expire them.
Incorrect — They don't affect one another.
Incorrect — Fingerprints don't work like that.
07A team moves to one-build agents, and builds slow down. What is the appropriate fix?
Incorrect — That brings back what disposable agents removed.
Correct — You keep clean builds and get the speed back.
Incorrect — That breaks controller isolation.
Incorrect — That gives up the point of CI.
7 questions · explanations appear as you answer