Skip to content

GCP Engineer interview questions

100 real questions with model answers and explanations for Cloud Engineer candidates.

See a GCP Engineer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Questions

resource-hierarchy

GCP organizes resources as organization, folders, projects, and service resources.

  • The organization is the top node for a company and can contain folders and projects.
  • Folders group projects by team, environment, or business unit and may be nested.
  • Projects contain resources such as VM instances, buckets, and databases.
  • IAM and organization policies applied higher in the hierarchy can be inherited below.

Why interviewers ask this: The interviewer checks whether you understand the main governance boundaries and policy inheritance in GCP.

A project is the main boundary for enabling APIs, assigning IAM access, tracking quotas, and attributing costs.

  • The project name is a human-readable label that can be changed and need not be unique.
  • The project ID is globally unique, chosen at creation, and cannot be changed later.
  • The project number is a unique numeric identifier assigned by Google.
  • Resources usually belong to one project even when they communicate with resources in another project.

Why interviewers ask this: A strong answer distinguishes a project's purpose from its three commonly confused identifiers.

billing

A billing account pays for usage from linked projects, while budgets and exports help track that usage.

  • A project must be linked to an active billing account to use most paid services.
  • Costs are recorded by project and can be further attributed with labels and billing data.
  • Budget alerts notify selected recipients at thresholds but do not automatically cap spending.
  • Cloud Billing export can send detailed cost and usage rows to BigQuery for analysis.

Why interviewers ask this: The interviewer wants to confirm that you know billing alerts provide visibility rather than a hard spending limit.

A region is a geographic area, while a zone is an isolated deployment area within a region.

  • A regional service can spread resources across zones, while a zonal resource lives in one zone.
  • Separate zones reduce exposure to a single facility failure but do not replace cross-region planning.
  • Choose a region based on user latency, data residency, service availability, and cost.
  • Examples are the region us-central1 and the zone us-central1-a.

Why interviewers ask this: This tests whether you can connect GCP location terms to availability and placement decisions.

Quotas limit resource consumption or request rates to protect capacity and prevent accidental overuse.

  • A quota may apply per project, region, service, or API metric.
  • Examples include CPUs in a region and API requests per minute.
  • Check quota usage before a planned deployment and request increases early because approval can take time.
  • Monitor usage near the limit instead of treating a quota error as a reason to retry indefinitely.

Why interviewers ask this: The interviewer evaluates whether you recognize quotas as planned service limits rather than unexpected product failures.

compute

Choose a machine family by matching the workload's CPU, memory, accelerator, and price needs.

  • General-purpose families such as E2 or N series fit web servers and balanced workloads.
  • Compute-optimized families fit CPU-heavy processing, while memory-optimized families fit large in-memory workloads.
  • Machine types provide fixed vCPU and memory combinations, and supported families also offer custom shapes.
  • Start from measured requirements and resize later rather than choosing the largest type by default.

Why interviewers ask this: A strong answer maps machine families to workload characteristics without relying on memorized product names alone.

compute

A Compute Engine image is a reusable template for creating boot disks with an operating system and initial software.

  • Public images are maintained by vendors such as Google, Debian, Ubuntu, and Microsoft.
  • Custom images capture a configured disk so the same baseline can be reused across instances.
  • An image family points to its latest non-deprecated image, which is useful for managed updates.
  • Pin an exact image version when a deployment must be reproducible.

Why interviewers ask this: The interviewer checks whether you understand images as boot disk templates and can explain version selection.

compute

Compute Engine mainly uses persistent block storage for durable boot and data disks, with Local SSD for temporary high-speed data.

  • Persistent Disk and Hyperdisk are separate resources, but an attached disk survives VM deletion only when its autoDelete setting is false.
  • Balanced and SSD-backed options trade price, IOPS, and throughput for different workloads.
  • Zonal disks reside in one zone, while regional persistent disks replicate across two zones in a region.
  • Local SSD is physically attached and its data is ephemeral, so it must not hold the only copy of important data.

Why interviewers ask this: The interviewer wants to see that you distinguish durable block storage from Local SSD and understand how autoDelete controls disk survival.

computesnapshot

A snapshot is an incremental point-in-time backup of a persistent disk that can create new disks later.

  • The first snapshot stores the needed blocks, and later snapshots store changed blocks while remaining independently usable.
  • Snapshots are separate resources, so deleting the source disk does not automatically delete them.
  • A restored disk can be created in a compatible zone or region chosen for the new workload.
  • For databases, coordinate flushing or application-aware backup steps when crash consistency is not enough.

Why interviewers ask this: A strong answer covers both snapshot mechanics and the difference between a storage snapshot and an application-consistent backup.

