What is Infrastructure as Code, and why use it instead of clicking through the console?
What they are really testing: Whether you can articulate the concrete benefits, versioning, repeatability, review, automation, over manual setup, rather than just "it automates infrastructure".
A real interview question
What is Infrastructure as Code, and why use it instead of clicking through the console?
What most people say
drag me
“Infrastructure as Code means you automate creating your infrastructure with code.”
It states what it is but not why it beats the console: versioning, review, repeatability, consistency across environments, and avoiding undocumented snowflakes. Those benefits are the actual answer.
The follow-ups they ask next
What is a "snowflake" environment and why is it a problem?
A manually-built, undocumented environment that differs from others and cannot be reproduced. When it breaks or you need another like it, nobody knows the exact steps, so it is fragile and unrecoverable. IaC makes environments reproducible.
How does IaC help with disaster recovery?
Because the whole environment is defined in code, you can recreate it from scratch in another region/account reliably, rather than trying to remember and redo manual console steps under pressure.
What the interviewer is listening for
- Names versioning/review/repeatability/automation
- Mentions consistency across environments
- Knows it avoids snowflakes / is the source of truth
What sinks the answer
- Only "it automates infra"
- No concrete benefits
- Unaware of reproducibility/DR value
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“IaC means [defining infra in version-controlled config and provisioning from it, not the console]. Benefits: [repeatable/consistent environments (dev=prod, rebuildable, DR)], [versioned + peer-reviewed in git with rollback], [automatable in CI/CD], and [no undocumented snowflakes, the code is the source of truth]. The console is [fine for exploring, not for anything maintained].”
Keep going with iac & automation
Foundation
What is the difference between declarative and imperative infrastructure as code?
Junior
What is Terraform state, and why does it exist?
Junior
Explain the Terraform workflow: init, plan, and apply.
Mid
Your team provisions infrastructure with code. Why does idempotency matter, and what breaks without it?
Mid
Why do teams use remote state with locking instead of local state?
Mid
What are Terraform modules, and how do they help?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free