All questions
of 32What is Terraform and how does it differ from other Infrastructure as Code tools?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Terraform is an open-source Infrastructure as Code (IaC) tool developed by HashiCorp that allows you to define and provision infrastructure using declarative configuration files. Unlike imperative tools that require you to specify step-by-step instructions, Terraform uses a declarative approach where you describe the desired end state.
Key differences from other IaC tools:
- Provider-agnostic: Works with multiple cloud providers (AWS, Azure, GCP, etc.)
- State management: Maintains a state file to track real-world resources
- Plan and apply workflow: Shows changes before applying them
- Immutable infrastructure: Replaces resources rather than modifying them in place
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
Explain the basic Terraform workflow.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
The Terraform workflow consists of four main steps:
- Write: Create configuration files (.tf) defining your infrastructure
- Initialize: Run
terraform initto download providers and modules - Plan: Run
terraform planto preview changes before applying - Apply: Run
terraform applyto create/modify/destroy infrastructure
terraform init
terraform plan
terraform apply
terraform destroy # when cleanup is needed
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What are Terraform providers and how do you configure them?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Providers are plugins that enable Terraform to interact with cloud platforms, SaaS providers, and APIs. They define resource types and data sources available for use.
Example AWS provider configuration:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = "us-west-2"
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
What is the difference between a resource and a data source in Terraform?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Resources are infrastructure components that Terraform creates, manages, and destroys. They represent the desired state of infrastructure.
Data sources allow Terraform to fetch information about existing infrastructure or external systems without managing them.
# Resource - creates new EC2 instance
resource "aws_instance" "web" {
ami = "ami-12345678"
instance_type = "t2.micro"
}
# Data source - fetches existing VPC info
data "aws_vpc" "default" {
default = true
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
The model's verdict: “”
The interactive diagram is below the answer - jump to diagram ↓
This answer is explained by a shared concept diagram - open →
Explain Terraform variables and their types.
What is the Terraform state file and why is it important?
How do you define outputs in Terraform and why are they useful?
What are the main Terraform configuration files and their purposes?
Explain the terraform init command and when you need to run it.
What is the difference between terraform plan and terraform apply?
Explain Terraform modules and their benefits.
What are Terraform workspaces and when should you use them?
Explain remote state backends and their advantages.
What are data sources and provide some practical examples?
Explain Terraform functions and provide examples.
What are provisioners and when should you avoid them?
Explain dynamic blocks and provide an example.
What are lifecycle rules and when do you use them?
How do you handle sensitive data in Terraform?
Explain count and for_each meta-arguments.
How do you implement advanced state management strategies?
Explain Terraform import and state manipulation commands.
How do you implement infrastructure testing strategies with Terraform?
Explain advanced module patterns and composition strategies.
How do you implement CI/CD pipelines for Terraform?
How do you handle Terraform state conflicts and corruption?
Explain custom provider development and plugin architecture.
How do you implement multi-cloud and hybrid cloud strategies with Terraform?
Explain Terraform performance optimization techniques.
How do you implement disaster recovery and backup strategies for Terraform?
How do you troubleshoot complex Terraform issues?
Explain advanced security practices for Terraform in enterprise environments.
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Terraform cheatsheet
Terraform Interview Cheat Sheet
- Summary01
- 1. Core Concepts02
- 2. Terraform Workflow03
- 3. Configuration Basics04
- 4. Variables05
- 5. Outputs06
- 6. Data Sources07
- 7. State Management08
- 8. Modules09
- 9. Provisioners (Use Sparingly!)10
- 10. Functions & Expressions11
- 11. Dependencies12
- + 9 more inside
28 of 32 Terraform answers are gated.
Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.
- Full answers + code
- AI explain - simpler, deeper, or visualized
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsLAMP
Linux, Apache, MySQL, PHPRuby on Rails
Convention over ConfigurationJAM
JavaScript, APIs, and MarkupServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQFastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseWeb3 / Ethereum
Solidity, Ethereum, Hardhat, FoundryDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.