CI/CD interview questions

16 questions from the CI/CD Fundamentals: Pipelines, Testing and Deployment course, each with the correct answer and an explanation. Try to answer before you open the answer.

Module 1: Getting Started

1. In Continuous Delivery, what is the final step to reach production?

  1. It happens automatically, no human involved
  2. The build is discarded and rebuilt weekly
  3. A person makes a deliberate decision to release
  4. The build is discarded
Show answer

Answer: A person makes a deliberate decision to release

Continuous Delivery keeps builds always release-ready, but a human still triggers the actual release. Continuous Deployment removes that human step.

Lesson: Continuous Delivery vs Continuous Deployment

Module 2: Pipelines

2. What is the main benefit of pipeline-as-code over configuring a pipeline through a UI?

  1. It runs faster than any UI-based pipeline
  2. It removes the need for a test stage
  3. It removes the need for tests
  4. It is version-controlled, reviewable, and revertable like application code
Show answer

Answer: It is version-controlled, reviewable, and revertable like application code

The pipeline definition sits in the repo, so it's tracked, diffable, and reviewable exactly like the code it builds and deploys.

Lesson: Pipeline as Code

Module 3: GitHub Actions

3. Why pin a marketplace action to a version tag or commit SHA instead of a branch?

  1. A branch reference can change unexpectedly, altering behavior or introducing risk
  2. It makes the workflow run faster
  3. Branches cannot be used inside a workflow file
  4. Branches cannot be used in YAML
Show answer

Answer: A branch reference can change unexpectedly, altering behavior or introducing risk

A branch like main keeps moving; pinning to a tag or SHA guarantees the exact code you reviewed keeps running.

Lesson: Marketplace Actions

4. What does a build matrix do?

  1. Runs a job across several combinations in parallel
  2. Encrypts secrets
  3. Deploys to production
  4. Deletes caches
Show answer

Answer: Runs a job across several combinations in parallel

Each matrix combination becomes its own job run.

Lesson: Caching & Matrix Builds

Module 4: Automated Testing in CI

5. In a fail-fast pipeline, which should typically run first?

  1. The production deploy
  2. Fast, cheap checks like linting and unit tests
  3. Slow end-to-end integration tests
  4. The manual approval email
Show answer

Answer: Fast, cheap checks like linting and unit tests

Running the cheapest checks first surfaces most bugs quickly, before time is spent on slower stages.

Lesson: Failing Fast

Module 6: Deployment Strategies

6. Which deployment strategy needs no duplicate full-size environment?

  1. Blue-green
  2. Both require the same extra capacity
  3. Rolling deployment
  4. Canary only
Show answer

Answer: Rolling deployment

Rolling deployments replace instances gradually within the existing fleet, unlike blue-green which needs a full second environment.

Lesson: Rolling Deployments

Module 8: Artifacts

7. Why should each build artifact get an immutable version identifier?

  1. It makes the build run faster
  2. It removes the need for a registry
  3. It makes images smaller
  4. It lets you know exactly what's running and redeploy that exact build later
Show answer

Answer: It lets you know exactly what's running and redeploy that exact build later

A stable, unique identifier turns 'some build' into a traceable, reproducible artifact you can point at and redeploy.

Lesson: Build Artifacts & Registries

Module 9: Observability

8. What is continuous integration?

  1. Deploying once a year
  2. Manual testing only
  3. Merging often and verifying each change automatically
  4. Branching for months
Show answer

Answer: Merging often and verifying each change automatically

Small frequent merges reduce conflicts.

Lesson: Monitoring & Rollback

9. What separates continuous delivery from continuous deployment?

  1. Delivery has no tests
  2. Deployment skips builds
  3. They are identical
  4. A human approves the production release in delivery
Show answer

Answer: A human approves the production release in delivery

Deployment releases every passing change automatically.

Lesson: Monitoring & Rollback

10. Why build an artifact only once?

  1. So the exact tested output is what gets deployed
  2. To save disk space only
  3. To skip tests
  4. Because builds are random
Show answer

Answer: So the exact tested output is what gets deployed

Rebuilding at each stage can change the result.

Lesson: Monitoring & Rollback

11. Why pin a GitHub Action to a version tag or SHA?

  1. It runs faster
  2. A branch reference can change unexpectedly
  3. Branches are not allowed
  4. It hides logs
Show answer

Answer: A branch reference can change unexpectedly

Pinning prevents surprise or malicious updates.

Lesson: Monitoring & Rollback

12. Which checks should run first in a fail-fast pipeline?

  1. Production deploy
  2. Slow end-to-end tests
  3. Fast, cheap ones like linting and unit tests
  4. Manual sign-off
Show answer

Answer: Fast, cheap ones like linting and unit tests

Cheap failures save time and money.

Lesson: Monitoring & Rollback

13. Which strategy needs no duplicate full environment?

  1. Blue-green
  2. Both
  3. Neither
  4. Rolling deployment
Show answer

Answer: Rolling deployment

Rolling replaces instances in batches.

Lesson: Monitoring & Rollback

14. Where should CI secrets live?

  1. In the CI system's encrypted secret store
  2. In the repository code
  3. In README files
  4. In the build artifact
Show answer

Answer: In the CI system's encrypted secret store

Never commit credentials to git.

Lesson: Monitoring & Rollback

15. What should happen after a deploy?

  1. Nothing
  2. Monitor health and roll back if needed
  3. Delete logs
  4. Skip alerts
Show answer

Answer: Monitor health and roll back if needed

A deploy is done when it is confirmed healthy.

Lesson: Monitoring & Rollback

16. Which DORA metric measures stability?

  1. Change failure rate
  2. Deployment frequency
  3. Lead time for changes
  4. Number of commits
Show answer

Answer: Change failure rate

Change failure rate and time to restore measure stability.

Lesson: Measuring Delivery: DORA Metrics

← Back to the course