Interview questions › CI/CD & GitOps

CI/CD & GitOps interview questions & answers

100 CI/CD & GitOps interview questions, from basic to advanced. Each links to a full answer page with a concise spoken answer, a technical explanation, and a hands-on example.

Tip: paste the job description + your resume into our free resume checker to see which of these skills the role actually requires.

Basic questions

  1. What is CI/CD, and what is the difference between continuous delivery and continuous deployment?
    CI/CD is the automation discipline that moves code from commit to production safely and repeatably.
  2. What are the goals of a CI pipeline beyond just running tests?
    A CI pipeline should give fast confidence, not just run tests.
  3. What is Jenkins, and what is the difference between a controller and an agent?
    Jenkins is an automation server commonly used for CI/CD.
  4. What is the difference between a freestyle job and a pipeline job in Jenkins?
    A freestyle job is a UI-configured job with build steps and post-build actions.
  5. What is the difference between a declarative and a scripted Jenkins pipeline?
    Declarative Pipeline is a structured Jenkins syntax with blocks like pipeline, agent, stages, steps, environment, and post.
  6. What is a Jenkinsfile, and why keep your pipeline as code in the repo?
    A Jenkinsfile is the pipeline definition stored with the application code.
  7. Explain the structure of a declarative pipeline (agent, stages, steps, post).
    A Declarative Pipeline normally starts with pipeline, chooses an agent, defines environment/options/parameters when needed, then lists stages with steps.
  8. What is the post section used for, and what are its conditions (success, failure, always)?
    The post section defines actions that run after a stage or the full pipeline completes.
  9. How do you run pipeline stages in parallel, and why would you?
    I run independent stages in parallel when they do not depend on each other, for example unit tests, linting, security scans, and image build checks.
  10. How do you securely handle credentials in Jenkins (credentials binding, masking)?
    Jenkins credentials should be stored in the credentials store and injected only inside a withCredentials block or a supported credentials binding.
  11. What is the difference between environment variables and credentials in a pipeline?
    Environment variables are general runtime configuration values.
  12. What is a Jenkins shared library, and why use one?
    A Jenkins shared library is reusable Pipeline code stored in a separate repository and loaded by Jenkins.
  13. How do Jenkins agents get provisioned, and what are ephemeral/Kubernetes agents?
    Jenkins agents can be static machines, cloud instances, containers, or ephemeral Kubernetes Pods.
  14. How would you run builds in isolated containers using the Kubernetes plugin?
    With the Jenkins Kubernetes plugin, I define a Pod template for the build, choose containers for tools such as Maven, Docker/BuildKit, kubectl, or Helm, and run…
  15. What is a multibranch pipeline, and how does it handle branches and PRs?
    A multibranch pipeline automatically discovers branches and pull requests, reads the Jenkinsfile from each branch, and creates branch-specific jobs.
  16. How do you trigger a Jenkins pipeline (webhook, poll SCM, cron, upstream)?
    A Jenkins pipeline can be triggered by Git webhooks, SCM polling, cron schedules, upstream job completion, manual starts, API calls, or multibranch indexing.
  17. What is the difference between a webhook trigger and polling SCM?
    A webhook is event-driven: GitHub or Git sends Jenkins an HTTP event when something changes.
  18. How do you implement an approval/manual gate before a production deploy?
    I implement a production manual gate with an input step, environment approval, or a change-management integration.
  19. How would you fail a build when a security scan finds a critical vulnerability?
    I fail the build by defining an explicit vulnerability threshold, such as no critical findings in runtime dependencies or container images.
  20. How do you cache dependencies to speed up Jenkins builds?
    I cache dependencies by separating dependency download from source compilation and using a cache keyed by lockfiles or build descriptors.
  21. How would you reduce the run time of a slow pipeline?
    To reduce a slow pipeline, I first measure stage duration and queue time, then remove unnecessary serial work, parallelize independent checks, cache dependencies, use…
  22. What is a Jenkins agent label, and how do you target specific agents?
    A Jenkins agent label is metadata used to select where a build runs.
  23. How do you handle build artifacts and where do you store them (Nexus, ECR)?
    Build artifacts should be stored in a durable artifact repository or registry, not only in a Jenkins workspace.
  24. What is the difference between archiving artifacts and publishing to a registry?
    Archiving artifacts keeps files attached to a Jenkins build for traceability or debugging.
  25. How do you keep a pipeline idempotent and safely re-runnable?
    A pipeline is idempotent when rerunning it with the same inputs produces the same result without unsafe duplicate side effects.
  26. How do you implement blue-green or canary deployment from a pipeline?
    A pipeline can implement blue-green or canary by deploying a new version beside the current one, validating health and metrics, then shifting traffic gradually or all…
  27. What is the difference between blue-green, rolling, and canary deployments?
    Rolling deployment replaces instances gradually in the same environment.
  28. How would you implement automatic rollback if a deployment is unhealthy?
    Automatic rollback should be driven by health checks, deployment status, and runtime metrics.
  29. What metrics define a healthy CI/CD system (lead time, deployment frequency, change-fail rate, MTTR)?
    Healthy CI/CD is measured by both flow and reliability.
  30. What are the DORA metrics, and how have you used them?
    DORA metrics are deployment frequency, lead time for changes, change-failure rate, and time to restore service.
  31. What is GitOps, and what are its core principles?
    GitOps is an operating model where the desired state of systems is stored declaratively in Git and an agent continuously reconciles the runtime environment to match Git.
  32. How does GitOps differ from a traditional push-based CI/CD deploy?
    Traditional CI/CD often pushes changes directly from a pipeline into the cluster.
  33. What does it mean that Git is the single source of truth in GitOps?
    Git as the single source of truth means the intended application and environment state should be visible in Git.

