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 16–19 of 19 questions
Learn Terraform →16.Your single state has grown huge and slow. What do you do?Senior
Split it into smaller stacks by how often things change and who owns them, such as network, data and apps. Move resources with moved blocks or state commands, share values through outputs and terraform_remote_state or a parameter store, and use Terragrunt or pipelines to run stacks in order.
17.Why use OpenTofu or HCP Terraform?Senior
OpenTofu is an open-source fork with a community license and extras such as state encryption, and it uses the same HCL for most code. HCP Terraform is a managed service that runs plans and applies, stores and locks state, keeps history and runs policy. The choice depends on license, cost and how much you want to run yourself.
18.What are the signs that a Terraform state is too big?Senior
Plans take many minutes, people wait for state locks, one mistake can touch unrelated systems, and teams need different access to different parts. These are the signs to split it into smaller stacks.
19.Someone applied from their laptop and broke prod. How do you stop it happening again?Senior
Make CI the only path: the production write role can only be assumed by the pipeline through OIDC, the state bucket is locked down, and every change needs a reviewed merge request with a plan. Add drift detection so manual changes are spotted quickly.