Terraform interviews have a distinctive shape: almost every hard question is secretly a question about state . Providers, modules and HCL syntax are easy to learn on the job; what interviewers probe is whether you understand what Terraform believes about the world, where that belief lives, and what happens when it diverges from reality. Here are the questions that come up in real senior screens, with the answers that survive follow-ups.
State: where every interview goes first
1. What is the state file, and why does Terraform need one at all?
State maps your configuration's resource addresses to real provider object IDs, and caches attributes. Without it, Terraform could not know that aws_instance.web is instance i-0abc123 , so it could not plan updates or deletes. The follow-up is usually "couldn't Terraform just query the cloud instead?" Partially, and that is what import and refresh do, but tags and names are not reliable identity, and many resources have no queryable natural key.…