INTERVIEW PREP
Interview questions
570 questions from real DevOps, SRE, platform engineering and MLOps interviews, with the answer an interviewer wants to hear. Try answering out loud first, then open the model answer.
Showing 91–105 of 178 questions
91.What does Git not protect in a GitOps setup?SeniorGitOps with Argo CD
Data in databases and volumes, and private keys for secret decryption. They need separate backups.
92.How is Argo CD different from Flux?SeniorGitOps with Argo CD
Both pull from Git and reconcile the cluster. Argo CD has a web UI, an Application object that shows sync and health, and ApplicationSets. Flux is made of smaller controllers with no UI of its own and fits well when you want everything as plain Kubernetes objects. The GitOps ideas are the same.
93.How do you stop a risky automatic deploy on Friday afternoon?SeniorGitOps with Argo CD
Add a sync window to the AppProject that denies syncs at those times, or use manual sync for production. A person can still be allowed to sync in an emergency with manualSync.
94.What stops prune from deleting something important?SeniorGitOps with Argo CD
Test with argocd app diff and sync --dry-run first, put the annotation argocd.argoproj.io/sync-options: Prune=false on objects that must stay, use PruneLast, and protect the config repo branch so changes are reviewed.
95.What is drift and how do you find it?SeniorTerraform
Drift is when real infrastructure differs from state and code, usually because someone changed it by hand. terraform plan -refresh-only shows it, and a scheduled pipeline with -detailed-exitcode can alert you. Then decide whether to copy the change into code or let apply undo it.
96.How would you run Terraform safely in CI/CD?SeniorTerraform
Run fmt, validate and plan on every merge request and show the plan to reviewers. Save the plan file. Apply only from the main branch, from that saved plan, in a manual or approved job, using short-lived cloud credentials and a locked remote state.
97.How do you test Terraform code?SeniorTerraform
From cheap to costly: fmt and validate, a linter such as tflint, security scans such as Checkov or Trivy, terraform test with plan or apply runs and assertions, and Terratest for real deployments that are destroyed afterward. Run the fast ones on every push.
98.What is policy as code, and how does it fit with Terraform?SeniorTerraform
You write rules, such as no public buckets or required tags, in a policy language like Rego (OPA/Conftest) or Sentinel. The pipeline converts the plan to JSON and checks it. A failed rule stops the pipeline before anything changes.
99.How do you version and release a shared module?SeniorTerraform
Use semantic versions and Git tags or a registry. Patch means fixes, minor means backward-compatible additions, major means breaking changes. Consumers pin ranges like ~> 1.2. Keep tests, docs, examples and upgrade notes with each release.
100.A password is marked sensitive. Is it safe in state?SeniorTerraform
No. Sensitive hides the value in plan and output, but it is still stored in state in plain text. Encrypt and restrict the state, read secrets at run time from a secrets service, and use ephemeral values or write-only attributes where the provider supports them.
101.How should CI log in to the cloud?SeniorTerraform
With OIDC. The CI job gets a short-lived token and exchanges it for temporary cloud credentials. Nothing long-lived is stored, so there is nothing to leak or rotate.
102.A plan fails with an unclear error. How do you debug it?SeniorTerraform
Read the full message, then use TF_LOG=DEBUG with TF_LOG_PATH to see the API calls, test the failing expression in terraform console, and check what state holds with state list and state show. Fix, then plan again until it reports no changes.
103.What is a good way to test that a module's variable validation works?SeniorTerraform
Write a terraform test file with a run block that uses command = plan and expect_failures = [var.NAME]. The test passes when the validation rejects the bad value.
104.What does a Terraform provider need to implement for each resource?SeniorTerraform
A schema that describes its fields, plus Create, Read, Update and Delete functions that call the service API. Read also removes the resource from state if the API says it no longer exists.
105.The state lock is stuck. What do you do?SeniorTerraform
Read the error to see the lock ID and who holds it, then check that no pipeline is still running for that stack. Only when you are sure the job died, run terraform force-unlock LOCK_ID, then terraform plan to confirm state is healthy. Prevent it with CI-only applies and job timeouts that let Terraform exit cleanly.