Question 7 of 519
Understand IaC conceptshardMultiple SelectObjective-mapped

Quick Answer

The correct answer is that imperative approaches can lead to configuration drift because step-by-step instructions may produce unintended states, while declarative IaC defines the desired end state and lets the tool determine the steps. This distinction is fundamental: with declarative IaC, as in Terraform using HCL, you simply declare "I want an EC2 instance with ami-abc123 and type t2.micro," and Terraform automatically figures out the create, update, or delete actions needed to reach that state. In contrast, imperative IaC, like a series of AWS CLI commands, explicitly dictates each step—run-instances, wait, tag—which risks drift if a step fails or the environment changes between commands. On the HashiCorp Terraform Associate TF-003 exam, this concept tests your understanding of why Terraform’s declarative model prevents drift and ensures idempotency. A common trap is confusing Ansible’s declarative YAML with imperative scripting; remember, if you’re telling the tool *how* to do it step-by-step, it’s imperative. Memory tip: "Declarative = *what*; Imperative = *how*."

TF-003 Understand IaC concepts Practice Question

This TF-003 practice question tests your understanding of understand iac concepts. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Which two statements accurately describe the difference between declarative and imperative IaC approaches? (Choose two.)

Question 1hardmulti select
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Declarative focuses on the desired outcome, while imperative specifies step-by-step commands

Option C is correct because declarative IaC, as used in Terraform with HCL, allows you to define the desired end state of infrastructure (e.g., 'I want an AWS EC2 instance with AMI ami-0c55b159cbfafe1f0 and instance type t2.micro'), and the tool automatically determines the necessary steps to achieve that state. In contrast, imperative IaC, such as using AWS CLI commands or Ansible playbooks with explicit 'command' modules, requires you to specify each step (e.g., 'run aws ec2 run-instances, then wait, then tag'). This fundamental difference in approach is a core concept in the TF-003 exam.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Imperative is only used for scripting, not IaC

    Why it's wrong here

    Imperative approaches can be used for IaC, e.g., using shell scripts or PowerShell DSC.

  • Declarative tools are always faster than imperative tools

    Why it's wrong here

    Speed depends on various factors, not the approach alone.

  • Declarative focuses on the desired outcome, while imperative specifies step-by-step commands

    Why this is correct

    This is the fundamental difference.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Imperative can lead to configuration drift because steps may cause unintended states

    Why this is correct

    Imperative scripts can produce different results if run from different starting states.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Declarative eliminates the need for idempotency

    Why it's wrong here

    Declarative tools are inherently idempotent; they don't eliminate the concept.

Common exam traps

Common exam trap: answer the scenario, not the keyword

HashiCorp often tests the misconception that declarative IaC eliminates the need for idempotency, but in reality, declarative tools enforce idempotency through state management and plan generation, making it a key feature rather than an omission.

Detailed technical explanation

How to think about this question

Under the hood, declarative tools like Terraform use a state file (terraform.tfstate) to track the current infrastructure, then compute a 'diff' against the desired configuration to generate an execution plan. This plan explicitly shows what will be created, modified, or destroyed, ensuring idempotency. A real-world scenario where this matters is managing a multi-region deployment: a declarative approach can safely add a new region without affecting existing ones, while an imperative script might accidentally skip or duplicate steps if not carefully written.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related TF-003 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free TF-003 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this TF-003 question test?

Understand IaC concepts — This question tests Understand IaC concepts — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Declarative focuses on the desired outcome, while imperative specifies step-by-step commands — Option C is correct because declarative IaC, as used in Terraform with HCL, allows you to define the desired end state of infrastructure (e.g., 'I want an AWS EC2 instance with AMI ami-0c55b159cbfafe1f0 and instance type t2.micro'), and the tool automatically determines the necessary steps to achieve that state. In contrast, imperative IaC, such as using AWS CLI commands or Ansible playbooks with explicit 'command' modules, requires you to specify each step (e.g., 'run aws ec2 run-instances, then wait, then tag'). This fundamental difference in approach is a core concept in the TF-003 exam.

What should I do if I get this TF-003 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more ways this is tested on TF-003

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A team is evaluating Terraform and Ansible for infrastructure provisioning. They note that Terraform describes the desired end state, while Ansible defines steps to reach that state. This difference is best described as:

easy
  • A.Declarative vs imperative
  • B.Client-server vs agentless
  • C.Immutable vs mutable
  • D.Push vs pull

Why A: Option C correctly identifies the declarative vs imperative paradigm. Option A (immutable vs mutable) describes update strategies. Options B and D are architectural patterns.

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This TF-003 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-003 exam.