InterviewStack.io LogoInterviewStack.io

Infrastructure as Code Tool Proficiency (Terraform/CloudFormation/Ansible) Questions

Deep proficiency in at least one IaC tool. For Terraform: understand resources, data sources, variables, outputs, local values, modules, state management, state locking, backend configuration (S3, Terraform Cloud), and best practices (remote state, sensitive variables, module organization). For CloudFormation: understand templates (YAML/JSON), stacks, parameters, conditions, mappings, resources, outputs, and intrinsic functions. For Ansible: understand playbooks, roles, inventory, variables, handlers, and idempotency. Write reusable, maintainable code: modules for Terraform, roles for Ansible. Understand code organization, naming conventions, and team collaboration practices.

HardSystem Design
31 practiced
Design an enterprise-scale Terraform architecture for a multi-region, multi-account AWS environment with thousands of engineers. Cover module registry approach, remote state isolation, cross-account role assumptions, CI/CD pipeline separation, drift prevention, secrets, and governance (policy-as-code). Provide a high-level diagrammatic description of components and responsibilities.
EasyTechnical
31 practiced
Describe approaches to manage secrets used by Terraform and Ansible: where to store secrets, how to avoid committing secrets into tfstate or playbooks, and patterns to inject secrets into runs securely (examples: HashiCorp Vault, AWS Secrets Manager, Ansible Vault, environment variables).
MediumTechnical
33 practiced
Discuss trade-offs between Terraform provisioners, CloudFormation cfn-init/user-data, and using Ansible for instance configuration. Recommend a pattern for bootstrapping application servers in a cloud-native environment and justify the recommendation.
HardTechnical
29 practiced
Write a test strategy for Ansible roles using Molecule in CI for both containerized and cloud-instance testing. Include how to mock external services, run tests in parallel, run testinfra/unit tests, and perform failure injection to validate error handling.
HardTechnical
26 practiced
A CloudFormation stack update partially succeeded and left resources in inconsistent states (some replaced, some updated). You must reconcile the stack and minimize downtime, especially for stateful resources like RDS. Walk through a safe reconciliation and rollback strategy, including snapshots, change sets, and manual steps.

Unlock Full Question Bank

Get access to hundreds of Infrastructure as Code Tool Proficiency (Terraform/CloudFormation/Ansible) interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.