InterviewStack.io LogoInterviewStack.io

Infrastructure as Code and GitOps Questions

Defining and managing infrastructure and delivery state declaratively: provisioning as code (Terraform, CloudFormation, Pulumi, Ansible, Puppet), configuration management, idempotency, drift detection and remediation, and version control for infrastructure definitions, extended by GitOps where git is the source of truth for deployment and infrastructure state. Covers keeping environments consistent, treating config as a first-class versioned artifact, pull-based deployment and continuous reconciliation toward the committed state (ArgoCD, Flux, and similar controllers), Kubernetes manifest and configuration delivery via git, secrets handling for IaC and GitOps pipelines, policy-as-code guardrails (OPA, Sentinel), Terraform state management and locking, and auditable change through version control: branching strategy, pull request review, commit conventions, and code review policy for infrastructure code. Distinct from the CI/CD pipeline design topic, which owns generic pipeline structure and platform-scale release orchestration (build, test, artifact publishing, runner mechanics) and the architectural choice between push-based CI/CD and pull-based GitOps, even when the payload is infrastructure code. Distinct from the safe deployment and rollback strategies topic, which owns deployment-strategy mechanics: canary and blue-green traffic shifting, automated rollback triggered by metrics or SLOs, feature-flag progressive delivery, Kubernetes rollout mechanics (maxSurge, maxUnavailable, health-check gating), and database or schema migration safety as it gates a release, even when the delivery mechanism is GitOps. Distinct from the automation and scripting topic, which owns operational-scripting disciplines (retry and backoff logic, CLI tool design, generic file, checksum, or diff utilities) when the task is not specifically about declarative infrastructure or configuration state. This topic keeps the GitOps reconciliation loop itself, drift detection and remediation, and IaC state and module lifecycle management regardless of which adjacent discipline a question also touches.

HardTechnical
88 practiced

Design an automated system that comments on PRs with the Terraform plan, highlights destructive changes, runs tfsec and other static checks, and blocks merge on high-risk changes. Explain integration points (CI, webhooks, GitHub/GitLab APIs), how to present diffs in the PR in an actionable way, and methods to avoid leaking sensitive outputs (for example DB passwords) in PR comments.

EasyTechnical
80 practiced

Explain how you would use Git for a simple infrastructure change workflow. Cover steps from creating a branch, making changes to infrastructure-as-code (for example Terraform), committing, pushing, opening a pull request, running CI validations, and merging. Include example git commands and explain any differences compared to an application code change.

Example commands you can reference:

git checkout -b feat/update-vpc
git add .
git commit -m "feat(vpc): increase cidr range"
git push origin feat/update-vpc
MediumTechnical
84 practiced

Describe how you modeled Terraform modules for reusable data infrastructure (e.g., S3 buckets, EMR/Dataproc clusters, IAM roles): show module boundaries, variable design, remote state strategy and locking, testing of modules, and how you handled environment-specific (dev/staging/prod) differences and secrets.

HardTechnical
74 practiced

Discuss the trade-offs between using immutable image tags (digests) versus mutable tags (like 'latest' or 'v1') in a GitOps workflow. Explain how immutable tagging affects reconciliation, security (CVE remediation), reproducibility, and developer iteration. Propose a recommended tagging policy for production and for developer environments.

HardTechnical
77 practiced

Discuss strategies for managing large artifacts and state files that are part of infrastructure workflows (for example Terraform state snapshots, PKI binaries, or large AMI artifacts) without storing them directly in Git. Compare Git LFS, artifact repositories (Artifactory, S3), remote backends, and explain how your chosen approach integrates into PR reviews, CI, and access controls.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.