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.

MediumTechnical
91 practiced

Design a process and tooling to detect and reconcile configuration drift for critical infrastructure components (for example network ACLs or firewall rules). Explain how drift alerts are surfaced in Git workflows, when to auto-reconcile versus notify humans, and how to avoid fighting legitimate manual changes.

MediumSystem Design
91 practiced

Design release gates and approval workflows for a GitOps pipeline that must satisfy compliance requirements (auditable approvals for production). Describe where gates are enforced (CI, PR, Argo CD), what metadata should be stored in Git, and how to implement human approvals without breaking declarative principles.

EasyTechnical
85 practiced

Explain the key differences between application code and infrastructure-as-code with respect to side effects, idempotency, testing strategies, stateful behavior, and deployment workflows. Why do these differences change how you design Git workflows and code reviews for IaC?

MediumSystem Design
64 practiced

Design a secure, versioned configuration backup and storage solution for sensitive system configs. Requirements: immutable historical versions, encrypted at rest with key rotation, access logging for audits, retention policies, and fast retrieval for rollback. Describe storage choices, access control, and how to integrate with CI/CD for automatic backups pre-deployment.

MediumTechnical
87 practiced

An operator reports the cluster drifted because someone updated a Deployment directly on the cluster. Using Argo CD, explain how you'd detect this drift, alert the team, and define a policy for auto-sync vs manual reconciliation. Mention concrete Argo CD configuration knobs (e.g., app settings, autoPrune, project restrictions) you'd use.

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.