🔄

Top 50 CI/CD Pipelines Interview Questions & Answers (2026)

50 Questions 20 Beginner 20 Intermediate 10 Advanced

About CI/CD Pipelines

Top 50 CI/CD Pipelines interview questions covering continuous integration, continuous delivery, deployment strategies, and DevOps best practices. Companies hiring for CI/CD Pipelines roles test this knowledge at every stage — from first-round screens that check the basics to final-round conversations about real-world trade-offs.

What to Expect in a CI/CD Pipelines Interview

Expect a mix of conceptual and practical CI/CD Pipelines questions: clear definitions and core-concept checks for junior roles, hands-on scenario questions for mid-level roles, and architecture or trade-off discussions for senior roles. Interviewers usually move from foundational topics toward the kind of problems you'd actually face on the job.

How to Use This Guide

Work through the CI/CD Pipelines questions in order — Beginner, then Intermediate, then Advanced — so each concept builds on the last. Every question has its own page; bookmark the ones that trip you up and revisit them the day before your interview.

Curated by Tech Baithak Editorial Team  ·  Last updated: June 2026

Beginner 20 questions

Core concepts every CI/CD Pipelines developer must know.

01

What is Continuous Integration (CI)?

Continuous Integration (CI) is the practice of automatically building and testing code every time a developer pushes changes to a shared repository, typically multiple times per day. The goal is to detect integration bugs as early as possible — when they are cheapest to fix — rather than discovering them weeks later when many changes have accumulated. A CI server (GitHub Actions, Jenkins, GitLab CI) monitors the repository, triggers a pipeline on each push, compiles the code, runs the test suite, and reports the result back to the developer. CI enforces a culture where the main branch is always in a buildable, tested state. Martin Fowler, who popularized the term, emphasizes that the practice is as much about culture (frequent small commits, fixing broken builds immediately) as it is about tooling.

Open this question on its own page
02

What is the difference between Continuous Delivery and Continuous Deployment?

Continuous Delivery (CD) ensures that every code change that passes automated tests is in a deployable state and can be released to production at any time with a single button click (or manual approval gate). The deployment itself is a human decision. Continuous Deployment takes this further — every change that passes all automated tests is automatically deployed to production with no human intervention. Continuous Deployment requires extremely high confidence in your automated test suite, monitoring, and rollback capabilities. Most organizations practice Continuous Delivery (with manual approval for production) rather than fully automated deployment, especially in regulated industries. Both require a robust automated pipeline; the difference is only the final gate before production.

Open this question on its own page
03

What are the key benefits of CI/CD?

CI/CD delivers several compounding benefits. Faster feedback loops: developers discover bugs within minutes of introducing them rather than weeks later. Reduced integration risk: small, frequent changes are easier to merge and debug than large, infrequent ones. Higher software quality: automated tests run consistently on every change, preventing regressions. Faster time to market: features reach users in hours or days instead of months. Reduced deployment risk: small, automated deployments with automated rollback are far less risky than large manual deployments. Improved developer confidence: teams can refactor and innovate knowing the safety net of automated tests will catch regressions. Companies like Google, Amazon, and Netflix deploy thousands of times per day because of mature CI/CD pipelines.

Open this question on its own page
04

What are the typical stages in a CI/CD pipeline?

A typical CI/CD pipeline flows through these stages: Source — a developer pushes code, triggering the pipeline; Build — source code is compiled and dependencies are installed (e.g., npm install && npm run build); Test — automated tests run (unit tests, integration tests); Code Quality — static analysis, linting, and coverage checks run; Security Scan — SAST tools scan for vulnerabilities; Package/Containerize — a Docker image or deployable artifact is built and tagged; Staging Deploy — the artifact is deployed to a staging environment; Acceptance Tests — end-to-end and smoke tests run against staging; Production Deploy — the artifact is deployed to production (manual gate for CD, automatic for Continuous Deployment); Monitoring — post-deployment health checks confirm the release is healthy.

Open this question on its own page
05

What is GitHub Actions and how does it work?

GitHub Actions is GitHub's built-in CI/CD platform that automates workflows directly in your repository. Workflows are defined in YAML files placed in .github/workflows/. A workflow is triggered by events (e.g., push, pull_request, schedule, workflow_dispatch). Each workflow contains one or more jobs that run on runners (GitHub-hosted VMs or self-hosted machines). Each job contains a sequence of steps — either shell commands (run:) or pre-built Actions (uses: actions/checkout@v4). Jobs can run in parallel or sequentially using needs: dependencies. GitHub Actions has a marketplace of thousands of community Actions for common tasks (deploy to AWS, send Slack notifications, etc.).

Open this question on its own page
06

What is Jenkins and how does it differ from GitHub Actions?

Jenkins is an open-source, self-hosted CI/CD automation server with over a decade of history and a massive plugin ecosystem (1,800+ plugins). It uses a master/agent (controller/agent) architecture where the master orchestrates jobs and agents execute the actual build steps. Pipelines are defined in a Jenkinsfile (Groovy DSL) checked into the repo. Unlike GitHub Actions (which is a managed cloud service), Jenkins requires you to provision, maintain, update, and secure your own infrastructure. Jenkins offers maximum flexibility and can integrate with virtually any tool through plugins, but the operational overhead is significant. GitHub Actions is simpler to start with (no infrastructure to manage) and is tightly integrated with GitHub, while Jenkins is preferred in organizations that need on-premise CI for security or compliance reasons.

