Bird
Raised Fist0
GCPcloud~10 mins

Disaster recovery strategies in GCP - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a backup of a Cloud Storage bucket.

GCP
gsutil [1] gs://my-bucket gs://my-backup-bucket
Drag options to blanks, or click blank then click option'
Arm
Bcp
Crsync
Dmv
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cp' copies files but does not sync changes.
Using 'mv' moves files instead of copying.
Using 'rm' deletes files, which is not for backup.
2fill in blank
medium

Complete the code to create a snapshot of a Compute Engine disk.

GCP
gcloud compute disks snapshots create my-snapshot --disk=[1] --zone=us-central1-a
Drag options to blanks, or click blank then click option'
Amy-disk
Bmy-snapshot
Cmy-instance
Dus-central1-a
Attempts:
3 left
💡 Hint
Common Mistakes
Using the instance name instead of the disk name.
Using the snapshot name as the disk name.
Using the zone name as the disk name.
3fill in blank
hard

Fix the error in the Terraform code to enable multi-region replication for a Cloud Storage bucket.

GCP
resource "google_storage_bucket" "backup" {
  name     = "my-backup-bucket"
  location = [1]
  force_destroy = true
}
Drag options to blanks, or click blank then click option'
A"US"
B"US-CENTRAL1"
C"MULTI_REGIONAL"
D"us-central1"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a single region name instead of a multi-region.
Using incorrect casing for location names.
Using a string that is not a valid location.
4fill in blank
hard

Fill both blanks to configure a Cloud SQL instance for high availability with failover replicas.

GCP
resource "google_sql_database_instance" "primary" {
  name             = "primary-instance"
  database_version = "POSTGRES_14"
  region           = [1]
  settings {
    availability_type = [2]
  }
}
Drag options to blanks, or click blank then click option'
A"us-central1"
B"us-east1"
C"ZONAL"
D"REGIONAL"
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid region name.
Setting availability_type to ZONAL which disables failover.
Mixing region and availability_type values.
5fill in blank
hard

Fill all three blanks to define a Cloud DNS managed zone with private visibility for disaster recovery.

GCP
resource "google_dns_managed_zone" "private_zone" {
  name        = [1]
  dns_name    = [2]
  visibility  = [3]
}
Drag options to blanks, or click blank then click option'
A"private-zone-1"
B"example.internal."
C"private"
D"public"
Attempts:
3 left
💡 Hint
Common Mistakes
Using public visibility for private zones.
Omitting the trailing dot in dns_name.
Using invalid zone names.

Practice

(1/5)
1. What is the main goal of a disaster recovery strategy in cloud infrastructure?
easy
A. To improve user interface design
B. To keep services running during unexpected problems
C. To increase the speed of data processing
D. To reduce the cost of cloud services

Solution

  1. Step 1: Understand disaster recovery purpose

    Disaster recovery aims to keep systems available and data safe during failures or disasters.
  2. Step 2: Identify the main goal

    The main goal is to maintain service uptime and data integrity despite problems.
  3. Final Answer:

    To keep services running during unexpected problems -> Option B
  4. Quick Check:

    Disaster recovery = keep services safe [OK]
Hint: Disaster recovery means service stays up during trouble [OK]
Common Mistakes:
  • Confusing disaster recovery with cost saving
  • Thinking it improves speed or UI
  • Ignoring service availability
2. Which GCP service is commonly used to store backups for disaster recovery?
easy
A. Cloud Pub/Sub
B. Google Compute Engine
C. Google Kubernetes Engine
D. Google Cloud Storage

Solution

  1. Step 1: Identify backup storage service

    Backups need durable, scalable storage. Google Cloud Storage is designed for this.
  2. Step 2: Exclude compute and messaging services

    Compute Engine and Kubernetes Engine run workloads, Pub/Sub handles messaging, not backups.
  3. Final Answer:

    Google Cloud Storage -> Option D
  4. Quick Check:

    Backup storage = Cloud Storage [OK]
Hint: Backups go to Cloud Storage, not compute or messaging [OK]
Common Mistakes:
  • Choosing compute services for backup storage
  • Confusing messaging service with storage
  • Not knowing Cloud Storage purpose
3. Consider this GCP setup code snippet for disaster recovery:
resource "google_compute_instance" "primary" {
  name         = "primary-instance"
  zone         = "us-central1-a"
  machine_type = "e2-medium"
  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-11"
    }
  }
}

resource "google_compute_instance" "backup" {
  name         = "backup-instance"
  zone         = "us-central1-b"
  machine_type = "e2-medium"
  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-11"
    }
  }
}
What is the main benefit of this configuration for disaster recovery?
medium
A. It creates two instances in different zones to improve availability
B. It reduces the cost by using smaller machines
C. It backs up data automatically to Cloud Storage
D. It enables faster network speed between instances

Solution

  1. Step 1: Analyze instance zones

    The two instances are in different zones (us-central1-a and us-central1-b), which protects against zone failure.
  2. Step 2: Identify disaster recovery benefit

    Having instances in separate zones improves availability and fault tolerance during disasters.
  3. Final Answer:

    It creates two instances in different zones to improve availability -> Option A
  4. Quick Check:

    Multi-zone instances = better availability [OK]
Hint: Different zones mean better uptime during failures [OK]
Common Mistakes:
  • Assuming cost reduction is main goal
  • Thinking data backup happens automatically
  • Confusing network speed with disaster recovery
4. You have a disaster recovery plan that uses snapshots for backups. After a disaster, the recovery fails because snapshots are missing. What is the most likely error?
medium
A. Snapshots were stored in the same zone as the primary data
B. Snapshots were not scheduled regularly
C. Snapshots were encrypted with the wrong key
D. Snapshots were created from the wrong disk

Solution

  1. Step 1: Understand snapshot storage risk

    If snapshots are stored only in the same zone, a zone failure can destroy both primary data and backups.
  2. Step 2: Identify cause of missing snapshots

    Storing snapshots in the same zone risks losing them during a disaster affecting that zone.
  3. Final Answer:

    Snapshots were stored in the same zone as the primary data -> Option A
  4. Quick Check:

    Backups must be in different zones [OK]
Hint: Backups in same zone vanish with disaster [OK]
Common Mistakes:
  • Ignoring backup location importance
  • Assuming encryption or disk choice caused failure
  • Not scheduling snapshots regularly
5. You want to design a disaster recovery plan for a critical GCP application that must recover within minutes after a regional outage. Which combination of strategies is best?
hard
A. Use multi-zone deployment with weekly snapshots and manual recovery
B. Use single-zone deployment with daily manual backups to Cloud Storage
C. Use multi-region deployment with automated failover and continuous data replication
D. Use single-region deployment with monthly backups and no failover

Solution

  1. Step 1: Identify recovery time objective (RTO)

    Recovery within minutes requires fast failover and minimal data loss.
  2. Step 2: Evaluate strategies for fast recovery

    Multi-region deployment with automated failover and continuous replication ensures quick switch and up-to-date data.
  3. Step 3: Compare with other options

    Single-zone or single-region with manual backups are slower and risk data loss; weekly or monthly backups are too infrequent.
  4. Final Answer:

    Use multi-region deployment with automated failover and continuous data replication -> Option C
  5. Quick Check:

    Fast recovery needs multi-region + automation [OK]
Hint: Fast recovery needs multi-region and automation [OK]
Common Mistakes:
  • Choosing single-zone or single-region for critical apps
  • Relying on manual backups for quick recovery
  • Ignoring continuous data replication
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard