Top 30 Intermediate CI/CD & Automation Interview Questions and Answers
30 intermediate multiple-choice CI/CD & Automation interview questions, past the definitions: how the pieces fit together, what breaks in practice, and the trade-off behind a choice. They come from 30 bites in the CI/CD & Automation library, the middle slice of the 133 CI/CD & Automation interview questions in the library. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.
GitHub Actions, Terraform, ArgoCD, IaC, pipelines
30 questions. Pick an answer, or open “Show the answer” to read it.
Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.
Question 1 of 30
A company automatically deploys its internal tools to production but requires manual sign-off for its customer-facing payment service. What does this mixed strategy best demonstrate?
Show the answer
Answer: d · Different applications may require different pipeline models based on business risk and compliance needs.
The card stresses that the choice between Continuous Delivery and Continuous Deployment is driven by business context, regulatory requirements, and blast radius, and that organizations often run a mixed model. Option A reflects the common misconception that Delivery is just an inferior version of Deployment, while the correct answer captures the intentional, risk-based pipeline design described in the card.
Question 2 of 30
Which approach aligns with the 'build once, deploy many' principle when handling environment-specific database URLs?
Show the answer
Answer: d · Build the container image once, then provide the database URL via environment variables at deployment time
The correct answer preserves artifact immutability by externalizing configuration and deploying the same binary everywhere. Option C is tempting because build arguments appear to parameterize deployments cleanly, but they force per-environment rebuilds that can introduce unverified dependency changes.
Read the full bite: What is a build artifact and why build once deploy many crucial?
Question 3 of 30
Which scenario best describes a genuine shift-left practice rather than a common misconception?
Show the answer
Answer: b · Integrating static analysis into pull request builds so vulnerabilities are caught before merge
Integrating static analysis into pull request builds moves security feedback to the coding phase, which is the essence of shift left. Hiring more QA staff to test before release only increases test volume at the same late stage, confusing more testing with earlier feedback.
Read the full bite: What does shift left mean in CI/CD, and give two concrete examples?
Question 4 of 30
What key characteristic separates Infrastructure as Code from traditional imperative server scripting?
Show the answer
Answer: d · IaC defines the desired end state and achieves idempotence through automated reconciliation
True IaC is defined by its declarative, idempotent model that lets the platform reconcile to a desired state, not by the file format used. While IaC definitions are often written in JSON or YAML, simply using those formats without declarative idempotence is still just scripting.
Read the full bite: What is Infrastructure as Code (IaC), and how does it support CI/CD?
Question 5 of 30
In scaled Trunk-Based Development, what is the intended purpose of short-lived branches?
Show the answer
Answer: d · To perform code review and validation before merging to trunk within hours
Scaled Trunk-Based Development uses short-lived branches solely for review and CI validation before same-day integration to trunk, not for artifact publication or long-term isolation. Keeping branches for multiple days violates the core principle of integrating at least every 24 hours and reintroduces merge risk.
Read the full bite: Describe Trunk-Based Development principles and CI/CD benefits
Question 6 of 30
How does Trunk-Based Development allow a team to continuously deploy an unfinished multi-week feature without exposing it to end users?
Show the answer
Answer: d · Wrap the new code paths in a feature flag that defaults to off in production, allowing the same binary to deploy continuously while keeping the feature hidden.
Feature flags that default to off let teams integrate to main daily and deploy continuously while hiding incomplete behavior from users. The long-lived branch approach in option B contradicts Trunk-Based Development and reintroduces painful merge conflicts.
Read the full bite: How do feature flags enable unfinished work in Trunk-Based Development?
Question 7 of 30
When integrating a 50-commit stale branch that others may have pulled, which strategy best preserves shared history while validating pipeline stability?
Show the answer
Answer: c · Merge main into the feature branch locally, resolve conflicts, run full tests, and open a draft PR before merging
Merging main into the feature branch preserves commit hashes and shared history, while a draft PR exercises the full CI pipeline without spamming reviewers or triggering merge queues prematurely. Rebasing and force-pushing is dangerous because it rewrites public history and breaks every collaborator's local environment.
Read the full bite: How do you safely merge a 50-commit stale branch with conflicts?
Question 8 of 30
After establishing a baseline for a build time regression, what is the most effective next step before applying optimizations?
Show the answer
Answer: b · Decompose the pipeline into discrete stages and measure each stage's wall-clock time
The card stresses measuring each stage to find the actual bottleneck before applying optimizations. A applies parallelism prematurely, B suggests a wasteful platform migration without diagnosis, and D targets micro-optimizations instead of structural issues.
Read the full bite: Your build times increased significantly. How do you investigate and optimize?
Question 9 of 30
After a build tool automatically resolves a diamond conflict, what is the most critical next step before considering the issue fixed?
Show the answer
Answer: d · Run the full test suite and integration tests against the resolved version to detect binary incompatibility
The card emphasizes that semantic versioning does not guarantee binary compatibility, so the resolved version must be verified with full tests. Simply excluding the older transitive dependency or upgrading everything to latest skips runtime verification and risks hidden breaking changes.
Read the full bite: Explain dependency management and diamond conflicts in automated builds
Question 10 of 30
Which statement best captures a key operational tradeoff between ephemeral and persistent CI build agents?
Show the answer
Answer: b · Ephemeral agents reduce security patching burden through short lifecycles, while persistent agents require ongoing OS and toolchain maintenance
Ephemeral agents are short-lived, which minimizes patching and drift, whereas persistent agents accumulate state and need active maintenance. Distractor A is wrong because ephemeral agents can suffer from cold-start latency and repeated image pulls, and persistent agents can be more cost-effective when heavily utilized.
Read the full bite: Compare ephemeral container agents versus persistent build agents
Question 11 of 30
Which approach best balances speed and reliability when building a multi-arch CI pipeline for a compiled microservice targeting amd64 and arm64?
Show the answer
Answer: c · Use native runners for heavy builds, architecture-scoped remote caches, and manifest lists for distribution
The correct answer combines native runners for performance, architecture-scoped caches to prevent cross-arch poisoning, and manifest lists for clean distribution. Option A is tempting because centralizing on x86_64 seems simpler, but the card warns this causes a 5-10x QEMU slowdown and risks cache misses on one architecture invalidating another.
Read the full bite: How would you design a multi-arch build process and anticipate challenges?
Question 12 of 30
Which approach reliably automates blocking a merge when a pull request causes total project coverage to drop by more than two percentage points?
Show the answer
Answer: b · Generate a coverage report in CI, upload it to Codecov, set the project status threshold to 2 in codecov.yml, and require the Codecov project status in branch protection
This option correctly combines coverage artifact generation, Codecov upload, a project status threshold of 2, and branch protection enforcement. Option D is tempting because it uses the same tools, but patch coverage only measures lines changed in the PR rather than the overall project drop.
Read the full bite: How would you block merges when PR coverage drops 2%?
Question 13 of 30
When first adding SAST to an existing CI pipeline, which rollout strategy best prevents alert fatigue while still shifting security left?
Show the answer
Answer: b · Start in audit-only mode, tune rulesets to suppress false positives, and introduce merge-blocking gates for high and critical findings only after a calibration period
Starting in audit-only mode lets the team measure true positive rates and tune out noise before enforcing anything, which builds trust and avoids the alert fatigue that comes from blocking merges prematurely. Option C is a common trap because zero-tolerance blocking on day one creates toil and incentivizes developers to bypass the gate entirely.
Read the full bite: How would you integrate SAST into CI without alert fatigue?
Question 14 of 30
In a hybrid Docker tagging strategy, what distinguishes the role of a Git SHA tag from a SemVer tag at production deployment time?
Show the answer
Answer: d · The Git SHA tag provides an immutable source-to-artifact mapping used in deployment manifests, while SemVer offers human-readable labels for promoted releases.
Git SHA tags are immutable pointers created on every build to provide exact source-to-artifact traceability in manifests, while SemVer tags are human-readable aliases added only to promoted releases. Distractor C reverses this workflow: SHA tags are generated automatically per build, and SemVer is reserved for promoted images.
Read the full bite: How do you version Docker images: Git SHA or SemVer?
Question 15 of 30
Which capability best distinguishes a proxy repository from a simple file mirror?
Show the answer
Answer: b · It caches metadata and checksums while enforcing policies at the network edge.
A proxy repository is semantically aware: it caches metadata files and checksums, not just binaries, and enforces security policies before artifacts enter the network. Bandwidth reduction is a side benefit that a simple mirror could also provide, but it would lack the metadata handling and edge policy enforcement that make a proxy repository critical for supply-chain resilience.
Read the full bite: Explain proxy repositories in artifact managers and the problems they solve
Question 16 of 30
When promoting a tested JAR or image to production, which approach follows immutable artifact discipline?
Show the answer
Answer: a · Copy the exact binary or retag the immutable digest without rebuilding.
Copying or retagging the exact artifact guarantees that production receives the identical bits validated in staging, whereas rebuilding from cache is risky because base images, package indexes, or transitive dependencies may have drifted.
Read the full bite: Promote an artifact from staging to release without rebuilding it
Question 17 of 30
Which approach to sharing CI/CD logic best preserves team autonomy while following DRY principles in a PaC setup?
Show the answer
Answer: b · Build versioned, parameterized units that teams compose into their own pipelines
Versioned, parameterized units let teams reuse logic while controlling when they adopt changes, preserving independent release cadences. A single global pipeline (D) forces lockstep deployments and creates bottlenecks, while unversioned imports (A) risk breaking consumers unexpectedly.
Read the full bite: How would you reuse pipeline steps across projects using PaC principles?
Question 18 of 30
Which approach lets tests run on every branch while gating deploy to main only?
Show the answer
Answer: b · Add if: github.ref == 'refs/heads/main' to the deploy job
A job-level if condition is a native runtime conditional that keeps the test job in the DAG for all branches while skipping deploy when not on main. Using on.push.branches: main is a trigger filter that suppresses the entire workflow for other branches, so tests would never run there.
Read the full bite: How would you implement conditional logic in a pipeline?
Question 19 of 30
When converting a linear Jenkinsfile into a concurrent Declarative Pipeline, which practice best distributes workload without breaking dependencies?
Show the answer
Answer: a · Map which stages are independent, wrap them in a parallel block with stage-level agents, and keep the Jenkinsfile under version control.
Grouping only independent stages in a Declarative parallel block with stage-level agents spreads work across nodes while preserving required ordering for stages like compile or package. Relying on a top-level agent alone is wrong because parallel branches can still contend on a single executor without explicit per-stage agent allocation.
Read the full bite: How would you use PaC to introduce pipeline parallelism?
Question 20 of 30
When implementing a manual approval gate for production in pipeline-as-code, which approach best satisfies governance and auditability requirements?
Show the answer
Answer: c · Define the approval gate in code using protected environment reviewers, enforce that the approver belongs to a separate RBAC group, set a timeout with re-evaluation, and store immutable audit logs outside the pipeline workspace.
The correct answer captures the core governance pattern: the gate is defined in code, bound to least-privilege identity with separation of duties, bounded by timeouts and re-evaluation, and backed by immutable external audit trails. Option B is tempting because it mentions pipeline code and logs, but it fails to restrict approvers to a specific RBAC group and relies on standard pipeline logs rather than immutable external storage, missing non-repudiation requirements.
Read the full bite: Implement a manual approval gate for production deployment in pipeline-as-code
Question 21 of 30
When configuring Terraform for an RDS database, which approach best limits secret exposure across version history and state files?
Show the answer
Answer: a · Store the master password in AWS Secrets Manager with rotation enabled, reference the ARN in Terraform, and use an encrypted remote state backend
AWS Secrets Manager keeps the actual value out of code and enables automatic rotation and fine-grained access control, while an encrypted remote state backend prevents plaintext storage in state files. Passing the password via an environment variable is a common shortcut, but environment variables leak in process listings, crash reports, and potentially logs.
Read the full bite: How do you manage secrets within IaC configurations?
Question 22 of 30
When migrating a team from local to remote state, which requirement is most important to prevent corrupted infrastructure mappings?
Show the answer
Answer: d · Configuring a remote backend with state locking to serialize concurrent plan and apply operations.
State locking is the only mechanism that prevents race conditions when multiple engineers run apply simultaneously, which would otherwise overwrite resource mappings and corrupt state. Encryption, versioning, and IAM restrictions are important security and recovery measures, but none of them block concurrent modifications.
Read the full bite: Explain Terraform state, why managing it is critical, and team best practices
Question 23 of 30
An engineering team wants to spin up isolated test environments for every feature branch automatically. Which design best prevents cost leakage and cross-contamination while keeping environments truly ephemeral?
Show the answer
Answer: a · Use dynamic branch-based naming with automatic stop jobs and TTL policies to destroy resources after merge
Dynamic naming paired with automatic stop jobs or TTL policies guarantees isolated resources are destroyed when branches merge, preventing cost leakage. Persistent environments, manual runbooks, and shared backends are common anti-patterns that cause resource sprawl or cross-contamination.
Read the full bite: Design a CI/CD pipeline for ephemeral feature branch environments
Question 24 of 30
When a live production resource drifts from its approved Terraform definition, which response best reflects mature IaC governance?
Show the answer
Answer: a · Replace the resource through an automated pipeline using the approved definition
Replacing the resource through an automated pipeline enforces immutable redeployment and treats the IaC repository as the single source of truth. Option D is a common anti-pattern because updating code to match drift validates unauthorized live changes instead of reverting them.
Read the full bite: Define configuration drift in IaC. How do you detect and remediate it?
Question 25 of 30
Which approach best implements defense-in-depth for delivering database credentials to a Kubernetes application through CI/CD?
Show the answer
Answer: c · Fetch from an external secret manager via an operator, mount as a read-only volume, enforce least-privilege RBAC, and encrypt etcd at rest
This combines external secret management, volume mount isolation, least-privilege RBAC, and etcd encryption as the card recommends. Option A is tempting because it uses native Kubernetes objects, but ConfigMaps lack confidentiality design and default etcd encryption is not enabled without an EncryptionConfiguration.
Read the full bite: Describe secure secret injection into Kubernetes containers during CI/CD
Question 26 of 30
Which pattern best solves the secret zero problem for an app retrieving secrets from Vault in a Kubernetes cluster?
Show the answer
Answer: a · Use a projected service account token to authenticate to Vault via the Kubernetes auth method, obtaining a short-lived token through an init container or sidecar
Projected service account tokens let Vault verify identity through the Kubernetes API, yielding short-lived tokens without hardcoded credentials. Storing a root token in a Kubernetes Secret and mounting it as an environment variable merely shifts the secret zero problem one layer deeper and lacks platform attestation.
Read the full bite: How does your app authenticate with secrets management and solve secret zero?
Question 27 of 30
A team needs continuous drift detection for Kubernetes and configuration management for VMs and network gear with immutable audit trails. Which approach fits best?
Show the answer
Answer: d · Use GitOps with Kustomize for Kubernetes and Ansible for VMs and network gear.
The card states that hybrid VM and container estates often need both tools in tandem, using GitOps for Kubernetes drift detection and Ansible for diverse infrastructure. Option B is tempting because Kustomize overlays do become brittle beyond three to four environments, but abandoning GitOps sacrifices the required continuous drift detection and immutable audit trails for Kubernetes.
Read the full bite: Compare GitOps and Kustomize vs Ansible for environment configs
Question 28 of 30
When a readiness probe fails on a running Pod, what is the immediate consequence?
Show the answer
Answer: a · The container keeps running, but its IP is removed from matching Service endpoints.
Readiness failure causes the endpoint controller to remove the Pod's IP from Service endpoints, stopping new traffic while the container continues running. Option B is wrong because restarting the container is the kubelet's response to a liveness failure, not readiness.
Read the full bite: What are liveness and readiness probes, and what happens when each fails?
Question 29 of 30
When deploying a three-replica Apache Kafka cluster in Kubernetes, why is a StatefulSet the appropriate abstraction rather than a Deployment?
Show the answer
Answer: b · StatefulSets provide each broker with a stable ordinal hostname and a dedicated persistent volume that remains bound to that specific pod identity across rescheduling
A StatefulSet gives each Kafka broker a stable ordinal hostname and a dedicated PVC that follows the pod across rescheduling, which is required to preserve broker IDs and log segments. The most tempting distractor claims strong consistency guarantees, but the card explicitly notes that StatefulSets only provide stable infrastructure; the application itself must still handle consensus.
Read the full bite: Describe the difference between a Deployment and a StatefulSet
Question 30 of 30
Why should a CI/CD pipeline update the Deployment spec with a unique image tag rather than repushing the same :latest tag?
Show the answer
Answer: b · Updating the spec with a unique tag triggers a controlled rollout and ensures reproducible rollbacks
Updating the spec with an immutable tag changes the pod template, driving a controlled rolling update and enabling deterministic rollbacks. The tempting idea that imagePullPolicy: Always fixes :latest is wrong because the tag is mutable, so nodes pulling at different times can still end up running different images.
Read the full bite: How ensure Kubernetes pulls correct new image and why avoid :latest?
Could you explain these out loud?
That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.