JOBSEEKER?

Terraform Interview Questions

Practice for Terraform interviews by solving TestDome questions. Our interview questions are used by more than 7,000 companies and 450,000 individual test takers.

Jobseekers: Certify Your Knowledge

Take a Certification Test

Companies: Use Our Tests for Screening

Buy a Pack Of Candidates

Need to practice your Terraform scripting skills for an upcoming job interview? Try solving these Terraform interview questions that test knowledge of Terraform concepts such as modules, variables, loops, and other skills. We’ll provide feedback on your answers, and you can use a hint if you get stuck.

These Terraform questions are examples of real tasks used by employers to screen job candidates such as DevOps Engineers, Terraform DevOps Engineers, and others that require knowledge of Terraform.

1. Bridge Design

Easy 
Terraform Configuration Variable New Public

A bridge design company is using Terraform to manage containers for programs that compute bridge integrity. The following is a snippet from their main.tf file:

resource "docker_image" "bridge_integrity" {
  name = "bridge_integrity:latest"
}

resource "docker_container" "bridge_integrity_container" {
  count = length(var.container_names)
  image = docker_image.bridge_integrity.latest
  name  = var.container_names[count.index]
  ports {
    internal = 80 
    external = 80
  }
}

variable "container_names" {
  type = list(string)
  default = ["first", "second"]
}

What can be concluded from it?

(Select all acceptable answers.)


2. Public Park

Easy 
Terraform Configuration Modules Variable New Public

A company managing public parks is using Terraform modules for their web servers.

The following is a snippet from the module in the web_server folder:

variable "count_of_containers" {
  type = number
}

variable "port_number" {
  type = number
}

resource "docker_image" "park_web_image" {
  name = "parkweb:latest"
}

resource "docker_container" "park_web_server" {
  count = var.count_of_containers
  image = docker_image.park_web_image.latest
  name = "container-${count.index}"
  ports {
    internal = var.port_number
    external = var.port_number
  }
}

How can another module in the same project use it?

(Select all acceptable answers.)


If you feel ready, take one of our timed public Terraform Interview Questions tests:
Terraform

Terraform Online Test (Easy)

Not exactly what you are looking for? Go to our For Jobseekers section.
Dashboard Start Trial Sign In Home Tour Tests Questions Pricing For Jobseekers