What is Infrastructure as Code and why do teams use it instead of the cloud console?
What the interviewer wants to hear
- Infrastructure is defined in versioned files and created by a tool
- Repeatable, consistent environments for dev, staging and prod
- Changes are reviewed through pull requests and plans
- Easier recovery and audit history from version control
- Declarative tools like Terraform or OpenTofu track state
Model answer
Infrastructure as Code means describing networks, servers, databases and permissions in text files, then letting a tool such as Terraform, OpenTofu or CloudFormation create and update them. The files live in version control, so every change has an author, a review and a history. Teams use it because it makes environments repeatable: dev, staging and prod come from the same modules with different variables, so they do not drift apart. A plan step shows exactly what will change before anything happens, which makes reviews safer than clicking in a console. It also speeds up recovery, because you can rebuild an environment from code after a disaster. Declarative tools keep state and compare it with the real world, so they can detect drift when someone does make a manual change.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy Cloud Engineer questions
- Explain the difference between IaaS, PaaS and SaaS with an example of each.
- What is a VPC and what are its main building blocks?
- Explain IAM users, groups, roles and policies. When would you use a role instead of a user?
- How would you make a simple web application highly available in the cloud?
- What pricing models do cloud providers offer for compute, and when would you use each?
- What is the difference between containers and virtual machines, and when would you choose each?
- Explain metrics, logs and traces. How does each help you run a cloud application?
- How does a CDN work, and what should you consider when caching content with one?
- Compare block, object and file storage in the cloud. Give a use case for each.