0
0
Terraformcloud~20 mins

Numeric functions (min, max, ceil) in Terraform - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terraform Numeric Functions Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
1:00remaining
Terraform min function output
What is the output of the following Terraform expression?

min(5, 3, 9, 1)
Terraform
min(5, 3, 9, 1)
A9
B3
C5
D1
Attempts:
2 left
💡 Hint
The min function returns the smallest number from the list.
service_behavior
intermediate
1:00remaining
Terraform max function output
What value does this Terraform expression return?

max(2.5, 7.1, 4.8, 6.0)
Terraform
max(2.5, 7.1, 4.8, 6.0)
A4.8
B6.0
C7.1
D2.5
Attempts:
2 left
💡 Hint
The max function returns the largest number from the list.
Configuration
advanced
1:30remaining
Using ceil function in Terraform
Given this Terraform expression:

ceil(4.3)

What is the output?
Terraform
ceil(4.3)
A5
B4
C4.3
DError: ceil expects an integer
Attempts:
2 left
💡 Hint
The ceil function rounds a number up to the nearest whole number.
Architecture
advanced
1:30remaining
Combining min, max, and ceil in Terraform
What is the output of this Terraform expression?

ceil(min(3.2, 5.7, 4.1) + max(1.5, 2.8))
Terraform
ceil(min(3.2, 5.7, 4.1) + max(1.5, 2.8))
A6
B7
C8
D5
Attempts:
2 left
💡 Hint
Calculate min and max first, then add and apply ceil.
security
expert
2:00remaining
Terraform numeric function misuse impact
If a Terraform configuration uses ceil on a negative float value like ceil(-3.7), what is the output and potential impact on resource scaling?
Terraform
ceil(-3.7)
A-4; may cause resource count to be lower than expected
B-3; may cause resource count to be higher than expected
C-3; no impact on resource scaling
DError; ceil does not accept negative numbers
Attempts:
2 left
💡 Hint
Remember how ceil rounds negative numbers.