Interview prep
Terraform Interview Questions
Terraform interviews centre on state management, module design and safe changes to live infrastructure.
Questions and answers
01What is Terraform state and why does it need remote storage?
State maps configuration to real resources. Remote backends with locking let a team share one source of truth and prevent two concurrent applies from corrupting it.
02Difference between count and for_each?
count indexes by integer, so removing a middle element re-indexes and destroys resources. for_each keys by a stable map or set key, so additions and removals are surgical.
03How do you bring an existing resource under Terraform?
terraform import, or an import block in newer versions, then write matching configuration until plan is clean.
04What is a module and how do you version it?
A reusable package of resources with inputs and outputs. Reference it from a registry or a Git tag and pin the version so consumers upgrade deliberately.
05How do you avoid destructive plans in production?
Review plans in CI, use lifecycle prevent_destroy on critical resources, separate state per environment, and apply behind approval.
How to answer these well
Interviewers are not grading recall — they are checking whether you've hit the failure mode the question describes. Anchor every answer to something you actually shipped or debugged with Terraform.
Say the trade-off out loud. "I'd use X here, but it costs Y under Z conditions" scores higher than a clean textbook definition every time.
Roles asking for Terraform
- Senior Staff Engineer - Tax Platform EngineeringGusto · Denver, CO;San Francisco, CA;New York, NY;Chicago, ILhybridstaffQuick applyPosted 4 hours ago
- Senior AI DevOps EngineerRoku · Austin, TexashybridseniorQuick applyPosted 5 hours ago
- Lead, Platform EngineeringMongoDB · GurugramhybridleadQuick applyPosted 10 hours ago
- Senior Platform EngineerMongoDB · GurugramhybridseniorQuick applyPosted 10 hours ago
- Platform Engineer, Battlespace AwarenessAnduril · Fort Collins, Colorado, United StatesonsitemidQuick applyPosted 13 hours ago
- Senior Software Engineer, Platform EngineeringKlaviyo · Boston, MAonsiteseniorQuick applyPosted 1 day ago
- Lead Software Engineer, Platform EngineeringKlaviyo · Boston, MAonsiteleadQuick applyPosted 1 day ago
- Software Engineer-Platform Engineering (L3)Twilio · Remote - US · RemoteremotemidQuick applyPosted 1 day ago
- Senior Software Architect, Platform EngineeringZscaler · San Jose, California, USAhybridstaffQuick applyPosted 1 day ago
- Executive Director, Digital Transformation & Platform EngineeringCVS · CT - HartfordonsiteleadPosted 2 days ago
Related prep
- DevOps Engineer jobs
- DevOps Engineer career guide
- Cloud Engineer jobs
- Cloud Engineer career guide
- Python interview questions
- Java interview questions
- JavaScript interview questions
- React interview questions
- AWS interview questions
- Azure interview questions
- Kubernetes interview questions
- Docker interview questions