Open this question on its own page
07

What is a Dockerfile and why does it matter in CI/CD?

A Dockerfile is a text file containing instructions (FROM, COPY, RUN, CMD, etc.) for building a Docker image — a portable, immutable snapshot of an application and all its dependencies. In CI/CD, the pipeline builds a Docker image from the Dockerfile during the build stage (docker build -t myapp:git-sha .), runs tests inside or against the container, and then pushes the verified image to a container registry (Docker Hub, ECR, GCR). The same image is then deployed to staging and production — guaranteeing that what was tested is exactly what runs in production. This eliminates environment-specific bugs and makes every deployment reproducible. Using a multi-stage Dockerfile keeps production images small by discarding build tools not needed at runtime.

Open this question on its own page
08

What are git branching strategies for CI and how do GitFlow and trunk-based development compare?

GitFlow uses multiple long-lived branches: main (production), develop (integration), feature/*, release/*, and hotfix/*. It suits teams with scheduled releases but creates complex merge workflows and long-lived branches that diverge significantly, making integration painful. Trunk-based development has all developers commit directly to the main branch (or merge short-lived feature branches within 1-2 days). This forces continuous integration — conflicts are resolved immediately and the branch is always releasable. It requires feature flags to hide incomplete work. Trunk-based development is the strategy used by high-performing engineering teams (Google, Facebook) because it maximizes integration frequency and minimizes merge conflicts. The CI pipeline is simpler with trunk-based development: there is only one primary branch to build and protect.

Open this question on its own page
09

How do unit tests fit into a CI pipeline?

Unit tests are the first and most important automated tests in a CI pipeline. They verify that individual functions or classes behave correctly in isolation, with all external dependencies (databases, APIs) mocked. Because they are fast (milliseconds per test), a suite of thousands of unit tests can complete in under a minute. In the CI pipeline, unit tests run immediately after the build step, before any deployment. A failing unit test fails the pipeline and blocks merging, giving developers near-instant feedback. Best practice is to enforce a code coverage threshold (e.g., 80% branch coverage) as a pipeline gate — if coverage drops below the threshold, the build fails. Fast unit tests are the foundation of a reliable CI pipeline; slow tests destroy developer experience by making every pipeline run take 30+ minutes.

Open this question on its own page
10

What is artifact storage in CI/CD and why is it important?

Artifact storage refers to storing the outputs of a CI build — compiled binaries, JAR files, ZIP archives, Docker images — in a durable repository so they can be deployed reliably later. The key principle is build once, deploy many: compile the artifact once in CI, store it, and promote that exact same artifact through staging and production. This eliminates the risk of a re-build producing slightly different output due to dependency changes or environment differences. For Docker images, a container registry (Docker Hub, AWS ECR, Google GCR, GitHub Container Registry) stores and versions images by git SHA or semantic version tag. For binary artifacts, tools like Nexus, Artifactory, or cloud-native solutions (AWS S3, GitHub Packages) store versioned packages.

Open this question on its own page
11

How are environment variables and secrets managed in CI/CD pipelines?

CI/CD pipelines often need access to sensitive values — API keys, database passwords, cloud credentials — that must never be stored in source code or committed to git. All major CI platforms provide a secrets store: GitHub Actions Secrets, GitLab CI/CD Variables, Jenkins Credentials. These secrets are encrypted at rest, masked in logs, and injected as environment variables into the pipeline at runtime. Best practices include: rotate secrets regularly, use short-lived credentials (AWS OIDC, Workload Identity Federation) rather than long-lived API keys, scope secrets to specific environments or jobs, and use secret scanning tools (GitGuardian, truffleHog) to detect any accidental commits of secrets. Never log environment variables or echo secret values in pipeline steps — CI platforms automatically mask known secret values in logs.

Open this question on its own page
12

What events can trigger a CI/CD pipeline?

CI/CD pipelines can be triggered by a variety of events: Push to a branch — the most common trigger; run tests and build on every push to main or feature branches. Pull/Merge request — run tests and post status checks before allowing merge, enforcing quality gates. Tag push — trigger a release build and deployment when a version tag (e.g., v1.2.0) is pushed. Schedule — run nightly builds, dependency update checks, or performance tests on a cron schedule. Manual trigger — allow authorized users to manually kick off a deployment (workflow_dispatch in GitHub Actions). External webhook — trigger a pipeline from an external system (JIRA ticket status, external monitoring alert). Repository dispatch — trigger one workflow from another across different repositories, useful for multi-repo monorepo setups.

Open this question on its own page
13

What is the difference between parallel jobs and sequential jobs in a pipeline?

In a CI/CD pipeline, jobs can be structured to run sequentially (one after another, where each job depends on the previous succeeding) or in parallel (simultaneously on separate runners). Sequential jobs are appropriate when there is a logical dependency — you cannot deploy before the build succeeds, and you cannot run integration tests before the unit tests pass. Parallel jobs dramatically reduce total pipeline time by running independent tasks simultaneously — for example, running unit tests, linting, and security scanning at the same time rather than waiting for each to finish. In GitHub Actions, jobs run in parallel by default; use needs: to express dependencies. A well-designed pipeline parallelizes as much as possible while maintaining the correct logical ordering, minimizing the time developers wait for feedback.

Open this question on its own page
14

What is a build matrix in CI and when is it useful?

A build matrix (called strategy.matrix in GitHub Actions) lets you run the same job against multiple combinations of variables simultaneously. This is most commonly used to test across multiple language versions, operating systems, or dependency versions in parallel. For example, a Python library might test against Python 3.9, 3.10, 3.11, and 3.12 on both Ubuntu and macOS — creating 8 parallel jobs from a single matrix definition. A Node.js package might test on Node 18 and 20 across Linux, Windows, and macOS. This ensures your code works across all supported environments without manually defining separate jobs for each. Build matrices are essential for library and open-source projects that need broad compatibility guarantees.

Open this question on its own page
15

What is a pipeline cache and why should you use it?

A pipeline cache stores files between pipeline runs to avoid re-downloading or recomputing them on every run. The most common use case is caching package manager dependencies — node_modules/ for npm, .m2/ for Maven, vendor directory for Composer — so the pipeline doesn't re-download hundreds of packages every run. GitHub Actions provides a actions/cache action that stores and restores a directory based on a cache key (typically a hash of the lockfile). A cache hit can reduce a 3-minute dependency installation to a 10-second restore. Without caching, large pipelines waste significant time and egress bandwidth on repeated downloads. Docker layer caching (--cache-from) similarly avoids re-building unchanged image layers, dramatically speeding up container builds.

Open this question on its own page
16

What is a container registry and which ones are commonly used?

A container registry is a repository for storing and distributing Docker images. After building a Docker image in CI, the pipeline pushes it to a registry; deployment systems then pull the image from the registry to run it. Common registries include: Docker Hub (the original public registry, free for public images), Amazon ECR (Elastic Container Registry, integrated with ECS and EKS, private), Google Artifact Registry / GCR (Google Cloud, integrated with GKE), GitHub Container Registry (GHCR) (tightly integrated with GitHub Actions), GitLab Container Registry, and Azure Container Registry (ACR). Private registries behind authentication ensure only authorized systems can pull production images. Versioning by git commit SHA (myapp:abc1234) allows precise traceability — you always know exactly which commit is running in production.

Open this question on its own page
17

What is an approval gate in a CD pipeline?

An approval gate (also called a manual gate or deployment gate) is a checkpoint in the CD pipeline that pauses automated progression and requires explicit human sign-off before continuing to the next stage. The most common use is requiring approval before deploying to production — the pipeline automatically deploys to staging, runs acceptance tests, and then pauses and notifies the team, waiting for an authorized person to review and approve the production deployment. GitHub Actions supports this via Environments with required reviewers. Jenkins implements it with the input step. Approval gates are essential in regulated industries (finance, healthcare) where a change advisory board (CAB) review is required before production changes, and in organizations that want human oversight before touching production despite having full test automation.

Open this question on its own page
18

What are common rollback strategies in CI/CD?

Rollback strategies allow you to quickly revert a bad deployment. Re-deploy the previous artifact: since CI/CD stores every build artifact (Docker image tagged by git SHA), you can re-trigger the pipeline with the previous tag. This is reliable but takes minutes. Blue-green rollback: if a blue-green deployment is used, the load balancer simply switches back to the old (blue) environment — near-instant, since the old environment is still running. Kubernetes rollback: kubectl rollout undo deployment/my-service reverts to the previous ReplicaSet in seconds. Feature flags: turn off the problematic feature flag immediately without any deployment. Git revert: create a revert commit and let the pipeline redeploy — cleaner for long-term code history but the slowest option. Fast rollback capability is a prerequisite for high-frequency deployment confidence.

Open this question on its own page
19

What does a basic CI pipeline look like for Node.js, Python, Java, and PHP projects?

Each language has a typical CI pattern. Node.js: actions/setup-nodenpm ci (reproducible install from lockfile) → npm testnpm run build. Python: actions/setup-pythonpip install -r requirements.txtpytestflake8 for linting. Java (Maven): actions/setup-javamvn -B package --no-transfer-progress which runs tests during the package phase. PHP (Laravel): shivammathur/setup-phpcomposer install --no-dev → start a test database → php artisan test. In all cases, the pattern is: install language runtime, install dependencies (using cache), run tests, and optionally build a production artifact. The --no-dev flag for PHP and npm ci instead of npm install ensure reproducible, production-equivalent dependency sets.

Open this question on its own page
20

What is a deployment environment (dev, staging, prod) in CI/CD?

Deployment environments are separate infrastructure contexts that represent different stages of the software delivery lifecycle. Development (dev): where developers test their own changes in isolation, often on local machines or ephemeral cloud environments created per branch (preview environments). Staging: a production-like environment where integrated changes are tested — runs the same infrastructure configuration as production but with test data; acceptance tests, performance tests, and UAT (User Acceptance Testing) happen here. Production (prod): the live environment serving real users, with real data; changes arrive only after passing all previous stages. Some organizations add a QA environment between dev and staging. Environment promotion — moving the same artifact from dev → staging → prod — is the core of Continuous Delivery and ensures that what is tested is exactly what ships.

Open this question on its own page
Intermediate 20 questions

Practical knowledge for developers with hands-on experience.

01

What is blue-green deployment and how does it achieve zero-downtime releases?

Blue-green deployment maintains two identical production environments — blue (currently live) and green (new version). The new release is deployed to the idle environment (green), where it is fully tested including smoke tests and health checks. When confident, the load balancer switches 100% of traffic from blue to green in seconds — this is the actual "deployment" moment and it is instantaneous. If the green environment exhibits problems after the switch, rollback is immediate: flip the load balancer back to blue. The key requirements are: both environments must be provisioned and maintained simultaneously (doubling infrastructure cost during transitions), database migrations must be backward-compatible (both blue and green must work with the same database schema), and session affinity must be handled carefully. Blue-green is particularly effective for stateless services and is widely used with AWS Elastic Beanstalk, Kubernetes, and Heroku.

Open this question on its own page
02

What is a canary release and how does it reduce deployment risk?

A canary release gradually shifts production traffic from the old version to the new version over time — for example, 1% → 5% → 25% → 50% → 100% — while continuously monitoring error rates, latency, and business metrics at each step. If any metric degrades beyond a threshold, the canary is automatically or manually aborted and all traffic returns to the old version. Only a small percentage of users experience any potential issues, limiting blast radius dramatically. The name comes from "canary in a coal mine" — a small signal of danger before it affects everyone. Tools: Kubernetes with Istio or Argo Rollouts can implement weighted traffic splitting at the service mesh level; feature flag platforms like LaunchDarkly can control canary releases at the application logic level. Canary releases are the deployment strategy of choice for high-traffic services where even brief outages affect millions of users.

Open this question on its own page
03

What is a rolling deployment and how does it compare to blue-green?

A rolling deployment gradually replaces old version instances with new version instances one (or a few) at a time. Kubernetes performs rolling deployments by default: it spins up new pods with the new image, waits for them to pass readiness checks, then terminates old pods — ensuring a minimum number of healthy pods are always running. Compared to blue-green: rolling deployments use less infrastructure (no duplicate environment) but both old and new versions run simultaneously during the rollout, requiring backward-compatible APIs and database schemas. Rolling back a rolling deployment is slower than blue-green because you must roll forward through all instances again. Rolling deployments are the default in Kubernetes and work well when the service is stateless and API changes are backward-compatible. Blue-green is preferred when you need atomic, instant switches and can afford the infrastructure cost.

Open this question on its own page
04

What are feature flags and how do they integrate with CI/CD?

Feature flags (also called feature toggles) are configuration values that enable or disable functionality at runtime without a code deployment. They decouple deployment (shipping code to production) from release (enabling the feature for users). In a CI/CD context, developers merge incomplete features to main behind a disabled flag, enabling trunk-based development without breaking production. When the feature is ready, it is released by flipping the flag — often to a subset of users first (canary-style release). If problems occur, the flag is immediately turned off. Platforms like LaunchDarkly and Unleash provide targeting rules (release to 10% of users, to specific user segments, or to specific accounts). Feature flags also enable A/B testing, kill switches for problematic features, and operational toggles for debugging production issues without a deployment.

Open this question on its own page
05

What is the testing pyramid in CI/CD and where does each test type run?

The testing pyramid (by Mike Cohn) recommends having many unit tests at the base, fewer integration tests in the middle, and a small number of end-to-end tests at the top. In a CI/CD pipeline: Unit tests (base) run on every push — fast (seconds), test business logic in isolation, should be thousands of them. Integration tests run after unit tests — test a service with its real database and dependencies (using Testcontainers or a test environment), slower (minutes), catch wiring and SQL bugs. Contract tests (Pact) run in CI — verify service API compatibility without a full environment. End-to-end (E2E) tests run against staging — simulate real user flows in a full deployed environment, slowest (tens of minutes), kept to a minimum covering critical user journeys. The pyramid shape enforces investing most effort where tests are fastest and cheapest to run.

Open this question on its own page
06

What are code quality gates (SonarQube, coverage thresholds) in CI/CD?

Code quality gates are automated checks in the CI pipeline that enforce minimum quality standards before code can be merged or deployed. Common gates include: Code coverage thresholds — fail the build if test coverage drops below a defined percentage (e.g., 80% line coverage), enforced via tools like Istanbul (JavaScript), Coverage.py (Python), or JaCoCo (Java). SonarQube performs static analysis detecting code smells, duplicated code, cyclomatic complexity, and technical debt — the pipeline fails if the "Quality Gate" (configurable thresholds) is not met. CodeClimate provides similar analysis as a cloud service integrated with GitHub. Linting (ESLint, Pylint, PHP-CS-Fixer) enforces code style and catches common bugs. Quality gates prevent technical debt accumulation by making standards mandatory rather than aspirational, and they block merges that introduce regressions in quality metrics.

Open this question on its own page
07

What is SAST (Static Application Security Testing) and how is it used in CI?

SAST (Static Application Security Testing) analyzes source code, bytecode, or binary code for security vulnerabilities without executing the program. It is called "static" because it runs against the code at rest, not against a running application. In CI pipelines, SAST runs automatically on every pull request or push. Common SAST tools include: Snyk (scans code and dependencies for known vulnerabilities, supports all major languages), Semgrep (rule-based code pattern scanner, highly customizable), Bandit (Python security scanner), CodeQL (GitHub's semantic code analysis, finds complex logic bugs), and Checkmarx (enterprise). SAST catches issues like SQL injection patterns, insecure cryptography usage, hardcoded secrets, and dangerous function calls early in the development cycle, before they reach production. The tradeoff is false positives — SAST tools must be tuned to avoid alert fatigue.

Open this question on its own page
08

What is DAST (Dynamic Application Security Testing) and where does it fit in CD?

DAST (Dynamic Application Security Testing) tests a running application by sending crafted HTTP requests and observing responses — simulating the perspective of an attacker. Unlike SAST (source code analysis), DAST requires a live application instance, making it part of the CD pipeline (after staging deployment). DAST tools like OWASP ZAP and Burp Suite Enterprise automatically probe for vulnerabilities including XSS, SQL injection, broken authentication, insecure headers, and CSRF. In a CD pipeline, DAST runs against the staging environment after deployment, before traffic is shifted to production. A vulnerability above a severity threshold blocks the promotion to production. DAST catches runtime vulnerabilities that SAST misses (e.g., authentication bypass that depends on server behavior) but is slower and can only test functionality that has been exercised during the scan.

Open this question on its own page
09

What is container image scanning and which tools are commonly used?

Container image scanning analyzes Docker images for known vulnerabilities in the OS packages, language runtimes, and libraries bundled inside the image. Because Docker images often include a full OS layer with dozens of packages, even official base images regularly contain CVEs (Common Vulnerabilities and Exposures). In CI/CD, image scanning runs after docker build and before pushing to the registry or deploying. Common tools include: Trivy (by Aqua Security, fast, open-source, scans images, filesystems, and git repos), Grype (by Anchore, open-source, comprehensive vulnerability database), Snyk Container (cloud service with developer-friendly reporting), and AWS Inspector (integrated with ECR). Best practice is to set a policy that blocks deployment of images with CRITICAL or HIGH severity CVEs, and to keep base images updated regularly. Use distroless or minimal base images (Alpine, Chainguard) to minimize the attack surface.

Open this question on its own page
10

How does Kubernetes deployment integrate with CI/CD pipelines?

Deploying to Kubernetes from CI/CD involves several approaches. The simplest is kubectl-based deployment: the pipeline authenticates to the Kubernetes cluster (via a service account token or OIDC), updates the image tag in a Deployment manifest (kubectl set image deployment/my-app my-app=myimage:$GIT_SHA), and Kubernetes performs a rolling update. Helm manages Kubernetes applications as versioned "charts" — the pipeline runs helm upgrade --install my-app ./chart --set image.tag=$GIT_SHA. This packages all Kubernetes resources (Deployment, Service, Ingress, ConfigMap) into one versioned unit with rollback support. For production pipelines, use Kubernetes RBAC to limit the CI service account to only the namespaces and actions it needs, never give it cluster-admin. Always verify deployments with kubectl rollout status to ensure the rollout completed successfully before marking the pipeline as passed.

Open this question on its own page
11

What is Helm and how is it used in CD pipelines?

Helm is the package manager for Kubernetes. It bundles all Kubernetes resource manifests (Deployments, Services, ConfigMaps, Ingresses) for an application into a chart — a versioned, reusable package. Charts use Go templates to allow parameterization: the same chart can deploy to dev, staging, and production with different values (image tag, replica count, resource limits). In CD pipelines: the pipeline builds and pushes the Docker image, updates the image tag value, and runs helm upgrade --install my-app ./chart --values env/prod/values.yaml --set image.tag=$GIT_SHA --atomic. The --atomic flag automatically rolls back if the deployment fails health checks. Helm maintains a release history in the cluster, enabling helm rollback to any previous revision. Helm repositories (ChartMuseum, OCI registries) store versioned charts for reuse across teams.

Open this question on its own page
12

What is GitOps and how does it differ from traditional push-based CD?

GitOps is a CD approach where the desired state of infrastructure and applications is declared in Git, and a reconciliation agent automatically detects drift and applies changes to match the Git state. Tools like ArgoCD and Flux continuously watch a Git repository for changes and apply them to the Kubernetes cluster. In push-based CD (traditional), the CI pipeline directly runs kubectl apply or helm upgrade against the cluster when code changes. In GitOps (pull-based), the pipeline only updates the Git repository (e.g., a Helm values file with the new image tag), and the GitOps agent running inside the cluster detects the change and pulls and applies it. Benefits of GitOps: the Git repo is the single source of truth, all changes have a full audit log (git history), rollback is git revert, and the cluster credentials never leave the cluster (no need to give CI systems access to production Kubernetes).

Open this question on its own page
13

What is environment promotion and how does it work in practice?

Environment promotion is the process of moving the same immutable artifact (Docker image, Helm chart) through a series of environments — typically dev → QA → staging → production — gaining confidence at each stage. The key principle is promote artifacts, not code: once an artifact is built in CI, that exact artifact is what gets deployed everywhere. You never rebuild for different environments; instead, you change configuration (environment variables, feature flags). In practice: CI builds and tags the Docker image with the git commit SHA, deploys to dev for smoke tests, runs integration tests in a QA environment, deploys to staging for acceptance tests and performance benchmarks, and finally (with an approval gate in CD) deploys to production. If the staging deployment reveals a bug, the pipeline stops — the problematic artifact never reaches production. This gives strong confidence that the production deployment will succeed.

Open this question on its own page
14

What are monorepo CI strategies for handling affected changes?

In a monorepo — where multiple services or packages share one git repository — naively running all pipelines on every commit is wasteful and slow. Affected change detection determines which services were modified by a given commit and only builds/tests/deploys those. Tools: Nx (JavaScript/TypeScript monorepo tool) runs nx affected --target=test to test only packages affected by the change, including their dependents. Turborepo provides similar capabilities with distributed caching. Bazel (Google's build system) uses a fine-grained dependency graph to determine minimal rebuild scope. For Docker-based microservices in a monorepo, the pipeline can check git diff --name-only to identify changed service directories and only build those images. The tradeoff is complexity in setting up the dependency graph accurately — a missed dependency means a service that needed rebuilding was skipped.

Open this question on its own page
15

What are DORA metrics and why do they matter for CI/CD?

DORA (DevOps Research and Assessment) metrics are four key performance indicators that measure software delivery performance, validated by research across thousands of organizations. Deployment Frequency: how often code is deployed to production — elite performers deploy multiple times per day. Lead Time for Changes: time from code commit to running in production — elite is under one hour. Mean Time to Restore (MTTR): how quickly you recover from a production incident — elite is under one hour. Change Failure Rate: percentage of deployments that cause a production incident — elite performers have less than 15%. These metrics are correlated with both software delivery performance and organizational performance (profitability, market share). High deployment frequency and low lead time are enabled directly by mature CI/CD pipelines — your pipeline speed and test coverage directly drive DORA scores.

Open this question on its own page
16

What are self-hosted runners and when should you use them?

Self-hosted runners are machines (physical servers, VMs, containers) that you provision and manage yourself to execute CI/CD jobs, rather than using the CI platform's managed cloud runners. In GitHub Actions, you register a self-hosted runner by installing the runner agent on your machine and connecting it to your repository or organization. Use self-hosted runners when: you need access to on-premises resources (private databases, internal artifact stores, physical hardware); you need specific hardware (GPU for ML pipelines, Apple Silicon for iOS builds); GitHub's managed runners are too slow or expensive at your scale; or compliance/security requirements mandate that build artifacts and secrets never leave your network. The tradeoff is operational overhead — you are responsible for patching, scaling, and maintaining runner infrastructure. GitHub Actions Runner Scale Sets (using Kubernetes) automate runner lifecycle management.

Open this question on its own page
17

How does Terraform integrate into automated CI/CD pipelines?

Integrating Terraform (Infrastructure as Code) into CI/CD enables automated, auditable infrastructure changes. The standard pattern: on a pull request, the pipeline runs terraform plan and posts the plan output as a PR comment — reviewers see exactly what infrastructure changes will be made before approving. On merge to main, the pipeline runs terraform apply -auto-approve to execute the changes. Critical considerations: use a remote state backend (AWS S3 + DynamoDB for locking, Terraform Cloud) so state is shared and concurrent applies are prevented; use OIDC authentication (no long-lived AWS keys in CI secrets); run terraform fmt -check and terraform validate in the pipeline to enforce code quality; and use policy as code (OPA, Sentinel) to prevent non-compliant infrastructure changes from being applied. Tools like Atlantis and Spacelift provide Terraform-specific GitOps workflows with plan/apply automation and audit logging.

Open this question on its own page
18

What is multi-cloud CI/CD and what challenges does it introduce?

Multi-cloud CI/CD involves deploying the same application to multiple cloud providers (AWS, Azure, GCP) or managing infrastructure across multiple clouds from a single pipeline. Use cases include: avoiding vendor lock-in, regulatory requirements to operate in specific regions not served by one provider, and choosing best-of-breed services from different clouds. Challenges include: Authentication management — maintaining credentials for multiple cloud APIs securely; Artifact distribution — pushing Docker images to multiple registries (ECR, GCR, ACR); Configuration differences — each cloud has different naming conventions, IAM models, and service APIs; Testing complexity — validating deployments across multiple targets; and Increased pipeline complexity. Tools like Terraform with multiple provider configurations, GitHub Actions with cloud-specific action sets, and Pulumi help manage multi-cloud pipelines. Most organizations avoid true multi-cloud for application deployment unless there is a strong business requirement.

Open this question on its own page
19

What is pipeline-as-code versus UI-configured pipelines?

Pipeline-as-code defines the CI/CD pipeline configuration in a version-controlled file (Jenkinsfile, .github/workflows/ YAML, .gitlab-ci.yml, bitbucket-pipelines.yml) that lives alongside the application source code. Changes to the pipeline go through code review, have full history, and can be rolled back. UI-configured pipelines (classic Jenkins jobs, older Azure DevOps pipelines) are defined via a web interface, storing configuration in the CI server's database. Pipeline-as-code is the modern standard because it applies software engineering practices to the pipeline itself, enables developers to modify the pipeline alongside code changes in the same PR, supports multiple branches with different pipeline behaviors, and makes disaster recovery easy (no CI configuration is lost if the server is rebuilt). UI pipelines lack auditability and are hard to replicate across environments. All modern CI platforms (GitHub Actions, GitLab CI, CircleCI) use pipeline-as-code exclusively.

Open this question on its own page
20

What is dependency scanning in CI/CD and how does it work?

Dependency scanning (also called software composition analysis, SCA) automatically identifies known security vulnerabilities in the third-party libraries and packages your application depends on. Modern applications import hundreds of open-source packages, each of which may contain published CVEs. In the CI pipeline, after installing dependencies, the scanner checks each package version against vulnerability databases (National Vulnerability Database, GitHub Advisory Database, Snyk's database) and reports any matches with severity scores. Tools include: Snyk (language-agnostic, developer-friendly, integrates with GitHub/GitLab PR checks), OWASP Dependency-Check (open-source, supports Java, .NET, Python, PHP), npm audit (built into npm for Node.js), Dependabot (GitHub's built-in tool that opens automated PRs for vulnerable dependency updates), and Renovate (automated dependency update PRs with configurable schedules). Best practice is to block merges on CRITICAL vulnerabilities and auto-merge Dependabot patches for development dependencies, while requiring human review for production dependency updates that may include breaking changes.

Open this question on its own page
Advanced 10 questions

Deep expertise questions for senior and lead roles.

01

What are the core principles of GitOps?

GitOps is defined by four principles introduced by Weaveworks. Declarative: the entire system (infrastructure and applications) is described declaratively — you declare the desired end state, not the steps to achieve it (Kubernetes manifests, Terraform HCL). Versioned and Immutable: the desired state is stored in Git, providing immutability, an audit trail, and the ability to roll back by reverting commits. Pulled Automatically: approved desired state changes are applied to the system automatically — the GitOps agent (ArgoCD, Flux) running inside the cluster continuously pulls from Git and applies changes, rather than CI pushing to the cluster. Continuously Reconciled: software agents continuously compare the actual cluster state to the desired Git state and automatically correct any drift (e.g., someone manually kubectl-applied a change that is not in Git). These principles result in a system where Git is the single source of truth, all operations are auditable, and the cluster is always in a known, reproducible state.

Open this question on its own page
02

What is progressive delivery and how does it extend beyond basic canary releases?

Progressive delivery (a term coined by James Governor) is the evolution of continuous delivery that gives fine-grained control over who receives a new version and monitors impact in real time. Beyond basic canary releases (percentage of traffic), progressive delivery includes: Traffic shadowing (mirroring) — a copy of live traffic is sent to the new version in parallel, with responses discarded, allowing you to observe its behavior under real production load without affecting users; A/B testing — routing specific user segments (by geography, user ID, account plan) to different versions to measure business metric impact; Dark launching — deploying a feature to production but keeping it invisible to users while exercising it with synthetic or mirrored traffic. Tools like Argo Rollouts, Flagger, and LaunchDarkly automate progressive delivery workflows, integrating with Prometheus metrics to automatically promote or abort releases based on error rate and latency SLOs.

Open this question on its own page
03

How is chaos engineering integrated into CD pipelines?

Chaos engineering, pioneered by Netflix's Chaos Monkey, validates system resilience by deliberately injecting failures in a controlled way. Integrating it into CD pipelines means resilience is validated continuously, not just during periodic gamedays. In a CD pipeline for a staging or canary environment, chaos experiments can be automated: inject random pod termination (Chaos Monkey, Chaos Mesh), introduce network latency or packet loss between services (Istio fault injection), simulate disk failures, or exhaust CPU/memory on specific nodes. The pipeline monitors SLOs during the chaos injection period — if the service degrades beyond acceptable thresholds, the deployment is aborted before reaching more users. Tools include Chaos Mesh and LitmusChaos (Kubernetes-native), Gremlin (enterprise), and AWS Fault Injection Simulator. The key discipline is defining a "steady state hypothesis" — what normal looks like — before running experiments, so you can quantifiably confirm resilience was maintained.

Open this question on its own page
04

How does Terraform work in fully automated pipelines with plan PR comments and apply on merge?

A mature Terraform CI/CD pipeline implements the following flow. On a pull request: authenticate with the cloud provider using OIDC (short-lived tokens, no static secrets), run terraform init to configure the backend and download providers, run terraform fmt -check and terraform validate for syntax correctness, run terraform plan -out=plan.tfplan, and post the plan output as a PR comment using tools like github-actions-terraform or Atlantis. Policy gates run OPA or Checkov against the plan to reject non-compliant changes (e.g., unencrypted S3 buckets, overly permissive IAM policies). On merge to main: authenticate again via OIDC, download the saved plan artifact (to ensure apply matches what was reviewed), run terraform apply plan.tfplan, and post the apply output as a comment on the merged PR. State locking (DynamoDB) prevents concurrent applies. Using a saved plan file is critical — it ensures that the exact changes reviewed in the PR comment are applied, preventing race conditions where the infrastructure state changed between plan and apply.

Open this question on its own page
05

What is compliance as code and how do tools like OPA enforce it in pipelines?

Compliance as code encodes regulatory requirements, security policies, and operational standards as machine-readable rules that are automatically enforced in CI/CD pipelines, replacing manual compliance reviews. Open Policy Agent (OPA) is a general-purpose policy engine that uses the Rego language to express policies. In a CI/CD context: Terraform plans are validated against OPA policies before apply (e.g., "all S3 buckets must have server-side encryption enabled", "no security groups may allow 0.0.0.0/0 on port 22"); Kubernetes manifests are validated via OPA/Gatekeeper (admission controller) before being applied; Docker images must pass image scanning policies. Checkov provides pre-built compliance rules for Terraform, CloudFormation, and Kubernetes against CIS benchmarks, PCI-DSS, HIPAA, and SOC2. Compliance as code provides continuous compliance rather than periodic audits, gives developers immediate feedback on policy violations, and creates an auditable record that policies were enforced.

Open this question on its own page
06

What is software supply chain security and what are SLSA levels, SBOMs, and image signing?

Software supply chain security protects the integrity of artifacts (code, dependencies, container images) from source to production. A supply chain attack (like SolarWinds or the XZ Utils backdoor) compromises build tools, dependencies, or CI systems to inject malicious code into trusted software. Key concepts: SLSA (Supply-chain Levels for Software Artifacts) is a framework of four security levels. Level 1 requires a documented build process. Level 2 requires a tamper-evident build with provenance (who built what, when, how). Level 3 requires the build to run on a hardened, two-party reviewed build platform. Level 4 requires hermetic, reproducible builds. SBOM (Software Bill of Materials) is a complete inventory of all software components and their versions in an artifact, generated during CI (Syft, CycloneDX) and published alongside releases for vulnerability tracking. Sigstore/Cosign provides keyless container image signing — the CI pipeline signs the Docker image with a short-lived key tied to the build's OIDC identity, and deployment systems verify the signature before running the image, ensuring only CI-built images reach production.

Open this question on its own page
07

How do you optimize CI/CD pipeline performance at scale with distributed caching and remote build execution?

At scale (hundreds of developers, thousands of pipeline runs per day), pipeline performance requires systematic optimization. Distributed caching: tools like Bazel and Nx maintain a content-addressable cache keyed by inputs — if nothing in the dependency graph changed, the cached output is used instead of rebuilding. With a remote cache (NFS, GCS, S3), all developers and CI runners share the same cache, meaning one developer's build primes the cache for everyone. Remote build execution: Bazel's Remote Execution API (RBE) sends individual build and test actions to a pool of specialized workers (via BuildFarm or EngFlow), parallelizing work across many machines simultaneously — a build that takes 30 minutes locally takes 3 minutes with 10-way parallelism. Test result caching: skip re-running tests whose inputs (code, data) have not changed since the last passing run. Incremental Docker builds: use BuildKit's cache mounts and --cache-from to share layer caches between builds. Google's internal build system runs millions of build and test actions per day with sub-minute feedback using these techniques.

Open this question on its own page
08

How do you optimize cost in CI/CD infrastructure using spot instances and right-sized runners?

CI/CD infrastructure can be the largest cloud cost in an engineering organization — runner machines sit idle most of the day and must handle peak demand. Key optimization strategies: Spot/Preemptible instances: AWS Spot Instances and GCP Preemptible VMs cost 60-90% less than on-demand. CI jobs are naturally retry-able, making them excellent candidates for spot instances. If a spot instance is reclaimed, the CI system retries the job on a new instance. GitHub Actions Runner Scale Sets on Kubernetes automatically use spot node pools. Auto-scaling runner pools: use tools like actions-runner-controller (ARC) to scale from 0 to N runners based on queue depth and scale back to 0 during off-hours — paying only for what you use. Right-sizing: profile actual CPU and memory usage per job type — most jobs are I/O bound and do not need large instances; use 2-4 vCPU runners instead of defaulting to 8+. Pipeline caching: every cache hit avoids runner minutes. Conditional pipeline execution: skip expensive jobs (E2E tests, security scans) on draft PRs or non-critical branches. Artifact TTL policies: aggressively expire old build artifacts from storage to reduce S3/GCS costs.

Open this question on its own page
09

What does a CI/CD pipeline for ML models look like (model versioning, data validation, shadow deployment)?

CI/CD for ML (called MLOps or CD4ML) extends software CI/CD with additional concerns unique to machine learning. Data validation: before training, validate the training dataset for schema drift, missing values, and statistical distribution shifts using tools like Great Expectations or TFX Data Validation. Model training: the pipeline triggers training on new data or code changes, tracking experiments and hyperparameters in MLflow or Weights & Biases. Model evaluation: automatically evaluate the trained model against a held-out test set and compare metrics (accuracy, F1, AUC) to the current production model — only promote if the new model is better. Model versioning: store model artifacts in a model registry (MLflow Model Registry, Vertex AI Model Registry) with metadata, provenance, and approval workflows. Shadow deployment: deploy the new model alongside production (receiving a copy of traffic via mirroring) to compare predictions and latency in real production conditions before switching traffic. Continuous monitoring: after full deployment, track prediction distribution, data drift (feature statistics diverging from training distribution), and model performance degradation, triggering automatic retraining or rollback when metrics degrade.

Open this question on its own page
10

What is a security shift-left strategy in CI/CD and how is it implemented?

Shift-left security moves security testing and enforcement as early in the development lifecycle as possible — into the developer's workflow and CI pipeline — rather than relying on a security team review gate at the end. The earlier a vulnerability is found, the cheaper it is to fix. Implementation layers: Pre-commit hooks (Husky, pre-commit framework) run fast local checks before a commit is even pushed — secret scanning (detect-secrets, gitleaks), IaC security scanning (tfsec, Checkov), and basic linting. PR pipeline: SAST (Semgrep, CodeQL), dependency scanning (Snyk, OWASP Dependency Check), container image scanning (Trivy), and IaC policy validation (OPA, Checkov). Merge gates: block merges if critical vulnerabilities are found — defined severity thresholds prevent high/critical CVEs from entering the main branch. Continuous dependency monitoring: tools like Dependabot and Renovate automatically open PRs for dependency updates with security fixes. Secret scanning: GitHub Advanced Security, GitGuardian, and truffleHog scan commits and history for accidentally committed secrets. The cultural shift is equally important: developers are given security training, immediate actionable feedback in their workflow, and are responsible for fixing issues rather than handing them to a security team.

Open this question on its own page
Back to All Topics 50 questions total