Intermediate questions

  1. What is ArgoCD, and how does it implement GitOps?
    Argo CD is a Kubernetes GitOps controller.
  2. How does ArgoCD detect and reconcile drift between Git and the cluster?
    Argo CD detects drift by rendering the configured source, reading live Kubernetes objects, comparing desired versus actual state, and marking the application…
  3. What is an ArgoCD Application, and what does it define?
    An Argo CD Application defines what to deploy, from where, and to which cluster/namespace.
  4. What is the difference between automated and manual sync in ArgoCD?
    Manual sync means Argo CD shows drift but waits for a user or automation to press sync.
  5. What are ArgoCD sync waves and sync hooks?
    Sync waves and hooks control ordering during Argo CD sync.
  6. What is the app-of-apps pattern in ArgoCD?
    The app-of-apps pattern uses one parent Argo CD Application to create and manage multiple child Applications.
  7. How does ArgoCD determine the health status of resources?
    Argo CD determines health using built-in health checks for common Kubernetes resources and custom health logic for other kinds.
  8. What is a self-heal in ArgoCD, and when would you disable it?
    Self-heal means Argo CD automatically corrects live changes that drift from Git.
  9. How does ArgoCD handle secrets, and why is it tricky in GitOps?
    Secrets are tricky in GitOps because Git wants declarative state, but plain Kubernetes Secret YAML should not contain raw secrets.
  10. How would you manage multiple environments (dev/staging/prod) in ArgoCD?
    I manage multiple environments by separating environment-specific values and promotion controls while keeping common templates reusable.
  11. What is the difference between ArgoCD and Flux?
    Argo CD and Flux are both Kubernetes GitOps tools.
  12. How does ArgoCD integrate with Helm and Kustomize?
    Argo CD can render plain YAML, Kustomize overlays, Helm charts, Jsonnet, and plugin-based sources.
  13. How do you roll back a bad change in a GitOps workflow?
    In GitOps, rollback is normally a Git operation: revert the bad commit, restore a previous tag or commit, or update the desired version back to a known-good artifact.
  14. How do you prevent configuration drift from manual kubectl changes with ArgoCD?
    To prevent manual drift, I use Argo CD auto-sync with self-heal where appropriate, RBAC to restrict direct kubectl access, admission policies to block unsafe changes,…
  15. What are the advantages of pull-based deployment for security?
    Pull-based deployment is safer because CI does not need broad cluster credentials or inbound access to the cluster.
  16. How do you structure Git repositories for GitOps (mono vs multi, app vs config repo)?
    GitOps repository structure can be mono-repo, multi-repo, app repo plus config repo, or environment repo.
  17. How would you promote a change from staging to production in GitOps?
    Promotion from staging to production should be a controlled Git change.
  18. What is GitHub Enterprise, and how does it differ from github.com?
    GitHub Enterprise is GitHub's enterprise offering, available as GitHub Enterprise Cloud or Server, with organization controls, SSO/SAML, audit logs, enterprise…
  19. What is the difference between GitHub Actions and Jenkins?
    GitHub Actions is tightly integrated into GitHub with YAML workflows, hosted or self-hosted runners, and repository-native events.
  20. What is a GitHub Actions workflow, job, step, and runner?
    A GitHub Actions workflow is a YAML automation file triggered by events.
  21. What is the difference between a GitHub-hosted and a self-hosted runner?
    GitHub-hosted runners are managed by GitHub, ephemeral, and easy to use.
  22. How do you store and use secrets in GitHub Actions?
    GitHub Actions secrets are stored at repository, environment, or organization scope and injected into workflows through the secrets context.
  23. What is a branch protection rule, and what would you enforce on main?
    A branch protection rule defines requirements before code can merge into a protected branch such as main.
  24. What is the difference between merge commit, squash, and rebase merging?
    A merge commit preserves full branch history with a merge node.
  25. What is a pull request review workflow, and what gates would you require?
    A pull request review workflow is the controlled path for changing shared code.
  26. What are required status checks, and how do they protect main?
    Required status checks are CI checks that must pass before a pull request can merge.
  27. Explain a typical Git branching strategy (trunk-based, Git flow, GitHub flow).
    Trunk-based development keeps changes small and frequently merged to main.
  28. What is the difference between trunk-based development and Git flow?
    Trunk-based development minimizes long-lived branches and integrates continuously into main, usually with feature flags.
  29. What is a CODEOWNERS file, and how does it enforce review ownership?
    A CODEOWNERS file maps repository paths to responsible reviewers.
  30. How do you sign commits, and why might that be required?
    Commit signing cryptographically proves that a commit or tag was created by a trusted identity.
  31. What is the difference between git merge and git rebase, and when do you use each?
    git merge combines histories and preserves the branch relationship.
  32. What is a fast-forward merge?
    A fast-forward merge happens when the target branch has no new commits since the feature branch was created, so Git can just move the target pointer forward.
  33. How do you resolve a merge conflict, and how do you avoid them?
    To resolve a merge conflict, I identify conflicting files, edit them to the intended final content, run tests, stage the resolved files, and continue the merge or rebase.

