Terraform interview question

What happens if two engineers apply at the same time without state locking?

Scenario Asked in DevOps Engineer · Cloud Engineer · Site Reliability Engineer (SRE) interviews

Members can save this page, take notes and track progress. See membership · Sign in

Summary

Both reads succeed, both compute a plan against the same snapshot, and both try to write back. One write overwrites the other, so the state file no longer reflects what actually exists: resources created by the overwritten apply become "orphans" that Terraform does not know about, and the next plan may try to recreate things that already exist or skip resources that were deleted.

Keep reading with a membership

The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.

See plans and free trial Already a member? Sign in

More Terraform questions

← All Terraform questions

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake