DevOpsInterview.Cloud
Cover of Infrastructure as Code: Terraform & OpenTofu Interview Questions
Book 3

Infrastructure as Code: Terraform & OpenTofu Interview Questions

50 questions · 8 chapters · 190 pages · 2026 edition

  • This bookPDF, 190 pages, emailed after payment

    ₹899
    Buy this ebook
  • All five books252 questions. Five books separately ₹4,495 · bundle ₹2,999 · you save ₹1,496 (33%)

    ₹2,999
    Buy all five books
  • The Interview-Day PlaybookCompanion guide for the week of the interview and the day itself

    Free with either

India: ₹899 a book or ₹2,999 for all five via Razorpay (GST included). Elsewhere: $9.99 a book or $31.99 for all five via PayPal. The exact total is shown before payment. Prices auto-convert to your local currency.

Read a sample answer

Inside

8 chapters · 50 questions

Chapter titles and question wording are taken from the book itself. Open a chapter to see its first questions.

  1. Chapter 1: State & Backends7 questions
    • How would you design Terraform state management across 200+ configurations with locking, isolation, and disaster recovery?
    • Which remote backend would you choose for Terraform, and how would you configure it?
    • A Terraform apply fails with "state locked by another operation." How do you handle it?
    • and 4 more
  2. Chapter 2: Modules, Providers & Dependencies6 questions
    • How do you design a reusable module and publish it to a private registry?
    • How do you version a shared Terraform module so consuming teams can upgrade safely?
    • How do you manage provider versions and upgrades across teams in production?
    • and 3 more
  3. Chapter 3: Drift & Reconciliation4 questions
    • How do you detect infrastructure drift before it bites you in production?
    • You've detected that a production security group was changed by hand. How do you reconcile that drift back into Terraform?
    • How do you stop configuration drift from happening across dozens of teams, instead of just detecting and fixing it?
    • and 1 more
  4. Chapter 4: Testing & Validation4 questions
    • How do you decide what to test at each layer of an Infrastructure as Code test pyramid, and where do you stop?
    • When is Terratest worth the cost, and what does a test actually do?
    • When would you reach for Terraform's native test framework instead of Terratest?
    • and 1 more
  5. Chapter 5: Security, Secrets, Policy & Compliance7 questions
    • How do you secure and govern Terraform at scale across many teams and cloud accounts?
    • How do you run static security scanning of Infrastructure as Code in the pipeline?
    • How would you enforce organization-wide guardrails on infrastructure changes before they apply?
    • and 4 more
  6. Chapter 6: Delivery: CI/CD, GitOps & Rollback6 questions
    • How would you design a CI/CD pipeline for Terraform or OpenTofu changes?
    • How do you run PR-driven plan and apply for Terraform with Atlantis or a TACoS platform?
    • How do you do zero-downtime, blue-green infrastructure changes with IaC?
    • and 3 more
  7. Chapter 7: Tooling Landscape & Multi-Cloud8 questions
    • Where does Terraform fall short, and when would you reach for something else?
    • When would you reach for Pulumi over Terraform or OpenTofu, and what do you trade away?
    • When would you reach for AWS CDK or CDKTF instead of plain Terraform or CloudFormation?
    • and 5 more
  8. Chapter 8: Scale, Cost, Performance & Platform8 questions
    • A plan that used to take two minutes now takes twenty. How do you speed it up?
    • How do you build cost visibility into an IaC workflow so spend is seen before it ships?
    • How do you scale Terraform across hundreds of accounts and many regions without it collapsing?
    • and 5 more

Before you pay

Format
PDF, readable on any device. 190 pages, about 37 MB.
Price and currency
₹899 (India, Razorpay, GST included) or $9.99 (elsewhere, PayPal). No other charges.
Delivery
A download link is emailed once the payment is confirmed. The link stays valid for 3 days; reply to the email to get a fresh one.
Support and refunds
Contact us for delivery problems or duplicate charges. Read the refund policy before buying: digital downloads are final once accessed.

Sample question

From chapter 1
From Book 3, Ch. 1Senior · Remote State · Backends

How would you design Terraform state management across 200+ configurations with locking, isolation, and disaster recovery?

What this tests

Whether you can reason about blast radius and isolation boundaries at scale, instead of reaching for one giant state file or treating workspaces as real separation.

30-second answer

I'd split state by isolation boundary, not by convenience: one backend key per environment per component, so a bad apply to staging networking can never touch prod databases. I use an S3 backend with native state locking (the use_lockfile option, GA in Terraform 1.11, so no separate DynamoDB table), versioning and KMS encryption on the bucket, and a strict naming convention like env/component/terraform.tfstate. Terragrunt keeps that backend config DRY across 200 stacks. DR is just bucket versioning plus cross-region replication, with a tested restore runbook.

Recall hook

One state per blast radius.

Follow-ups in the book

  • How do you recover a corrupted or accidentally deleted state file?
  • A lock is stuck after a crashed pipeline. What now?
  • How do you pass data between separate state files?

In the book this question runs three pages: it adds a deep dive with a diagram, a decision framework, a pitfalls table and a worked answer to each follow-up.

About this book

Senior-level Infrastructure as Code interview preparation built on Terraform and OpenTofu. Covers state management and remote backends, module design and versioning, drift detection and reconciliation, testing with the native terraform test framework and Terratest, secrets and policy-as-code, CI/CD and GitOps delivery, the tooling landscape and multi-cloud (Pulumi, AWS CDK, Crossplane), and platform, scale, and cost. Real interview questions answered the way a senior engineer actually would.

Who this ebook is for

Engineers interviewing for roles that use Terraform or OpenTofu to manage infrastructure safely at scale.

Topics covered

Terraform · OpenTofu · IaC · Infrastructure as Code · GitOps · Policy as Code

How every question is answered

  1. 1What the interviewer is really testing
  2. 2A 30-second answer you can say out loud
  3. 3A deep dive with a diagram
  4. 4A decision framework for the tradeoffs
  5. 5Pitfalls to avoid and signals of seniority
  6. 6Three follow-up questions, each answered
  7. 7A one-line recall hook

Every question runs three pages in this layout. Read an answer excerpt from this book or download the free 8-question PDF sample. The PDF sample is from Cloud Platforms, not from this book.

₹899
Buy this ebook