InterviewStack.io LogoInterviewStack.io

Infrastructure as Code and Automation Questions

Defining, provisioning, and automating infrastructure programmatically. Covers declarative IaC with Terraform and comparable tools like CloudFormation (resource and provider model, state management and remote backends, module design and reuse, workspaces, drift detection, and safe plan/apply workflows), plus the broader automation discipline: provisioning pipelines, golden-image and machine-image building, scripting glue, self-service platforms, and end-to-end environment stand-up. The authoring, lifecycle, and automation of infrastructure code that reduces manual toil across provisioning workflows.

HardTechnical
22 practiced

As a senior engineer, you're asked to move a large legacy on-prem environment into IaC-managed cloud resources, essentially a hybrid-cloud migration. Walk through how you'd sequence this to keep risk low: discovery and inventory, deciding what to import versus rebuild from scratch, testing, and what the cutover runbook looks like.

HardTechnical
22 practiced

A CloudFormation stack update partially succeeds, some resources get replaced, others just updated, and now the stack is in an inconsistent state that includes a stateful resource like a database. How do you reconcile that stack and get back to a known-good state without taking the database down?

MediumTechnical
34 practiced

A repo has one large Terraform entrypoint that manages several environments and shared pieces of infrastructure. The team is having merge conflicts and accidental cross-environment changes. How would you reorganize the code so engineers can work in parallel with less risk?

HardTechnical
24 practiced

A Terraform apply died partway through and now the state looks wrong: some resource entries are missing or out of sync, and terraform plan wants to recreate things that absolutely must not be recreated. Walk me through how you'd recover.

HardTechnical
24 practiced

How do you make sure Terraform or CloudFormation never accidentally destroys a production resource on the next apply? Talk through the guardrails you'd put in place, from policy checks and manual approvals to how you'd recover quickly if a destroy did slip through.

Unlock Full Question Bank

Get access to all Infrastructure as Code and Automation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.