0
0
GCPcloud~20 mins

Instance templates in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Instance Template Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Purpose of Instance Templates in GCP

What is the primary purpose of using an instance template in Google Cloud Platform?

ATo store data persistently across VM instance restarts.
BTo monitor the health of VM instances automatically.
CTo define a reusable configuration for VM instances that can be used to create managed instance groups.
DTo provide a graphical interface for managing VM instances.
Attempts:
2 left
💡 Hint

Think about how you can create multiple VMs with the same settings easily.

Configuration
intermediate
2:00remaining
Instance Template Configuration Output

Given the following instance template configuration snippet, what will be the machine type of the VM instances created from it?

GCP
resource "google_compute_instance_template" "example" {
  name         = "example-template"
  machine_type = "e2-medium"
  disk {
    source_image = "debian-cloud/debian-11"
    auto_delete  = true
    boot         = true
  }
  network_interface {
    network = "default"
  }
}
Ae2-medium
Bn1-standard-1
Ccustom-2-4096
Df1-micro
Attempts:
2 left
💡 Hint

Look at the machine_type field in the configuration.

Architecture
advanced
2:00remaining
Scaling with Instance Templates and Managed Instance Groups

You want to automatically scale your web application based on CPU usage. Which architecture best uses instance templates to achieve this?

ADeploy a serverless function instead of using instance templates for scaling.
BCreate a managed instance group using an instance template and configure autoscaling based on CPU utilization.
CUse instance templates only to create a single VM instance and scale by adding more templates.
DManually create individual VM instances from the instance template and monitor CPU usage yourself.
Attempts:
2 left
💡 Hint

Think about how to automate scaling with instance templates.

security
advanced
2:00remaining
Security Best Practice with Instance Templates

Which practice improves security when using instance templates for VM creation?

AInclude a startup script that installs the latest security patches automatically on boot.
BStore sensitive credentials directly in the instance template metadata.
CUse the default service account with full project permissions for all instances.
DDisable firewall rules to allow all incoming traffic for easier access.
Attempts:
2 left
💡 Hint

Consider how to keep instances secure and updated automatically.

service_behavior
expert
2:00remaining
Effect of Changing an Instance Template on Existing Managed Instances

You update an instance template used by a managed instance group. What happens to the existing VM instances in the group?

AThe managed instance group deletes all instances and creates new ones instantly.
BAll existing instances automatically update immediately to the new template configuration.
CThe instance template update fails if instances already exist in the group.
DExisting instances remain unchanged until you manually trigger a rolling update or recreate them.
Attempts:
2 left
💡 Hint

Think about how managed instance groups handle updates to templates.