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.

HardSystem Design
63 practiced

Design a scalable GitOps pipeline for managing infrastructure across multiple cloud accounts and clusters supporting dev/staging/prod. Requirements:

  • Declarative manifests live in Git
  • Automated reconciliation with drift detection
  • Role-based access controls per environment
  • Approval gates for production
  • Secure handling of secrets
    Describe repository layout, automation components (controllers, CI), workflows for PRs and merges, and rollback procedures for failed reconciliations.
MediumTechnical
72 practiced

Design a phased migration plan to move from manual SSH-based config changes to a fully automated GitOps model for a 200-server mixed environment. Include discovery, pilot, incremental enforcement, rollback plan, training, and metrics that demonstrate progress and safety.

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
90 practiced

Create a compliance plan that ensures every infrastructure change is auditable. Include signed commits or tags, branch protection policies, enforced code reviews, immutable release artifacts, retention of CI logs, and centralized change records. How would you demonstrate compliance during an external audit using Git history and CI artifacts?

HardSystem Design
72 practiced

Propose how Service Level Objectives (SLOs) and error budgets should be represented, versioned, and deployed via Git workflows alongside infrastructure code. Describe validation steps, who should review SLO changes, how SLO changes propagate to alerting and automation, and how to roll back SLO changes if they cause undesired automation behavior.

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.