LearnThatStack Ace your next interview
Practice · Questions

All questions

Showing of 37
Beginner 12
01

What is Terraform and how does it differ from other Infrastructure as Code tools?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Terraform is HashiCorp's declarative Infrastructure as Code (IaC) tool. You describe the end state in configuration files, and Terraform works out the steps, where imperative tools make you script each step. Since version 1.6 its license is the Business Source License, which is source-available, not open source.

Compared with other IaC tools, three things stand out:

  • It is provider-agnostic. One workflow manages AWS, Azure, Google Cloud and many other services, while CloudFormation is AWS's own tool for AWS resources.
  • A state file maps the configuration to the real resources.
  • terraform plan previews each change before terraform apply makes it.
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

Explain the basic Terraform workflow.

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

You write configuration, initialize the directory with terraform init, then preview and make each change with terraform plan and terraform apply.

  1. Write configuration in .tf files that describe the resources you want.
  2. Initialize the directory with terraform init, which downloads the providers and modules it needs.
  3. Plan with terraform plan, which compares the configuration with the current state and previews the changes.
  4. Apply with terraform apply, which creates, updates or destroys resources to match and records the result in state.

Every later change goes through write, plan and apply again. When an environment is no longer needed, terraform destroy removes everything the configuration manages.

terraform init
terraform plan
terraform apply
terraform destroy  # when cleanup is needed
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What are Terraform providers and how do you configure them?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Providers are plugins that let Terraform work with cloud platforms, SaaS providers and other APIs. Each one defines the resource types and data sources you can use, such as aws_instance.

You configure a provider in two blocks. required_providers declares its source address and a version constraint, and terraform init downloads a matching release. The provider block sets options such as the region.

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

provider "aws" {
  region = "us-west-2"
}

Here ~> 5.0 accepts any 5.x release but never 6.0, so a major upgrade cannot arrive by surprise.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is the difference between a resource and a data source in Terraform?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A resource is an object Terraform creates, updates and destroys, and its block describes the desired state of that object. A data source only reads information about something that already exists, and never changes it.

Terraform records each resource in state and owns its whole lifecycle. A data source fetches attributes of an object managed elsewhere, or of an external system. You reference it with the data. prefix, as in data.aws_vpc.default.id.

# 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
}

Use a resource for infrastructure this configuration should own. Use a data source when it only needs to look something up, such as the default VPC.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

Explain Terraform variables and their types.

Part of Pro
06

What is the Terraform state file and why is it important?

Part of Pro
07

How do you define outputs in Terraform and why are they useful?

Part of Pro
08

What are the main Terraform configuration files and their purposes?

Part of Pro
09

Explain the terraform init command and when you need to run it.

Part of Pro
10

What is the difference between terraform plan and terraform apply?

Part of Pro
11

What are local values in Terraform, and how do they differ from input variables?

Part of Pro
12

Explain Terraform functions and provide examples.

Part of Pro
Intermediate 13
13

Explain Terraform modules and their benefits.

Part of Pro
14

What are Terraform workspaces and when should you use them?

Part of Pro
15

Explain remote state backends and their advantages.

Part of Pro
16

What are Terraform data sources, and what are some practical examples?

Part of Pro
17

What are provisioners and when should you avoid them?

Part of Pro
18

Explain dynamic blocks and provide an example.

Part of Pro
19

What are lifecycle rules and when do you use them?

Part of Pro
20

How do you handle sensitive data in Terraform?

Part of Pro
21

Explain count and for_each meta-arguments.

Part of Pro
22

What is drift in Terraform, and how do you detect and fix it?

Part of Pro
23

How does Terraform handle implicit and explicit dependencies between resources?

Part of Pro
24

What does terraform taint do, and what replaced it?

Part of Pro
25

What happens when terraform apply fails halfway, and how do you recover?

Part of Pro
Expert 12
26

How would you organize Terraform state for a large, multi-team infrastructure?

Part of Pro
27

Explain Terraform import and state manipulation commands.

Part of Pro
28

How do you implement infrastructure testing strategies with Terraform?

Part of Pro
29

Explain advanced module patterns and composition strategies.

Part of Pro
30

How do you implement CI/CD pipelines for Terraform?

Part of Pro
31

How do you handle Terraform state conflicts and corruption?

Part of Pro
32

Explain custom provider development and plugin architecture.

Part of Pro
33

How do you implement multi-cloud and hybrid cloud strategies with Terraform?

Part of Pro
34

Explain Terraform performance optimization techniques.

Part of Pro
35

How do you implement disaster recovery and backup strategies for Terraform?

Part of Pro
36

How do you troubleshoot complex Terraform issues?

Part of Pro
37

Explain advanced security practices for Terraform in enterprise environments.

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Terraform? Send them this set.
Pro · $10/mo

33 of 37 Terraform answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 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.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git