InterviewStack.io LogoInterviewStack.io

Infrastructure as Code and Configuration Management Questions

Infrastructure as Code and Configuration Management covers designing, implementing, and operating infrastructure defined as code and the practices that keep that infrastructure consistent and auditable. Topics include Infrastructure as Code principles and patterns, declarative versus imperative approaches, idempotency, state management, module and template design for reusable infrastructure, version control integration, testing and validation of infrastructure code, drift detection and remediation, safe rollout and rollback strategies, policy as code and Git operations for infrastructure, and how to scan and remediate infrastructure misconfigurations. This topic also encompasses integration points with system configuration tools and considerations for managing secrets and secure defaults within infrastructure definitions.

EasyTechnical
26 practiced
Explain the sequence and purpose of Terraform commands in a typical workflow: 'terraform init', 'terraform validate', 'terraform plan', and 'terraform apply'. For each step, say what you would check in a PR and why 'terraform plan' should be part of automated PR checks.
HardTechnical
26 practiced
How would you incorporate database schema migrations into an IaC-driven deployment pipeline for a high-traffic production service? Describe safe rollout strategies (backfills, rolling migrations, feature toggles), backout procedures, coordination between infra and app teams, and how you would test schema changes to prevent data loss or downtime.
EasyTechnical
32 practiced
Describe how you would integrate Infrastructure-as-Code changes into a Git-based workflow for a team of developers and operators. Include the branch strategy, PR validation gates, required automated checks (name at least two), and how approvals should be managed to ensure safe production changes.
MediumTechnical
34 practiced
Write an Open Policy Agent (Rego) policy that denies resources that do not include a 'tags' map containing keys 'owner' and 'environment'. Provide the Rego policy and a short explanation of how you would evaluate Terraform plan output with this policy in CI to block merges.
MediumSystem Design
34 practiced
Design a Terraform repository layout and module strategy to support multiple environments (dev, staging, prod) with different configurations such as CIDR ranges and instance sizes. Describe directory layout, how you would isolate state per environment, how to parameterize modules, and how you would promote tested changes from dev to prod safely.

Unlock Full Question Bank

Get access to hundreds of Infrastructure as Code and Configuration Management interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.