How do you manage Terraform state and drift?
How the interviewer asks it
“A team manages its cloud infrastructure with Terraform, but plans keep showing surprise changes and two engineers once applied at the same time. How would you set up state, locking, environments and the review flow?”
Typed drills are free and unlimited: the AI scores your answer against the outline below.
What the interviewer is looking for
- Remote state in a versioned, encrypted backend with locking.
- State split by environment and by blast radius, not one giant state.
- Plans produced in CI on every pull request and applied only from the pipeline.
- A drift detection job and a clear rule for handling console changes.
How to structure your answer
- 01
Backend
Remote state with locking, versioning and encryption; nobody keeps state on a laptop.
- 02
Layout
Separate state per environment and per component (network, data, apps) so one apply cannot break everything.
- 03
Workflow
Pull request runs fmt, validate and plan, posts the plan for review; merge triggers apply from CI with a single set of credentials.
- 04
Drift
Scheduled plans that alert on differences; manual changes are either imported into code or reverted.
- 05
Access
Read-only console access by default, with break-glass roles that are logged.
Best answers from candidates
No candidate answers yet. Type yours, and if it scores 6 or more you can show it here without your name.
Answers are shared by candidates, without names, after a privacy check. Add yours
Common mistakes
- Local state files or state committed to Git.
- Applying from laptops with personal credentials.
- Fixing drift by running apply without reading the plan.
Follow-up questions to expect
- Someone changed a security group by hand during an incident. How do you reconcile it?
- How do you move a resource between states without destroying it?
Now answer it out loud
Max will ask you this exact question, listen to your answer, push on the weak spots with follow-ups like the ones above, and score you when you finish.
Practice with MaxFree: a 5-minute voice round and unlimited typed drills, with scored feedback. No card, and your camera is never recorded.