Advanced questions

  1. What is git cherry-pick, and when is it useful?
    git cherry-pick applies a specific commit from one branch onto another.
  2. What is git revert versus git reset, and which is safe on a shared branch?
    git revert creates a new commit that undoes a previous commit, so it is safe on a shared branch.
  3. What is a detached HEAD state?
    A detached HEAD means HEAD points directly to a commit instead of a branch.
  4. What is a Git tag, and how do you use tags for releases?
    A Git tag is a named pointer to a commit, commonly used to mark a release.
  5. What is semantic versioning, and how do you apply it to releases?
    Semantic versioning uses MAJOR.MINOR.PATCH.
  6. How would you implement automated semantic version bumping in CI?
    Automated semantic version bumping can read commit messages, PR labels, or conventional commits, determine major/minor/patch, update changelog and version files,…
  7. What is a monorepo versus polyrepo, and what are the trade-offs?
    A monorepo stores multiple projects in one repository, which simplifies cross-project changes and shared tooling but requires selective builds and ownership controls.
  8. How do you only build/test the changed parts of a monorepo?
    In a monorepo, I build and test only changed parts by calculating the diff against the base branch, mapping paths to services or packages, and running affected builds…
  9. What is a webhook, and how does it connect GitHub to your CI?
    A webhook is an HTTP callback sent by GitHub when an event occurs, such as push, pull_request, tag creation, or release.
  10. How do you secure a CI/CD pipeline against supply-chain attacks?
    I secure CI/CD against supply-chain attacks with least-privilege tokens, protected branches, pinned dependencies and actions, isolated runners, secret scanning,…
  11. What is an SBOM, and how would you generate and gate on one in CI?
    An SBOM is a software bill of materials: an inventory of components, packages, versions, and sometimes licenses and hashes.
  12. How do you sign and verify build artifacts or container images?
    I sign artifacts or container images with a tool such as cosign, attach provenance or attestations, and verify signatures before deployment.
  13. What is artifact promotion, and why not rebuild between environments?
    Artifact promotion means the exact same built artifact moves from dev to staging to production.
  14. Why should the same artifact move through environments rather than rebuilding per stage?
    The same artifact should move through environments so every test result applies to the exact artifact deployed to production.
  15. How do you implement secrets scanning to prevent credentials in commits?
    Secrets scanning detects credentials before they land in Git history or before they reach main.
  16. How would you integrate SAST and dependency scanning into a pipeline?
    I integrate SAST and dependency scanning as early PR gates and deeper scheduled scans.
  17. How do you handle database migrations safely within a deployment pipeline?
    Database migrations should be backward-compatible, observable, and separated from risky application rollout when needed.
  18. How do you implement feature flags, and how do they decouple deploy from release?
    Feature flags put release control into configuration rather than deployment.
  19. What is the difference between deployment and release?
    Deployment means putting a version of software into an environment.
  20. How do you ensure a pipeline is fast enough to give quick feedback?
    A fast pipeline gives quick feedback by running cheap checks first, parallelizing independent work, caching dependencies, using affected tests, avoiding shared…
  21. How would you design a pipeline for a microservices architecture?
    For microservices, I design pipelines with reusable templates, service-specific build/test/deploy stages, dependency-aware integration tests, container image…
  22. How do you test infrastructure changes (Terraform) in a pipeline?
    Terraform changes should be formatted, validated, linted, security-scanned, planned, reviewed, and applied through controlled approvals.
  23. What is a deployment freeze, and how do you enforce one?
    A deployment freeze is a temporary block on production changes, usually for business-critical periods or incident stabilization.
  24. How would you measure and improve pipeline reliability (flaky builds)?
    Pipeline reliability is improved by measuring failures, classifying flakes, isolating unstable tests, fixing shared infrastructure issues, retrying only known…
  25. How do you handle long-running integration tests without slowing every commit?
    I keep long-running integration tests out of every commit path by running smoke tests on PRs, targeted integration tests for affected services, full suites nightly or…
  26. What is a canary analysis, and how do you automate the go/no-go decision?
    Canary analysis compares the new version against the baseline using metrics such as error rate, latency, saturation, logs, and business KPIs.
  27. How do you roll out a change to a subset of users or regions first?
    I roll out to a subset by using canary traffic weights, feature flags, region-based deployment, ring deployments, tenant allowlists, or service-mesh routing.
  28. How do you audit who deployed what and when?
    I audit deployments by recording commit SHA, artifact digest, version, environment, approver, pipeline run, Argo CD sync operation, Kubernetes change events, and…
  29. How do you manage pipeline configuration across dozens of repositories?
    Across many repositories, I manage pipeline configuration with reusable workflows, Jenkins shared libraries, versioned templates, central policy checks, golden runner…
  30. How would you migrate a team from Jenkins to GitOps with ArgoCD?
    To migrate from Jenkins to GitOps with Argo CD, I separate build from deploy.
  31. What is progressive delivery, and what tools enable it (Argo Rollouts, Flagger)?
    Progressive delivery is controlled rollout with automated validation, such as canary, blue-green, traffic shifting, and feature-flag rollout.
  32. How do you handle rollback when a release includes a non-reversible DB migration?
    If a release includes a non-reversible database migration, rollback cannot simply redeploy the old app.
  33. What recent CI/CD or GitOps practice have you adopted, and what improved?
    A recent CI/CD practice I would highlight is replacing long-lived deployment secrets with OIDC-based short-lived credentials and adding artifact signing/SBOM gates.
  34. How do you keep build agents and runner images patched and secure over time?
    Build agents and runner images should be treated as production infrastructure.

← All interview topics