Back to sections

CI/CD Interview Questions & Answers

A sample of real CI/CD interview questions with full answers and explanations - practice for interviews or certification exams.

easy

1. What does CD stand for in CI/CD?

Continuous Delivery/DeploymentCorrect
Code Distribution
Container Deployment
Configuration Definition

CD covers what happens after code passes CI: Continuous Delivery/Deployment automates getting that already-tested code out to staging or production quickly, rather than being about containers, distribution, or config files.

medium

2. A team wants their full regression test suite, which takes 3 hours to run, to execute automatically every night at 2 AM against the latest code on main, without anyone needing to push a commit or click a button at that time. What should they configure?

A scheduled (cron-based) pipeline triggerCorrect
A pull request trigger
A manual/workflow_dispatch trigger
A push trigger on the main branch

Scheduled triggers, configured with a cron expression, let a pipeline run at a fixed time regardless of whether any code changed, which is exactly what's needed for a nightly regression run. A push trigger only fires when someone commits, and a manual trigger still requires a person to start it at that hour. A pull request trigger fires only when a PR is opened or updated, not on a timer.

hard

3. A team automatically publishes a new package version from a pipeline every time a pull request merges to main, using semantic versioning rules based on commit messages. A merge that removes a public function gets published as a patch version bump instead of a major one. What went wrong and why does it matter?

Patch version bumps are reserved only for security fixes, never for feature removals
The change was actually breaking but got labeled as a non-breaking patch, so downstream users who upgrade automatically will have their code break unexpectedlyCorrect
Semantic versioning rules don't apply when publishing happens automatically from a pipeline
Nothing went wrong, patch versions are allowed to include any kind of change

Removing a public function is a breaking change, since anything relying on that function will stop working, so it should have triggered a major version bump under semantic versioning rules, not a patch. Because many tools automatically pull in new patch versions, mislabeling this change means other projects could break without any warning.

easy

4. What is a pipeline in CI/CD?

A monitoring tool
A database connection
A series of automated steps for building and deploying codeCorrect
A network cable

Think of a pipeline as an assembly line for your code: it moves each change through a series of automated steps, like building it, testing it, and deploying it, so nothing skips a check on its way to release.

medium

5. A team releases a new version to just 5% of production traffic first, watches error rates and performance for an hour, and only rolls it out to everyone if things look healthy. What is this strategy called?

Big bang deployment
Canary deploymentCorrect
Rolling deployment
Blue-green deployment

A canary deployment sends a small portion of real traffic to the new version first, so problems affect only a few users and can be caught before a full rollout. Blue-green deployment instead runs two complete environments and switches all traffic at once, rather than gradually increasing a percentage.

hard

6. A pipeline's build cache stores compiled output keyed only by branch name, not by the contents of the source files. A developer merges a change that fixes a critical bug, but the deployed build still contains the bug. What's the most likely explanation?

Merging a change to a branch always skips the build stage entirely
The cache was reused because the branch name hadn't changed, even though the underlying code had, so stale compiled output got deployedCorrect
The deployment stage never reads from build caches under any circumstances
The bug fix was written in the wrong programming language

Since the cache key is based only on the branch name, the pipeline sees the same key as before and assumes the cached output is still valid, even though the source code underneath it changed. A cache key based on the content of the source files instead would correctly detect the change and force a fresh build.

easy

7. A pipeline has three independent test suites (unit tests, linting, and security scanning) that don't depend on each other's results. Currently they run one after another, taking 15 minutes total. How can the team speed this up?

Keep them sequential but move them to a faster server
Combine all three into one enormous test file
Run the three jobs in parallel since none of them depend on the others' outputCorrect
Delete two of the three test suites to save time

Since the three jobs don't rely on each other's results, they can all run at the same time instead of waiting in line, which cuts the total wait time down to roughly however long the slowest one takes. Deleting test suites would speed things up too, but at the cost of losing real safety checks.

medium

8. Which command installs dependencies in a Node.js GitHub Actions job?

npm run build
npm installCorrect
npm publish
npm start

Before your code can be built or tested, all the packages it depends on need to actually be present, and npm install is the command that reads package.json and downloads exactly those packages, which is why it's the very first step in a Node.js job.

hard

9. A pipeline blocks merges when test coverage drops below a threshold. A developer under deadline pressure adds several tests that call functions but don't check any actual outcomes, just to raise the coverage percentage. What's the real problem with this approach?

This approach genuinely improves the quality of the test suite despite appearances
Coverage goes up but the tests don't verify correct behavior, so real bugs can still slip through completely undetectedCorrect
The pipeline will automatically detect and reject these kinds of tests
Coverage thresholds are only ever cosmetic and never reflect anything meaningful

Coverage only measures which lines of code got run during testing, not whether the results were actually checked, so tests that call code without asserting anything can inflate the percentage while adding no real protection. The team ends up with a false sense of safety, since the coverage gate looks satisfied even though bugs could still pass through unnoticed.

easy

10. A test occasionally fails for no clear reason, then passes again when it's rerun without any code changes. What is this kind of test usually called?

A flaky testCorrect
A regression test
A unit test
A smoke test

A flaky test is one that gives inconsistent results, passing or failing seemingly at random, even though nothing in the code changed between runs. A regression test, by contrast, is simply a test meant to catch a previously fixed bug from reappearing.

Want to practice under real conditions?

Try the full timed CI/CD quiz.

    Welcome to OpsQuiz!

    Real scenario-based DevOps questions, hands-on practice, and clear explanations for every answer.