compute

An instance template is a reusable VM configuration used to create consistent instances and managed instance groups.

  • It can define the machine type, image, disks, metadata, network interfaces, and service account.
  • Templates are immutable, so a configuration change requires a new template rather than editing the old one.
  • Versioned templates make rollouts and rollbacks easier to understand.
  • Keep secrets out of startup scripts and template metadata, and retrieve them through an approved secret service.

Why interviewers ask this: The interviewer checks whether you know why immutable templates support repeatable VM creation.

autoscaling

A managed instance group maintains a group of similar VMs from an instance template.

  • A target size tells the group how many instances it should run.
  • Autoscaling can adjust that size from signals such as CPU utilization or load-balancing capacity.
  • Autohealing can recreate instances that fail a configured health check.
  • Rolling updates replace instances gradually when the group moves to a new template.

Why interviewers ask this: The interviewer evaluates whether you know the basic automation a MIG adds around a fleet of VMs.

spot

Spot VMs suit interruptible workloads because they cost less but Google Cloud can stop them at any time.

  • Good candidates include batch jobs, rendering, disposable workers, and fault-tolerant test workloads.
  • They have no availability SLA and must not be the only capacity for a workload that cannot tolerate interruption.
  • Save progress outside the VM and make work retryable so preemption does not lose the entire job.
  • A mixed managed instance group can combine regular and Spot capacity when some stable capacity is required.

Why interviewers ask this: A strong answer ties the discount to an explicit interruption model and a suitable workload.

networking

A GCP VPC is a global network that contains regional subnets and can connect resources across regions.

  • The network is not created separately in every region.
  • Each subnet owns an IP range in one region, and resources attach through that regional subnet.
  • Routes and firewall rules belong to the VPC and can support communication between its regions.

Why interviewers ask this: The interviewer checks the GCP-specific distinction between the scope of a VPC and the scope of its subnets.

networking

No, a GCP subnet has no built-in public or private type.

  • A VM's reachability depends on external IP assignment, routes, firewall rules, and the services around the subnet.
  • A VM with no external IP cannot receive a direct unsolicited connection from the internet.
  • Cloud NAT can provide outbound internet access for eligible resources without external IPv4 addresses.
  • Private Google Access lets eligible internal IPs reach supported Google APIs without assigning an external IP.

Why interviewers ask this: The interviewer wants a GCP-native networking model rather than an AWS subnet analogy.

networking

Routes tell traffic matching a destination prefix which next hop to use.

  • GCP creates subnet routes so resources can reach the IP ranges of VPC subnets.
  • Custom static routes can point to next hops such as a VPN tunnel or appliance VM.
  • Dynamic routes are learned through Cloud Router with BGP for hybrid connectivity.
  • Route selection considers the most specific destination, while lower numeric priority wins among applicable routes of the same specificity.

Why interviewers ask this: A strong answer separates packet forwarding decisions from firewall permission decisions.

networking

VPC firewall rules allow or deny ingress or egress traffic, and a lower priority number has higher precedence.

  • A rule specifies direction, action, protocols and ports, sources or destinations, and targets.
  • Priority 1000 is evaluated before priority 2000 when both rules otherwise apply.
  • VPC firewall rules are stateful, so allowed connection return traffic is permitted automatically.
  • The network has implied deny ingress and allow egress behavior unless higher-priority rules change the result.

Why interviewers ask this: The interviewer checks whether you can predict rule evaluation without confusing priority order.

networkingidentity

Firewall rules can target selected VM interfaces by network tag or by the VM's attached service account.

  • A target tag applies the rule to instances carrying that tag in the same VPC.
  • A target service account ties the rule to workload identity rather than an editable descriptive label.
  • Network tags used by firewall rules are not IAM roles and are different from resource labels.

Why interviewers ask this: The interviewer wants to see that you understand how firewall rules select workloads, not just IP ranges.

networking

VPC Network Peering privately connects two VPC networks so their resources can communicate through internal IP addresses.

  • It exchanges eligible subnet routes, so traffic stays on Google's network without requiring public IP addresses.
  • Each VPC keeps separate IAM policies and firewall rules; peering does not merge administration or create allow rules.
  • Peering is non-transitive: if VPC A peers with B and B peers with C, A cannot reach C through B.
  • Peered networks cannot have overlapping subnet IP ranges, so address planning must happen before the connection.

Why interviewers ask this: A strong answer covers private routing while retaining separate controls, non-transitivity, and non-overlapping address ranges.

dns

