1What does the abbreviation CI stand for in DevOps?
CI fundamentals and benefits
Easy
A.Continuous Integration
B.Continuous Isolation
C.Central Infrastructure
D.Code Inspection
Correct Answer: Continuous Integration
Explanation:
CI stands for Continuous Integration, the practice of frequently merging code changes into a shared repository.
Incorrect! Try again.
2Which of the following is a key benefit of Continuous Integration?
CI fundamentals and benefits
Easy
A.Manual code merging only
B.Elimination of all testing
C.Early detection of integration bugs
D.Slower release cycles
Correct Answer: Early detection of integration bugs
Explanation:
By integrating frequently and running automated builds/tests, CI helps detect integration problems early when they are cheaper to fix.
Incorrect! Try again.
3In CI, how often are developers encouraged to integrate their code into the main branch?
CI fundamentals and benefits
Easy
A.Frequently, often several times a day
B.Only once per release
C.Only at project completion
D.Once a month
Correct Answer: Frequently, often several times a day
Explanation:
CI encourages small, frequent integrations so conflicts and errors surface quickly rather than accumulating.
Incorrect! Try again.
4What typically triggers a CI pipeline to start running?
CI Pipeline Architecture
Easy
A.A user logging out
B.A code commit or push to the repository
C.A server reboot
D.A monthly calendar event only
Correct Answer: A code commit or push to the repository
Explanation:
CI pipelines are commonly triggered automatically by commits, pushes, or pull requests to the version control repository.
Incorrect! Try again.
5Which of the following is a common stage found in a CI pipeline?
CI Pipeline Architecture
Easy
A.Marketing
B.Build
C.Payroll
D.Recruitment
Correct Answer: Build
Explanation:
A typical CI pipeline includes stages such as build, test, and package. Build compiles the source code.
Incorrect! Try again.
6In a CI pipeline, what is an artifact?
CI Pipeline Architecture
Easy
A.A database backup schedule
B.A hardware server component
C.The output produced by a build, such as a JAR or binary
D.A type of network protocol
Correct Answer: The output produced by a build, such as a JAR or binary
Explanation:
An artifact is a deployable output generated by the build process, for example a JAR, WAR, or executable file.
Incorrect! Try again.
7Which of the following CI tools is an open-source automation server written primarily in Java?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Easy
A.CircleCI
B.Jenkins
C.GitLab CI
D.GitHub Actions
Correct Answer: Jenkins
Explanation:
Jenkins is a widely used open-source automation server, written in Java, used for building and automating CI/CD pipelines.
Incorrect! Try again.
8Which CI/CD tool is built directly into the GitHub platform?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Easy
A.CircleCI
B.GitHub Actions
C.Bamboo
D.Jenkins
Correct Answer: GitHub Actions
Explanation:
GitHub Actions is GitHub's native CI/CD feature, allowing workflows to run directly within GitHub repositories.
Incorrect! Try again.
9What file format is commonly used to define GitHub Actions workflows?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Easy
A.DOCX
B.PDF
C.YAML
D.XLSX
Correct Answer: YAML
Explanation:
GitHub Actions workflows are defined using YAML files stored in the .github/workflows directory.
Incorrect! Try again.
10Which configuration file is used to define pipelines in GitLab CI?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Easy
A.package.json
B.Jenkinsfile
C..gitlab-ci.yml
D.pom.xml
Correct Answer: .gitlab-ci.yml
Explanation:
GitLab CI reads pipeline definitions from a file named .gitlab-ci.yml placed in the root of the repository.
Incorrect! Try again.
11Which build tool uses a file named pom.xml for its configuration?
Build Tools Overview: Maven, Gradle, npm
Easy
A.CircleCI
B.Maven
C.Gradle
D.npm
Correct Answer: Maven
Explanation:
Maven uses the Project Object Model file, pom.xml, to define project dependencies, plugins, and build settings.
Incorrect! Try again.
12Which build tool is most commonly associated with JavaScript/Node.js projects?
Build Tools Overview: Maven, Gradle, npm
Easy
A.npm
B.Gradle
C.Ant
D.Maven
Correct Answer: npm
Explanation:
npm (Node Package Manager) is the standard package manager and build tool for JavaScript and Node.js projects.
Incorrect! Try again.
13Which build tool uses a Groovy or Kotlin based DSL in files like build.gradle?
Build Tools Overview: Maven, Gradle, npm
Easy
A.npm
B.Maven
C.Make
D.Gradle
Correct Answer: Gradle
Explanation:
Gradle uses a Groovy or Kotlin domain-specific language, typically written in build.gradle or build.gradle.kts files.
Incorrect! Try again.
14Which file stores project dependencies for an npm project?
Build Tools Overview: Maven, Gradle, npm
Easy
A.Jenkinsfile
B.pom.xml
C.package.json
D.build.gradle
Correct Answer: package.json
Explanation:
The package.json file lists an npm project's metadata, scripts, and dependencies.
Incorrect! Try again.
15What is the name of the file used to define a Jenkins pipeline as code?
Writing Jenkins Declarative Pipelines
Easy
A.build.yml
B.pipeline.txt
C.Jenkinsfile
D.config.xml
Correct Answer: Jenkinsfile
Explanation:
Jenkins pipelines are defined as code in a file named Jenkinsfile, usually stored in the project repository.
Incorrect! Try again.
16In a Jenkins declarative pipeline, which block contains all the stages?
Writing Jenkins Declarative Pipelines
Easy
A.pipeline
B.routine
C.workflow
D.process
Correct Answer: pipeline
Explanation:
A declarative Jenkins pipeline starts with the pipeline { } block, which contains sections like agent and stages.
Incorrect! Try again.
17In a Jenkins declarative pipeline, what does the agent directive specify?
Writing Jenkins Declarative Pipelines
Easy
A.The Git commit message
B.The color of the console output
C.Where the pipeline or stage will execute
D.The name of the developer
Correct Answer: Where the pipeline or stage will execute
Explanation:
The agent directive tells Jenkins which node or environment should run the pipeline or a particular stage.
Incorrect! Try again.
18What is the main goal of an automated build?
Automated Builds
Easy
A.To compile and package code without manual steps
B.To hire new developers
C.To design UI mockups
D.To manually write documentation
Correct Answer: To compile and package code without manual steps
Explanation:
Automated builds compile source code, resolve dependencies, and produce artifacts automatically, reducing human error.
Incorrect! Try again.
19Why is automated testing important in a CI pipeline?
Automated Testing
Easy
A.It replaces version control
B.It quickly verifies code changes without manual effort
C.It slows down the release process
D.It removes the need for source code
Correct Answer: It quickly verifies code changes without manual effort
Explanation:
Automated tests run consistently and quickly on every change, giving fast feedback on whether code still works correctly.
Incorrect! Try again.
20What does code coverage measure?
Test Automation Basics (Unit Testing, Coverage)
Easy
A.The percentage of code executed by tests
B.The speed of the CPU
C.The size of the repository in MB
D.The total number of code files
Correct Answer: The percentage of code executed by tests
Explanation:
Code coverage indicates how much of the source code is exercised by automated tests, expressed as a percentage.
Incorrect! Try again.
21A team merges code into the shared main branch only once every two weeks, resulting in painful merge conflicts. Which core Continuous Integration principle would most directly address this problem?
CI fundamentals and benefits
Medium
A.Assigning a dedicated integration engineer to merge branches at the end of each sprint
B.Delaying integration until a full QA cycle is completed to reduce build server load
C.Using longer-lived feature branches so developers can work in isolation without interruption
D.Integrating code changes frequently, ideally multiple times per day, into the shared mainline
Correct Answer: Integrating code changes frequently, ideally multiple times per day, into the shared mainline
Explanation:
CI's defining practice is frequent integration into the mainline. Small, frequent merges keep divergence low and drastically reduce the size and pain of merge conflicts.
Incorrect! Try again.
22Which outcome is the least likely direct benefit of adopting Continuous Integration?
CI fundamentals and benefits
Medium
A.Reduced integration risk near release time
B.Faster detection of integration bugs
C.Consistent, repeatable build results
D.Automatic deployment of every commit to production users
Correct Answer: Automatic deployment of every commit to production users
Explanation:
Automatic deployment to production is Continuous Deployment, a separate practice. CI focuses on integrating and validating code, not releasing it to end users.
Incorrect! Try again.
23In a typical CI pipeline, what event most commonly acts as the trigger that starts a pipeline run?
CI Pipeline Architecture
Medium
A.A scheduled nightly reboot of the application server
B.A change in the production monitoring dashboard
C.A manual approval from the product owner
D.A push or pull request to the version control repository
Correct Answer: A push or pull request to the version control repository
Explanation:
CI pipelines are event-driven and are most commonly triggered by commits/pushes or pull requests, so code is validated as soon as it changes.
Incorrect! Try again.
24A pipeline is arranged so that if the compile/build stage fails, no later stages run. What is the primary reason for this fail-fast ordering?
CI Pipeline Architecture
Medium
A.Running tests on code that does not compile wastes resources and gives no useful signal
B.The version control system locks the repository until the build passes
C.Later stages always require manual approval before they can start
D.Test stages consume more memory than build stages and must be avoided
Correct Answer: Running tests on code that does not compile wastes resources and gives no useful signal
Explanation:
Fail-fast pipelines stop early when a foundational stage fails. There is no point testing artifacts that never built, so stopping saves time and compute.
Incorrect! Try again.
25Which statement correctly distinguishes GitHub Actions from a self-hosted Jenkins server in a default setup?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Medium
A.GitHub Actions cannot integrate with GitHub repositories, while Jenkins can
B.GitHub Actions requires a dedicated master node and agents, while Jenkins is fully serverless by default
C.GitHub Actions uses Groovy pipelines, while Jenkins uses YAML workflows
D.GitHub Actions runs on cloud-hosted runners managed by GitHub, while Jenkins is typically installed and maintained on your own infrastructure
Correct Answer: GitHub Actions runs on cloud-hosted runners managed by GitHub, while Jenkins is typically installed and maintained on your own infrastructure
Explanation:
GitHub Actions offers managed cloud runners out of the box, while Jenkins is traditionally self-hosted. Note Jenkins uses Groovy pipelines and Actions uses YAML—the reverse of one distractor.
Incorrect! Try again.
26In GitLab CI, which file located at the repository root defines the pipeline configuration?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Medium
A.Jenkinsfile
B.circle.yml
C..github/workflows/main.yml
D..gitlab-ci.yml
Correct Answer: .gitlab-ci.yml
Explanation:
GitLab CI reads its pipeline definition from .gitlab-ci.yml. The others belong to Jenkins, older CircleCI, and GitHub Actions respectively.
Incorrect! Try again.
27A team wants to run each job of their CI pipeline inside a fresh, isolated container image they specify. Which CI tool is especially known for making per-job Docker containers a first-class, native concept via a docker executor?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Medium
A.Apache Ant
B.GNU Make
C.A traditional freestyle Jenkins job with no plugins
D.CircleCI
Correct Answer: CircleCI
Explanation:
CircleCI natively supports specifying a Docker image executor per job, running each job in an isolated container. Make and Ant are build tools, not CI orchestrators.
Incorrect! Try again.
28A Java project uses Maven. Which command compiles the code, runs tests, and packages the result into a JAR/WAR without installing it to the local repository?
Build Tools Overview: Maven, Gradle, npm
Medium
A.mvn deploy
B.mvn clean
C.mvn install
D.mvn package
Correct Answer: mvn package
Explanation:
mvn package runs through compile and test and produces the packaged artifact in target/. install also copies it to the local repo, and deploy pushes to a remote repo.
Incorrect! Try again.
29What is the primary functional advantage of Gradle's incremental build support compared to a naive full rebuild every time?
Build Tools Overview: Maven, Gradle, npm
Medium
A.It re-executes only the tasks whose inputs or outputs have changed, reducing build time
B.It removes the need for any dependency declarations in the build script
C.It automatically deploys artifacts to production after every build
D.It converts all Java source files into Python before compiling
Correct Answer: It re-executes only the tasks whose inputs or outputs have changed, reducing build time
Explanation:
Gradle tracks task inputs and outputs and skips up-to-date tasks, so only affected work is re-run. This incremental behavior significantly speeds up repeated builds.
Incorrect! Try again.
30In a Node.js project, which file records the exact resolved version of every installed dependency to ensure reproducible installs across machines?
Build Tools Overview: Maven, Gradle, npm
Medium
A.package-lock.json
B.package.json
C.node_modules.json
D.npmrc.json
Correct Answer: package-lock.json
Explanation:
package.json declares version ranges, but package-lock.json pins the exact resolved versions of the full dependency tree, making installs reproducible.
Incorrect! Try again.
31Which pair correctly matches a build tool with the ecosystem it is most commonly used in?
Maven is a Java build/dependency tool, while npm is the package manager for the JavaScript/Node.js ecosystem. The other pairings mismatch the tools and ecosystems.
Incorrect! Try again.
32In a Jenkins Declarative Pipeline, which block is required at the top level to specify where the pipeline will execute?
Writing Jenkins Declarative Pipelines
Medium
A.triggers
B.post
C.environment
D.agent
Correct Answer: agent
Explanation:
A Declarative Pipeline must include an agent directive at the top level, defining where (which node/executor) the pipeline or stage runs.
Incorrect! Try again.
33Consider this Jenkins snippet:
groovy
post {
always {
echo 'Cleaning up'
}
}
When does the always block execute?
Writing Jenkins Declarative Pipelines
Medium
A.Only when at least one stage fails
B.Before any stage begins, as a setup step
C.After the stages complete, regardless of whether the build succeeded or failed
D.Only when every stage succeeds
Correct Answer: After the stages complete, regardless of whether the build succeeded or failed
Explanation:
In the post section, the always condition runs after the pipeline finishes no matter the result—useful for cleanup and notifications.
Incorrect! Try again.
34In a Declarative Pipeline, where must individual stage blocks be placed?
Writing Jenkins Declarative Pipelines
Medium
A.Inside a stages block
B.Inside the agent block
C.Inside the environment block
D.Inside the parameters block
Correct Answer: Inside a stages block
Explanation:
Declarative Pipelines group all stage definitions inside a single stages block, which holds the ordered sequence of work.
Incorrect! Try again.
35A pipeline author wants a variable available as an environment variable to every step in all stages of the build. Which directive should be used at the top level of the Declarative Pipeline?
Writing Jenkins Declarative Pipelines
Medium
A.environment
B.steps
C.input
D.options
Correct Answer: environment
Explanation:
A top-level environment block defines environment variables that apply to all stages and their steps. Placed inside a stage, it would be scoped to that stage only.
Incorrect! Try again.
36Which practice best characterizes an automated build in a CI context?
Automated Builds
Medium
A.Each engineer builds only on their own laptop using a locally customized, undocumented set of steps
B.A single command or trigger compiles the code, resolves dependencies, and produces artifacts without manual steps
C.The QA team assembles the release by hand at the end of each release cycle for accuracy
D.A developer manually copies compiled files to a shared drive after each change and emails the team
Correct Answer: A single command or trigger compiles the code, resolves dependencies, and produces artifacts without manual steps
Explanation:
Automated builds are reproducible and hands-off: one trigger performs compilation, dependency resolution, and artifact creation, eliminating manual, error-prone steps.
Incorrect! Try again.
37Why is producing a versioned, immutable build artifact (e.g., a specific JAR) important in a CI/CD workflow?
Automated Builds
Medium
A.It guarantees the application will never contain any bugs
B.It allows the source code to be deleted immediately after the build
C.The same tested artifact can be promoted through environments, ensuring what was tested is what gets deployed
D.It forces developers to recompile the code separately for every environment
Correct Answer: The same tested artifact can be promoted through environments, ensuring what was tested is what gets deployed
Explanation:
Build-once, deploy-many relies on immutable artifacts. Promoting the identical artifact through environments guarantees the deployed build matches the tested build.
Incorrect! Try again.
38A CI pipeline runs unit tests automatically on every push. A commit introduces code that breaks a test. What is the most valuable immediate benefit of this automation?
Automated Testing
Medium
A.The failing test is permanently deleted so the pipeline can proceed
B.The broken code is automatically rewritten to pass the test
C.All future commits are blocked until the next scheduled nightly run
D.The regression is detected right after the commit that caused it, making it easy to locate and fix
Correct Answer: The regression is detected right after the commit that caused it, making it easy to locate and fix
Explanation:
Automated testing on each push gives fast feedback, tying a failure to the specific change that caused it, which greatly simplifies debugging.
Incorrect! Try again.
39Which ordering of test types generally reflects a healthy test pyramid, from most to fewest tests?
B.End-to-end tests → integration tests → unit tests
C.Integration tests → unit tests → end-to-end tests
D.End-to-end tests → unit tests → integration tests
Correct Answer: Unit tests → integration tests → end-to-end tests
Explanation:
The test pyramid favors many fast, cheap unit tests at the base, fewer integration tests in the middle, and the fewest slow end-to-end tests at the top.
Incorrect! Try again.
40A test suite reports 85% line coverage. What does this figure specifically indicate?
Test Automation Basics (Unit Testing, Coverage)
Medium
A.85% of the requirements have been formally documented
B.85% of the executable lines of code were run at least once during the tests
C.85% of all known bugs in the software have been fixed
D.The software is guaranteed to be 85% free of defects
Correct Answer: 85% of the executable lines of code were run at least once during the tests
Explanation:
Line coverage measures the proportion of executable lines executed during testing. High coverage does not by itself prove correctness or absence of bugs.
Incorrect! Try again.
41A team practices trunk-based development with CI, but developers still experience frequent 'integration hell' at release time. Investigation shows that although commits are pushed to the main branch several times daily, the CI pipeline only runs a compile step and no tests, and feature flags are absent. Which corrective action most directly restores the core CI benefit being violated?
CI fundamentals and benefits
Hard
A.Switch from trunk-based development to long-lived feature branches with weekly merges
B.Add automated test execution to every pipeline run so integration defects surface at commit time
C.Increase the frequency of merges to the main branch to more than ten times per day
D.Move the compile step to a nightly scheduled build to reduce runner load
Correct Answer: Add automated test execution to every pipeline run so integration defects surface at commit time
Explanation:
CI's core value is early detection of integration problems through automated verification. Frequent commits without automated tests provide no feedback on correctness, so defects accumulate until release. Adding automated tests to each run restores the fast-feedback benefit.
Incorrect! Try again.
42In a fan-out/fan-in CI pipeline, a build stage produces an artifact consumed by three parallel test stages (unit, integration, contract), which then converge into a single deploy stage. If the integration test stage has a flaky 20% failure rate per run and the pipeline retries only that stage up to 2 additional times, what is the approximate probability the pipeline reaches the deploy stage on a given trigger (assuming other stages always pass)?
CI Pipeline Architecture
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The stage fails only if all attempts fail. With 3 total attempts at 20% failure each, , so success . The fan-in deploy requires this stage to eventually pass.
The Test stage fails because target/app.bin does not exist. What is the root cause?
Writing Jenkins Declarative Pipelines
Hard
A.Each stage's agent runs in a separate workspace, so build artifacts are not automatically shared unless stashed/archived
B.agent none disables workspace creation entirely, so no files can be written in any stage
C.Declarative pipelines require artifacts to be declared in a parameters block to persist
D.The sh step cannot access the target directory without an explicit dir() block
Correct Answer: Each stage's agent runs in a separate workspace, so build artifacts are not automatically shared unless stashed/archived
Explanation:
With agent none and per-stage agents, stages may run on different executors/workspaces. Files from Build are not visible to Test unless passed via stash/unstash or archiveArtifacts. This is a common cross-agent workspace pitfall.
Incorrect! Try again.
44A Gradle build is slow on CI despite the code changing minimally between runs. The CI runner is ephemeral (fresh container per build). Which combination most effectively reduces build time while remaining correct?
Build Tools Overview: Maven, Gradle, npm
Hard
A.Run Gradle with --offline only, which forces reuse of previously compiled classes
B.Switch every module to api dependencies so more tasks can be parallelized
C.Enable the Gradle build cache with a shared remote cache and persist the Gradle user home across runs
D.Disable incremental compilation and always run --rerun-tasks for deterministic output
Correct Answer: Enable the Gradle build cache with a shared remote cache and persist the Gradle user home across runs
Explanation:
Ephemeral runners lose Gradle's local incremental state each build. A shared remote build cache lets task outputs be reused across ephemeral machines, and persisting the Gradle user home preserves dependency downloads—both dramatically cut time without sacrificing correctness.
Incorrect! Try again.
45A module has 100% line coverage but a production bug slips through: a function divide(a, b) throws on b == 0, which callers never handle. Why did high coverage fail to catch this, and what metric would have exposed the gap?
Test Automation Basics (Unit Testing, Coverage)
Hard
A.Line coverage does not measure untested input partitions or branches; branch/path coverage on the divisor would expose the missing case
B.Statement coverage already includes the zero-divisor path, so the tests must have been disabled
C.The bug is uncatchable by any coverage metric because exceptions are runtime-only phenomena
D.100% line coverage guarantees correctness, so the bug must be in the test runner configuration itself
Correct Answer: Line coverage does not measure untested input partitions or branches; branch/path coverage on the divisor would expose the missing case
Explanation:
Line coverage only confirms a line executed, not that all input equivalence classes or branches were exercised. The edge case was never tested. Branch/path coverage combined with boundary-value analysis would flag the unexecuted error path.
Incorrect! Try again.
46In GitHub Actions, a workflow defines two jobs: build and deploy, where deploy has needs: build. Both jobs set concurrency: production. A developer pushes two commits in quick succession. What behavior results?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Hard
A.Both runs execute fully in parallel because needs only affects ordering within a single run
B.The deploy job runs twice simultaneously since needs releases the concurrency lock after build
C.GitHub Actions rejects the second push entirely because the concurrency group is already claimed
D.The second run's jobs sharing the production concurrency group cancel or queue against the first, since concurrency groups are evaluated per matching key across runs
Correct Answer: The second run's jobs sharing the production concurrency group cancel or queue against the first, since concurrency groups are evaluated per matching key across runs
Explanation:
A concurrency group serializes across workflow runs: only one job/run per group key proceeds at a time; others queue or are cancelled (with cancel-in-progress). This prevents overlapping production deploys from concurrent pushes.
Incorrect! Try again.
47A reproducible build requirement states that building the same commit twice must yield byte-identical artifacts. A Java build currently fails this check. Which factor is the most likely culprit?
Automated Builds
Hard
A.Compiling with the same JDK version on every machine, causing hash drift
B.Running unit tests before packaging, which mutates the compiled class files
C.Using a locked dependency version file, which forces different bytes on each run
D.Embedded build timestamps and non-deterministic file ordering inside the JAR manifest/zip entries
Correct Answer: Embedded build timestamps and non-deterministic file ordering inside the JAR manifest/zip entries
Explanation:
Reproducible builds are commonly broken by embedded timestamps and unstable entry ordering in archives. Fixes include setting a fixed timestamp (e.g., SOURCE_DATE_EPOCH) and sorting zip entries. Locked dependencies and consistent JDKs actually aid reproducibility.
Incorrect! Try again.
48A pipeline uses caching to speed up dependency installation. After a security advisory, a compromised dependency version was published and later yanked. The team pins versions but still gets the compromised artifact on some CI runs. What architectural flaw explains this?
CI Pipeline Architecture
Hard
A.The cache key does not incorporate the lockfile hash, so stale cached dependencies persist despite pin changes
B.CI caches are immutable, so once populated they can never reflect pinned versions
C.The registry mirror always serves yanked packages regardless of the cache
D.Version pinning is incompatible with any form of dependency caching
Correct Answer: The cache key does not incorporate the lockfile hash, so stale cached dependencies persist despite pin changes
Explanation:
If the cache key isn't derived from the lockfile/manifest hash, changing pins won't invalidate the cache, so old (compromised) artifacts get restored. Keying the cache on the lockfile hash ensures dependency changes force a cache miss and fresh fetch.
Incorrect! Try again.
49In a Jenkins declarative pipeline, you need a stage to run only when the branch is main AND a prior stage set an environment variable DEPLOYABLE=true. Which when construct is correct?
allOf requires every nested condition to be true (logical AND). The branch and environment conditions are valid declarative when directives. anyOf is OR, and the other forms use invalid syntax.
Incorrect! Try again.
50A CI suite runs 5000 tests in 40 minutes. The team wants sub-10-minute feedback. They shard tests across 4 parallel runners by simple alphabetical file split, but one runner consistently takes 30 minutes. What is the best fix?
Automated Testing
Hard
A.Split shards using historical per-test timing data so each runner gets balanced execution time
B.Increase runners to 8 while keeping the alphabetical split unchanged
C.Run all tests on a single more powerful runner to avoid sharding overhead
D.Alphabetize the tests in reverse to redistribute the slow files
Correct Answer: Split shards using historical per-test timing data so each runner gets balanced execution time
Explanation:
Alphabetical splits ignore per-test duration, causing skew when slow tests cluster. Timing-based (test-splitting by recorded durations) balances wall-clock time across shards, achieving near-optimal parallel speedup. Just adding runners won't fix the imbalance.
Incorrect! Try again.
51During npm ci on CI, the build fails with an error that package-lock.json is out of sync with package.json. A developer suggests switching to npm install to 'auto-fix' it. Why is this the wrong fix for CI?
Build Tools Overview: Maven, Gradle, npm
Hard
A.npm install cannot run in CI environments because it requires interactive prompts
B.npm install is slower than npm ci, so it only affects performance, not correctness
C.npm install may mutate the lockfile and install differing versions, breaking reproducibility; the lockfile should be regenerated and committed locally instead
D.npm ci and npm install are identical, so switching has no effect on the failure
Correct Answer: npm install may mutate the lockfile and install differing versions, breaking reproducibility; the lockfile should be regenerated and committed locally instead
Explanation:
npm ci requires the lockfile and package.json to be in sync and installs exactly what's locked—ideal for CI reproducibility. npm install can silently update the lockfile and resolve different versions. The correct fix is to reconcile and commit the lockfile locally.
Incorrect! Try again.
52In GitLab CI, a job in the test stage must run only for merge requests targeting main, but never on scheduled pipelines. Which rules configuration achieves this correctly?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Hard
The first rule matches MR pipelines targeting main. A separate rule with when: never for scheduled pipelines guarantees exclusion. GitLab evaluates rules top-down; the explicit never guard on schedules is the reliable pattern.
Incorrect! Try again.
53A team enforces a coverage gate of 80%. A developer adds a large auto-generated file with no tests, dropping coverage below the gate. To pass, they add coverage exclusions for generated code. Later, a genuine untested handler also gets excluded by an overly broad glob. What is the key lesson about coverage gates?
Test Automation Basics (Unit Testing, Coverage)
Hard
A.Coverage gates are meaningless and should be removed from all pipelines
B.Auto-generated code must always be counted toward coverage to be safe
C.Coverage exclusions must be narrowly scoped; broad globs can mask real untested code and give false confidence
D.Coverage gates should always be set to 100% to prevent any exclusions
Correct Answer: Coverage exclusions must be narrowly scoped; broad globs can mask real untested code and give false confidence
Explanation:
Excluding generated code is legitimate, but overly broad exclusion patterns can silently drop real production code from measurement, defeating the gate's purpose. Exclusions should be precise and reviewed to avoid hiding genuine coverage gaps.
Incorrect! Try again.
54A manager claims 'we have CI because we run a nightly build and test job'. A CI expert disagrees. Which argument best explains why a nightly-only build is not true Continuous Integration?
CI fundamentals and benefits
Hard
A.CI requires integration and verification on every commit/merge to give fast feedback; nightly batching delays defect detection and reintroduces integration risk
B.CI is defined solely by the tool used, not by the frequency of integration
C.Nightly builds fail CI only if they skip the deployment stage
D.Nightly builds are CI as long as they run automated tests, regardless of frequency
Correct Answer: CI requires integration and verification on every commit/merge to give fast feedback; nightly batching delays defect detection and reintroduces integration risk
Explanation:
The defining property of CI is that each integration (commit/merge) triggers an automated build and test, so defects are caught within minutes. Nightly batching accumulates a day's changes before feedback, undermining the fast-feedback and low-integration-risk benefits.
Incorrect! Try again.
55A Maven multi-module project builds fine locally but fails on CI with 'Could not resolve dependencies for project A: artifact B not found'. Module A depends on module B, both in the same reactor. Locally, B was previously mvn installed. What is the correct CI-safe build command?
Automated Builds
Hard
A.Run mvn install on A only, since Maven auto-discovers sibling modules from the registry
B.Publish B to Maven Central first, then build A separately on CI
C.Build the whole reactor together, e.g. mvn -pl A -am install, so B is built before A in the same run
D.Delete the local .m2 repository on CI before building A
Correct Answer: Build the whole reactor together, e.g. mvn -pl A -am install, so B is built before A in the same run
Explanation:
The local build worked because B was already installed in ~/.m2. Fresh CI has no such cache. -pl A -am (also-make) builds A plus its required upstream modules (B) in one reactor run, resolving the intra-project dependency correctly.
Incorrect! Try again.
56In CircleCI, a workflow uses a context to inject shared secrets and restricts it to a security group. A contractor's job in the same workflow needs a different, non-privileged credential set. What is the correct approach to enforce least privilege?
Popular CI Tools: Jenkins, GitHub Actions, GitLab CI, CircleCI
Hard
A.Assign each job its own context so secrets are scoped per job, granting the contractor's job only the non-privileged context
B.Grant the contractor org-admin so their job can read whichever context it needs
C.Store the privileged secrets in the config YAML and gate them with an if condition
D.Put all secrets in a single project-wide context so every job shares identical access
Correct Answer: Assign each job its own context so secrets are scoped per job, granting the contractor's job only the non-privileged context
Explanation:
CircleCI contexts scope secrets and can be restricted by security groups. Per-job context assignment enforces least privilege: the contractor's job receives only its designated non-privileged context, while privileged contexts remain inaccessible to it.
Incorrect! Try again.
57A declarative pipeline must guarantee that a cleanup step runs whether the build succeeds, fails, or is aborted, and a notification runs only on failure. Which structure is correct?
Writing Jenkins Declarative Pipelines
Hard
A.Put cleanup in the last stage and notify in a catchError block only
B.Use post { success { cleanup; notify } } so both run after completion
C.Wrap all stages in a try/finally since declarative pipelines support raw Groovy control flow
D.Use post { always { cleanup } failure { notify } } at the pipeline or stage level
Correct Answer: Use post { always { cleanup } failure { notify } } at the pipeline or stage level
Explanation:
The declarative post section provides condition blocks: always runs regardless of result (ideal for cleanup), while failure runs only when the build fails (ideal for alerts). Declarative pipelines don't allow raw try/finally at the top level.
Incorrect! Try again.
58A CI pipeline reports intermittent test failures that disappear on re-run. Analysis shows two tests share a database table and run in parallel. Which statement best characterizes the problem and the most robust fix?
Automated Testing
Hard
A.The CI runner is underpowered; the fix is to allocate more CPU to eliminate the race
B.The tests are flaky due to network latency; adding a fixed sleep before assertions is the robust fix
C.Parallel execution is inherently unsafe for tests; disable all parallelism permanently
D.The tests are not isolated (shared mutable state); isolate them via per-test transactions/schemas or unique data, rather than relying on retries
Correct Answer: The tests are not isolated (shared mutable state); isolate them via per-test transactions/schemas or unique data, rather than relying on retries
Explanation:
Shared mutable state (the common table) creates order-dependent interference under parallelism—a classic test isolation defect. The robust fix is true isolation (transaction rollback, per-test schema, or unique keys), not masking with retries or sleeps.
Incorrect! Try again.
59A pipeline separates a fast 'commit stage' (compile + unit tests, target < 5 min) from a slower 'acceptance stage'. A proposal suggests moving slow end-to-end tests into the commit stage 'to catch more bugs earlier'. Why does this typically harm the pipeline?
CI Pipeline Architecture
Hard
A.End-to-end tests cannot technically execute in an early stage of any pipeline
B.It inflates commit-stage duration, destroying the fast-feedback contract and increasing the cost of every commit's verification
C.It reduces total test coverage because e2e tests overwrite unit test results
D.It forces the acceptance stage to run twice, doubling infrastructure cost only
Correct Answer: It inflates commit-stage duration, destroying the fast-feedback contract and increasing the cost of every commit's verification
Explanation:
The commit stage exists to give rapid feedback (minutes). Loading slow, broad e2e tests into it breaks that contract and slows every developer's cycle. Staged pipelines intentionally keep slow tests later so fast checks fail fast.
Incorrect! Try again.
60Comparing Maven and Gradle for a large monorepo, a team values incremental builds and task-level caching but also wants a low-magic, declarative configuration. Which trade-off statement is most accurate?
Build Tools Overview: Maven, Gradle, npm
Hard
A.Maven's convention-over-configuration makes it strictly faster than Gradle in every scenario
B.Gradle offers superior incremental/cacheable task graphs but its Groovy/Kotlin DSL is imperative and can grow complex, while Maven's XML is more declarative but less flexible for fine-grained incrementality
C.Maven provides finer task-level incremental caching than Gradle, and its XML is fully imperative
D.Gradle and Maven have identical build models, differing only in configuration file format
Correct Answer: Gradle offers superior incremental/cacheable task graphs but its Groovy/Kotlin DSL is imperative and can grow complex, while Maven's XML is more declarative but less flexible for fine-grained incrementality
Explanation:
Gradle's task-graph model enables fine-grained incremental builds and build caching, but its scripting DSL is programmatic and can become hard to reason about. Maven's XML lifecycle is more declarative and predictable but offers coarser incrementality. This captures the real trade-off.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →