PrepPilotPractise free

CI/CD & IaC interview questions

Git, pipelines, Terraform, Ansible

10 questions · git push · updated November 2026

Practise these as flashcards. One or two lines each; the ones you miss come back first.

Start free

Core questions

Explain CI/CD.

Continuous Integration builds and tests code automatically on every commit so problems show up early. Continuous Delivery promotes a tested build through environments automatically, with approval gates where the business wants them. From infra, I make sure the runners, targets, credentials and network paths are in place and monitored.

What is a build artifact?

The packaged output of a build, like a JAR, a zip or a container image, stored with a version in a repository so the exact same thing goes to every environment.

What is a pull request?

A request to merge a branch into main, with code review and automated checks first. For infra code it works like a change request.

Intermediate questions

Blue/green vs rolling vs canary?

Rolling updates a few servers at a time. Blue/green runs two full environments and flips the load balancer. Canary sends a small slice of traffic to the new version first. All of them rely on the LB and health checks.

The pipeline fails at deploy with 'connection refused'. What do you check?

Can the build agent reach the target on that port (SSH 22, WinRM 5985/5986)? Usually a missing firewall rule from the agent subnet, the service not running on the target, or wrong credentials. Test from the agent with nc -zv.

Terraform vs Ansible?

Terraform provisions infrastructure (VMs, networks, load balancers) and tracks it in state. Ansible configures what runs on the machines. They're often used together.

What is Terraform state and why keep it remote?

State maps your code to real resources. Kept remote (Azure Storage, S3) with locking, the team shares one source of truth and two people can't apply at the same time and corrupt it.

What does idempotent mean?

Running it once or ten times leaves the system in the same state. Ansible modules check before changing; a plain shell script usually doesn't.

Why use infrastructure as code?

Builds are repeatable and reviewable, changes are version-controlled, environments stay identical, and rollback is reverting a commit. No hand-built snowflake servers.

Senior questions

How do you handle secrets in pipelines?

Never in the repo. Store them in a vault (Azure Key Vault, HashiCorp Vault) or the CI tool's credential store, inject them at runtime, mask them in logs, and prefer short-lived identities like OIDC or managed identities over long-lived keys.

More Infrastructure Engineering topics