Cloud DNS is Google's managed authoritative DNS service for publishing DNS records.

  • A public managed zone answers queries from the internet, while a private zone is visible only to authorized VPC networks.
  • Record sets map names to data such as A, AAAA, CNAME, MX, or TXT values.
  • The TTL tells resolvers how long they may cache a record, so it affects how quickly a change is observed.

Why interviewers ask this: The interviewer checks whether you know the purpose of managed zones, records, and TTLs.

load-balancing

A Google Cloud load balancer accepts traffic on a frontend and distributes it to healthy backends.

  • The frontend defines an IP address, protocol, and port that clients use.
  • A backend service connects instance groups, network endpoint groups, or other supported backends to the load balancer.
  • Health checks keep unhealthy backends from receiving new traffic.
  • Application Load Balancers handle HTTP or HTTPS features, while Network Load Balancers serve Layer 4 traffic such as TCP or UDP.

Why interviewers ask this: The interviewer evaluates whether you understand the common request path and the Layer 7 versus Layer 4 distinction.

Locked questions

  • 21

    What is an IAM allow policy in GCP?

  • 22

    What is the difference between an IAM permission and an IAM role?

  • 23

    What is a service account, and how should a VM use one?

    identity
  • 24

    How do you apply least privilege in GCP IAM?

    least-privilege
  • 25

    What are IAM Conditions used for?

  • 26

    What are Application Default Credentials?

  • 27

    What problem does Workload Identity Federation solve?

    identity
  • 28

    How should you store a secret in GCP and audit access to it?

    secrets
  • 29

    What are buckets and objects in Cloud Storage?

    object-storage
  • 30

    How do Cloud Storage classes differ?

    object-storage
  • 31

    What does Object Versioning do in Cloud Storage?

    object-storageversioning
  • 32

    What are Cloud Storage lifecycle rules?

    object-storage
  • 33

    What does uniform bucket-level access change?

  • 34

    How do signed URLs and retention policies solve different Cloud Storage needs?

    retentionobject-storage
  • 35

    When would you choose Cloud Run, Compute Engine, or GKE?

    computeserverless-containerskubernetes
  • 36

    How does Cloud Run scale a service?

    serverless-containers
  • 37

    What does concurrency mean in Cloud Run?

    serverless-containersconcurrency
  • 38

    What is the current name and purpose of Cloud Functions in Google Cloud?

  • 39

    What is the relationship between a Pub/Sub topic and a subscription?

    messaging
  • 40

    How do acknowledgments, retries, and dead-letter topics work in Pub/Sub?

    messaging
  • 41

    What does high availability mean for a Cloud SQL regional instance?

    sql
  • 42

    What is a Cloud SQL read replica used for?

    sqlreplication
  • 43

    What type of workload is Cloud Spanner designed for?

    spannerdesign
  • 44

    What are datasets and tables in BigQuery?

    bigquery
  • 45

    How does partitioning reduce BigQuery query cost?

    queriespartitioningbigquery
  • 46

    What is the difference between a Docker image and a container?

    dockercontainers
  • 47

    What is a Kubernetes Pod in GKE?

    kubernetes
  • 48

    How do a Kubernetes Deployment and Service work together?

    kubernetesdeployment
  • 49

    What do Terraform state, plan, and apply do?

    terraform
  • 50

    What are the basic roles of Cloud Build and Cloud Monitoring?

    monitoringci-cd
  • 51

    A gcloud command changed the wrong project. How would you verify and fix the active account, project, and configuration?

    config
  • 52

    A Compute Engine VM has no external IP and your SSH connection fails. What would you check?

    computessh
  • 53

    A VM reports that its boot disk is full. How would you recover it safely?

  • 54

    A new VM starts, but its startup script did not install or launch the application. How would you debug it?

  • 55

    You manually repair one VM in a managed instance group, but the fix disappears after the VM is recreated. Why, and what should you change?

    autoscaling
  • 56

    A client cannot reach TCP port 443 on a VM. How would you debug the firewall without opening access to everyone?

    networking
  • 57

    A private VM without an external IP cannot download a public package through Cloud NAT. What would you check?

    networking
  • 58

    You changed a Cloud DNS record, but some users still receive the old address. How would you investigate?

    dns
  • 59

    A web server responds locally, but the Google Cloud load balancer marks its backend unhealthy. What would you check?

    load-balancing
  • 60

    A VM deployment fails with a quota exceeded error. What should you do next?

    deployment
  • 61

    A deployment receives PermissionDenied even though the user has an IAM role. How would you use Policy Troubleshooter?

    deployment
  • 62

    An application on a VM uses a downloaded service account key. How would you switch it to the VM's attached service account?

    identity
  • 63

    A user gets 403 when reading an object from a bucket with uniform bucket-level access. How would you fix it?

  • 64

    Before adding a Cloud Storage lifecycle rule that deletes old objects, how would you predict its effect safely?

    object-storage
  • 65

    A customer reports that a Cloud Storage signed URL has expired. What would you do?

    object-storage
  • 66

    A new Cloud Run revision is ready, but it receives no requests. What would you check?

    serverless-containers
  • 67

    The first request to an idle Cloud Run service is slow, while later requests are fast. How would you reduce the cold-start delay?

    serverless-containers
  • 68

    A Cloud Run service reaches its maximum instance setting during a burst and clients see long waits or rejected requests. What would you change?

    serverless-containers
  • 69

    A new Cloud Run revision fails to start because a required ordinary environment variable is missing or invalid. How would you diagnose and recover?

    serverless-containersconfig
  • 70

    A Cloud Run function should run for a storage event, but no invocation appears. How would you debug its Eventarc trigger?

    serverless-containersevents
  • 71

    A Pub/Sub message is redelivered while a slow consumer is still processing it. What would you change?

    messagingconcurrency
  • 72

    How would you make a Pub/Sub order consumer safe when the same message is delivered twice?

    messaging
  • 73

    How would you configure retries and a dead-letter topic for a Pub/Sub consumer that sometimes receives invalid messages?

    messagingconfig
  • 74

    A customer needs status events processed in order for each order, but different orders may run in parallel. How would you use Pub/Sub ordering keys?

    messagingconcurrency
  • 75

    An application cannot connect to Cloud SQL after moving to a new GCP environment. How would you debug private and public connection paths?

    sql
  • 76

    How would you perform a simple restore test for a Cloud SQL backup?

    sqlbackups
  • 77

    Before running an unfamiliar BigQuery query, how would you estimate the bytes it will process?

    queriesbigqueryestimation
  • 78

    A BigQuery query fails because two datasets are in different locations. What does that mean, and how would you fix it?

    queriesbigquery
  • 79

    A CSV load job into BigQuery fails with schema and parsing errors. How would you troubleshoot it?

    schemabigquery
  • 80

    A GKE Pod is stuck in ImagePullBackOff for an image in Artifact Registry. What would you check?

    artifactsregistrieskubernetes
  • 81

    A GKE Pod enters CrashLoopBackOff immediately after a deployment. How would you debug it?

    deploymentkubernetes
  • 82

    A Kubernetes Service in GKE exists, but it has no endpoints. What would you inspect?

    kubernetesendpoints
  • 83

    A GKE Pod remains Pending because its resource requests are too large. How would you resolve it?

    kubernetes
  • 84

    You updated a ConfigMap, but existing GKE Pods still use the old value. Why, and how would you roll out the change?

    configkubernetes
  • 85

    How would you use one Helm chart for a small application in dev and staging?

    helm
  • 86

    Terraform reports drift after someone changed a GCP resource in the console. What would you do?

    terraformiac
  • 87

    A Bash deployment script continues after a failed gcloud command and reports success. How would you make it fail safely?

    deployment
  • 88

    How would you reuse a simple Terraform configuration for dev and staging with variables and outputs?

    terraformconfig
  • 89

    Terraform plan unexpectedly proposes deleting a production resource. What would you check before any apply?

    terraform
  • 90

    A Cloud Build step fails because its service account lacks permission to deploy. How would you fix it?

    deploymentci-cdidentity
  • 91

    A developer cannot push a local container image to Artifact Registry, and the deployment later cannot find the tag. What would you check?

    containersdeploymentartifacts
  • 92

    How would you find HTTP 5xx requests for one Cloud Run service in Logs Explorer?

    serverless-containershttp
  • 93

    How would you add an uptime check and an actionable alert for a small public API?

    alertingapi
  • 94

    For a small checkout API, what basic SLI and SLO would you define?

    sloapi
  • 95

    A GCP budget alert reaches 80 percent halfway through the month. What should a junior engineer do?

    alerting
  • 96

    How would you use labels to attribute GCP costs for a shared dev project?

  • 97

    A team assumes the platform group owns every snapshot and backup. How would you clarify ownership?

    ownershipsnapshotbackups
  • 98

    A Terraform bootstrap for a new GCP project fails with SERVICE_DISABLED. How would you diagnose and fix it?

    terraform
  • 99

    A production VM appears unused, and you are asked to delete it. How would you make the change safely?

  • 100

    A two-person team has a stateless containerized webhook API with traffic from zero to 20 requests per second and no host-level needs. Would you use Compute Engine, GKE, or Cloud Run?

    containerskubernetesapi