Courseiva

Google Associate Cloud Engineer (ACE) — Questions 376450

769 questions total · 11pages · All types, answers revealed

Page 5

Page 6 of 11

Page 7
376
MCQmedium

A developer needs to authenticate to Google Cloud from their local machine to run application code that reads from Cloud Storage. They use a service account. Which gcloud command should they use to obtain application credentials?

A.gcloud auth login
B.gcloud config set account service-account@project.iam.gserviceaccount.com
C.gcloud auth application-default login
D.gcloud auth activate-service-account --key-file=KEY_FILE
AnswerD

The command `gcloud auth activate-service-account --key-file=KEY_FILE` is the correct way to authenticate gcloud with a service account using its private key JSON file. It reads the key file, derives the service account email, and establishes that identity as the active authenticated account for gcloud CLI operations. This command both authenticates and activates the service account in one step, enabling subsequent gcloud commands to inherit that identity.

Why this answer

The command 'gcloud auth application-default login' obtains user credentials for Application Default Credentials (ADC). For a service account, they would use 'gcloud auth activate-service-account' or set the GOOGLE_APPLICATION_CREDENTIALS environment variable.

377
Multi-Selecteasy

A company wants to analyze terabytes of structured data using SQL queries. The data is stored in CSV files in Cloud Storage. Which TWO Google Cloud services can be used together to query the data directly without loading it into a database? (Choose 2)

Select 2 answers
A.BigQuery
B.Cloud SQL
C.Dataproc
D.Dataflow
E.Cloud Storage
AnswersA, E

BigQuery is correct because it is a serverless, fully-managed data warehouse that can run SQL queries over terabytes of structured data with high speed. It supports direct querying of external data in Cloud Storage through federated queries or external tables, avoiding the need to import data. BigQuery's columnar storage and massive parallelism make it the appropriate analytical engine for this scenario.

Why this answer

BigQuery can query external data sources using external tables or federated queries, including Cloud Storage. Cloud Storage is the storage location for the CSV files. BigQuery can directly query files in Cloud Storage using an external table or a federated query.

378
MCQmedium

A developer has deployed a Cloud Run service but receives a 503 error when accessing it. The service logs show 'The request was aborted because there was no available instance.' What is the most likely cause?

A.The minimum number of instances is set too high.
B.The container health checks are failing.
C.The service is experiencing a spike in traffic and the max instances are too low.
D.The service's memory limit is set too low.
AnswerC

The error 'no available instance' occurs when a request arrives and all existing Cloud Run instances are processing requests, and the service has already reached its configured maximum number of instances. Cloud Run can only scale out to the max-instances setting; if that cap is too low relative to a spike in traffic, new requests are rejected with HTTP 503 and this log message. Increasing max instances or using instance-based concurrency tuning can mitigate this.

Why this answer

The 503 error with the message 'The request was aborted because there was no available instance' indicates that all current instances are saturated and Cloud Run cannot scale up quickly enough to handle the incoming requests. This occurs when traffic spikes exceed the configured maximum number of instances, causing new requests to be rejected until an instance becomes free. Option C correctly identifies that the max instances setting is too low for the traffic spike.

Exam trap

Google Cloud often tests the distinction between scaling limits (max instances) and resource constraints (memory/CPU), where candidates mistakenly attribute 503 errors to resource limits rather than the explicit scaling cap.

How to eliminate wrong answers

Option A is wrong because setting the minimum number of instances too high would keep idle instances running, which would reduce cold starts and help handle traffic, not cause a 503 due to no available instances. Option B is wrong because failing container health checks would cause the instance to be marked unhealthy and removed from serving, but the error message specifically states 'no available instance' rather than 'unhealthy instance' or 'health check failure'. Option D is wrong because a memory limit set too low would cause the container to be killed (OOMKilled) or return 502/504 errors, not a 503 with the specific 'no available instance' message.

379
MCQhard

Your team uses Cloud Build to build and push Docker images to Artifact Registry. A new security requirement mandates that only images signed by Cloud Build (using Binary Authorization with attestors) can be deployed to your GKE cluster. Which sequence of steps correctly implements this?

A.Enable BinAuthz on the GKE cluster; Cloud Build automatically signs images when BinAuthz is enabled.
B.Create a Cloud KMS key and attestor, configure Cloud Build to create attestations post-build, then set a BinAuthz policy requiring the attestation on the GKE cluster.
C.Use Artifact Registry vulnerability scanning; images that pass scanning are automatically trusted by GKE.
D.Add a Cloud Build step that runs `gcloud container binauthz attestations sign-and-create` without additional configuration.
AnswerB

The correct workflow is to provision a Cloud KMS asymmetric signing key, create a Container Analysis note, and define a Binary Authorization attestor that references both the note and the KMS key. After that, add a Cloud Build step (for example, using the `gcloud container binauthz attestations sign-and-create` command or the official attestation helper) to sign the image digest and create an attestation in Container Analysis. Finally, set the BinAuthz admission policy on the GKE cluster to require attestations from that attestor; the cluster then permits only images bearing a valid signature. This sequence maps the cryptographic trust chain to the actual enforcement point.

Why this answer

It follows the required workflow: you must first create a Cloud KMS key and an attestor in Binary Authorization, then configure Cloud Build to generate an attestation (signed by the attestor) after each successful build. Finally, you set a Binary Authorization policy on the GKE cluster that enforces the attestation, ensuring only signed images are deployed. Cloud Build does not automatically sign images when BinAuthz is enabled; the attestation must be explicitly created.

Exam trap

Google Cloud often tests the misconception that enabling Binary Authorization on a cluster automatically integrates with Cloud Build to sign images, when in fact you must manually create the attestor, key, and attestation step.

How to eliminate wrong answers

Option A is wrong because enabling Binary Authorization on the GKE cluster does not cause Cloud Build to automatically sign images; Cloud Build requires explicit configuration to create attestations using an attestor and signing key. Option C is wrong because Artifact Registry vulnerability scanning only identifies vulnerabilities and does not create cryptographic attestations; GKE does not automatically trust scanned images without a Binary Authorization policy requiring attestations. Option D is wrong because the `gcloud container binauthz attestations sign-and-create` command requires a properly configured attestor and signing key (e.g., Cloud KMS) to be in place; simply adding the command as a build step without prior setup of the attestor and key will fail.

380
MCQmedium

A Compute Engine VM with only a private IP address needs to download software updates from the internet (apt-get update). What must be configured in the VPC to enable outbound internet access for private VMs?

A.Enable Private Google Access on the subnet
B.Configure Cloud NAT on the VPC's Cloud Router for the subnet
C.Add an external IP address to the VM temporarily for the update, then remove it
D.Create a VPC firewall rule allowing egress to 0.0.0.0/0 on port 80 and 443
AnswerB

Configuring Cloud NAT on the VPC's Cloud Router for the subnet is correct because it provides source network address translation for instances with private IPs. The NAT gateway maps the private source addresses to a shared public IP, allowing outbound internet connections while keeping the instances themselves unreachable from the outside. This makes apt-get, pip, and similar package managers work without assigning per-VM external IPs.

Why this answer

Cloud NAT (Network Address Translation) allows private VMs without external IP addresses to initiate outbound connections to the internet. It translates the VM's private IP to a public IP managed by Cloud NAT, enabling apt-get update to reach external repositories. This is the correct and scalable solution for outbound-only internet access from private instances.

Exam trap

Google Cloud often tests the distinction between Private Google Access (for Google APIs only) and Cloud NAT (for general internet access), leading candidates to mistakenly choose Private Google Access when the requirement is for outbound internet access to non-Google endpoints.

How to eliminate wrong answers

Option A is wrong because Private Google Access only enables VMs with private IPs to reach Google APIs and services (e.g., Cloud Storage, BigQuery) via Google's internal network, not general internet destinations like apt repositories. Option C is wrong because temporarily adding an external IP is a manual, non-scalable workaround that violates the requirement for a persistent configuration and exposes the VM to inbound traffic. Option D is wrong because a firewall rule allowing egress to 0.0.0.0/0 on ports 80 and 443 only permits the traffic to leave the VPC; without Cloud NAT or an external IP, the packets have no routable source address and will be dropped by the internet gateway.

381
MCQmedium

A team deploys a new version of their application using a blue-green strategy on GKE. The 'green' deployment is running but still in testing. When ready, traffic should instantly switch from 'blue' to 'green' with rollback possible in seconds. How is the instant switch implemented?

A.Delete the blue Deployment and create the green Deployment as the replacement
B.Update the Service's label selector from 'version: blue' to 'version: green'
C.Update the Deployment's container image tag — GKE automatically performs a blue-green rollout
D.Use kubectl patch to update the Service's ClusterIP to point to the green Deployment
AnswerB

Changing the Service's label selector from version: blue to version: green repoints the Service's Endpoints to the green Pods immediately, because Kubernetes Services route traffic by matching Pod labels, not by any explicit backend list. Since the blue Deployment remains untouched, it stays running with its Pods intact, making a rollback as simple as reverting the selector back to blue. No downtime occurs because the green Pods are already healthy and registered as ready before the switch, and the Service's ClusterIP and DNS name remain unchanged.

Why this answer

In a blue-green deployment on GKE, the Service acts as a stable network endpoint abstracting the underlying Pods. By changing the Service's label selector from 'version: blue' to 'version: green', traffic is instantly routed to the green Pods without any downtime or need to recreate resources. This allows immediate rollback by simply reverting the selector back to 'version: blue'.

Exam trap

Google Cloud often tests the misconception that updating a Deployment's image tag or using kubectl patch on ClusterIP is the correct way to switch traffic, when in fact the Service's label selector is the precise mechanism for instant traffic redirection in blue-green deployments.

How to eliminate wrong answers

Option A is wrong because deleting the blue Deployment and creating the green Deployment as a replacement would cause downtime during the deletion and creation process, and does not provide an instant switch or easy rollback. Option C is wrong because updating a Deployment's container image tag triggers a rolling update, not a blue-green switch; GKE does not automatically perform a blue-green rollout based on image tag changes. Option D is wrong because a Service's ClusterIP is a virtual IP assigned by Kubernetes and cannot be patched to point to a different Deployment; the correct way to redirect traffic is by updating the label selector, not the ClusterIP.

382
MCQmedium

A team is migrating a stateful application with local disk writes to GKE. The application requires a dedicated persistent disk that follows the Pod if it's rescheduled to a different node. Which Kubernetes resource provides this?

A.A HostPath volume pointing to a directory on the node
B.A ConfigMap mounted as a volume
C.A PersistentVolumeClaim backed by a GCE persistent disk StorageClass
D.An emptyDir volume scoped to the Pod
AnswerC

A PersistentVolumeClaim (PVC) backed by a GCE persistent disk StorageClass provides durable, network-attached block storage that is provisioned independently of any specific node. When a Pod using this PVC is rescheduled, the underlying PersistentVolume (a GCE PD) is detached from the old node and attached to the new node, preserving all application-written data. This makes it the correct choice for stateful workloads that must survive Pod restarts or node failures. Note that the PD is zonal, so the new node must be in the same zone as the disk.

Why this answer

A PersistentVolumeClaim (PVC) backed by a GCE persistent disk StorageClass is the correct choice because it provides a durable, network-attached block storage volume that persists independently of the Pod's lifecycle. When the Pod is rescheduled to a different node, the PVC ensures the GCE persistent disk is detached from the old node and reattached to the new node, preserving the application's state. This meets the requirement for a dedicated persistent disk that follows the Pod across rescheduling events.

Exam trap

Google Cloud often tests the distinction between ephemeral (emptyDir, HostPath) and persistent (PVC-backed) storage, trapping candidates who confuse node-local storage with cluster-wide persistent volumes that follow Pods across nodes.

How to eliminate wrong answers

Option A is wrong because a HostPath volume mounts a directory from the host node's filesystem, which is node-specific and does not follow the Pod if it is rescheduled to a different node; it also lacks the durability and portability required for stateful applications. Option B is wrong because a ConfigMap is designed for injecting non-sensitive configuration data (e.g., key-value pairs or small files) and is not a persistent storage volume; it cannot handle disk writes or maintain state across Pod reschedules. Option D is wrong because an emptyDir volume is ephemeral and scoped to the Pod's lifecycle—it is created when the Pod starts and deleted when the Pod is removed, so it does not persist data if the Pod is rescheduled to a different node.

383
MCQmedium

A GKE team is comparing Autopilot and Standard cluster modes for a new project. They want to minimize infrastructure management overhead, automatically right-size node resources, and be billed only for Pod resource requests. Which mode matches these requirements?

A.GKE Standard — it provides more control over node configuration
B.GKE Autopilot — managed nodes, automatic right-sizing, and per-Pod billing
C.GKE Standard with cluster autoscaler and node auto-provisioning enabled
D.Both modes are equivalent in management overhead — Autopilot is just a pricing model
AnswerB

GKE Autopilot is the correct choice because it fully abstracts node management: Google provisions, scales, and optimizes the underlying nodes, and you only pay for Pod resource requests. There are no node pools or machine types to configure, and the cluster automatically right-sizes workloads, delivering truly minimal operational overhead.

Why this answer

GKE Autopilot is the correct choice because it fully manages the underlying node infrastructure, automatically right-sizes node resources based on Pod resource requests, and bills only for the requested CPU and memory of Pods, not the underlying nodes. This aligns directly with the team's goals of minimizing management overhead, automatic right-sizing, and per-Pod billing.

Exam trap

Google Cloud often tests the misconception that GKE Standard with autoscaling features provides the same per-Pod billing and zero node management as Autopilot, but the key difference is that Standard always bills for the underlying nodes, not the Pods.

How to eliminate wrong answers

Option A is wrong because GKE Standard requires manual node management and does not automatically right-size node resources; it bills for the underlying nodes, not per Pod. Option C is wrong because even with cluster autoscaler and node auto-provisioning, GKE Standard still bills for the provisioned nodes, not per Pod, and does not provide the same level of automatic right-sizing as Autopilot. Option D is wrong because Autopilot and Standard are fundamentally different in management overhead and billing model; Autopilot is not just a pricing model but a fully managed mode with distinct operational characteristics.

384
MCQmedium

A company wants to use Cloud NAT to allow private instances in a VPC to send outbound traffic to the internet and to receive inbound responses. Which two resources must be configured to set up Cloud NAT?

A.Cloud Router and NAT gateway
B.Cloud Router only
C.Cloud VPN and Cloud NAT
D.Cloud Interconnect and Cloud NAT
AnswerA

Cloud NAT is implemented as a NAT gateway configured on a Cloud Router, and this pair is the required core of the service. The Cloud Router holds the NAT IP addresses and manages the dynamic routes (via BGP) that allow private instances to use them, while the NAT gateway performs source address translation for outbound connections. Without a NAT gateway, a Cloud Router alone cannot translate addresses, which is why both components are mandatory for a functioning Cloud NAT.

Why this answer

Cloud NAT requires a Cloud Router (to manage dynamic routing and NAT IP allocation) and a NAT gateway (the actual NAT service). The Cloud Router is a separate resource that must be created in the same region as the NAT gateway. The NAT gateway configuration includes the Cloud Router name.

385
MCQhard

A team runs a critical production project and wants to prevent anyone — including project owners and organization admins — from accidentally deleting it. Which mechanism provides this protection?

A.Remove the Owner role from all users in the project
B.Set an organization policy denying the resourcemanager.projects.delete permission
C.Create a project lien using the Cloud Resource Manager API or gcloud
D.Enable deletion protection in the project's IAM settings in the Console
AnswerC

Creating a project lien is the correct way to prevent accidental or even intentional deletion of a project. A lien blocks the resourcemanager.projects.delete operation on the project, and any deletion attempt will fail until the lien is removed via the Cloud Resource Manager API or using the 'gcloud resource-manager liens' commands, even for users who have the delete permission. This is the only option that directly and reliably protects the project from deletion.

Why this answer

A project lien is the correct mechanism because it explicitly prevents the deletion of a Google Cloud project by blocking the `resourcemanager.projects.delete` operation until the lien is removed. This protection works regardless of the user's role, including project owners and organization admins, and is managed via the Cloud Resource Manager API or `gcloud` command. It is designed specifically for accidental deletion prevention, not for access control.

Exam trap

The trap here is that candidates confuse IAM permissions (like denying `resourcemanager.projects.delete`) with project-level operational locks (liens), or assume a UI toggle exists for deletion protection when it does not in Google Cloud.

How to eliminate wrong answers

Option A is wrong because removing the Owner role from all users does not prevent organization admins or other privileged users from deleting the project, and it breaks project management functionality. Option B is wrong because setting an organization policy denying `resourcemanager.projects.delete` would block all project deletions across the organization, which is too broad and not a targeted protection for a single project. Option D is wrong because there is no 'deletion protection' toggle in IAM settings in the Google Cloud Console; IAM manages permissions, not project-level deletion locks.

386
MCQeasy

A developer needs to create a zonal GKE cluster with 3 nodes of type e2-standard-4 in zone us-central1-a. Which command should they use?

A.gcloud compute instances create my-cluster --zone=us-central1-a --machine-type=e2-standard-4 --num-nodes=3
B.gcloud container clusters create my-cluster --zone=us-central1-a --num-nodes=3 --machine-type=e2-standard-4
C.gcloud container clusters create my-cluster --zone=us-central1-a --num-nodes=1 --machine-type=e2-standard-4
D.gcloud container clusters create my-cluster --region=us-central1 --num-nodes=3 --machine-type=e2-standard-4
AnswerB

This correct command creates a zonal GKE cluster because --zone targets a single zone, us-central1-a, and the cluster's control plane and nodes are both provisioned there. The --num-nodes=3 flag defines the initial size of the default node pool, and --machine-type=e2-standard-4 sets each node's VM shape. This exactly meets the requirement for a 3-node zonal cluster.

Why this answer

The correct command creates a zonal cluster (single zone) with specified node count and machine type. The --region flag creates a regional cluster, which is not required.

387
MCQhard

You need to audit all IAM policy changes in your project. You want to ensure that every change is logged with the identity of the user who made the change. Which type of audit log should you enable?

A.Data Access audit logs
B.Admin Activity audit logs
C.Policy Denied audit logs
D.System Event audit logs
AnswerB

Admin Activity audit logs capture all changes to configurations and metadata, including every IAM role binding, service account creation or deletion, and project-level policy modification. These logs are enabled by default for all projects and cannot be disabled, making them the authoritative source for answering 'who changed an IAM policy and when.' Each entry includes the actor, the action, the affected resource, and the request metadata, so this is the correct log type to audit IAM policy changes.

Why this answer

Admin Activity audit logs (also known as Cloud Audit Logs) record all API calls that modify the configuration or metadata of resources, including IAM policy changes. These logs capture the identity of the user who made the change, the time of the change, and the specific modification, ensuring full accountability for administrative actions.

Exam trap

Google Cloud often tests the distinction between Admin Activity and Data Access logs, where candidates mistakenly choose Data Access logs because they think 'all changes' include data modifications, but IAM policy changes are administrative, not data-level, operations.

How to eliminate wrong answers

Option A is wrong because Data Access audit logs record API calls that read or modify user-provided data (e.g., reading a Cloud Storage object), not configuration changes like IAM policies. Option C is wrong because Policy Denied audit logs only log access attempts that are denied by IAM policies, not the changes to the policies themselves. Option D is wrong because System Event audit logs capture non-user-initiated events such as system maintenance or resource lifecycle events, not user-driven IAM policy modifications.

388
MCQmedium

You manage a Google Kubernetes Engine (GKE) cluster and need to update the deployment 'web-app' to use a new container image tag 'v2'. You also want to ensure the update proceeds and, if it fails, roll back to the previous revision. Which set of commands should you use?

A.gcloud container clusters upgrade; kubectl rollout status; kubectl rollout undo
B.kubectl set image deployment/web-app web-app=gcr.io/myproject/web-app:v2; kubectl rollout status; kubectl rollout undo
C.kubectl edit deployment web-app; kubectl rollout status; kubectl delete deployment web-app
D.kubectl apply -f web-app.yaml; kubectl rollout status; kubectl rollout undo
AnswerB

kubectl set image directly updates the Deployment's pod template to reference the v2 image, which triggers a rolling update orchestrated by the Deployment controller. kubectl rollout status then watches that update to completion, returning a non-zero exit code if the rollout fails (e.g., due to crash-loops or insufficient readiness), which is the correct signal for conditional rollback. kubectl rollout undo reverts to the previous revision, but note it should be gated on that failure in practice; even so, this is the only option that uses the proper Kubernetes-native commands for image update, rollout monitoring, and rollback.

Why this answer

kubectl set image updates the image; kubectl rollout status monitors progress; kubectl rollout undo reverts to the previous revision.

389
MCQmedium

You have a GKE cluster with a node pool that needs to scale automatically based on load. The cluster was created with autoscaling disabled. Which command enables autoscaling on an existing node pool?

A.gcloud container node-pools create my-pool --enable-autoscaling
B.kubectl autoscale node-pool my-pool --min=1 --max=10
C.gcloud container node-pools update my-pool --cluster=my-cluster --enable-autoscaling --min-nodes=1 --max-nodes=10
D.gcloud container clusters update my-cluster --enable-autoscaling
AnswerC

This is the correct command because it targets an existing node pool (`my-pool`) within the specified cluster and toggles the GKE cluster autoscaler on for that pool. The `--min-nodes=1` and `--max-nodes=10` flags define the scaling boundaries, allowing the pool to resize within those limits based on resource demand. The `--cluster` flag scopes the operation to the right cluster, and the update command modifies the live pool without recreating it.

Why this answer

gcloud container node-pools update with --enable-autoscaling and min/max node parameters enables autoscaling.

390
MCQeasy

A solutions architect is designing a disaster recovery plan for a Cloud SQL for PostgreSQL instance. The primary instance is in us-central1. They need to automate failover to a different region with a Recovery Point Objective (RPO) of less than 5 seconds. Which configuration should they choose?

A.Use Cloud SQL external replication with a Compute Engine instance
B.Deploy a high-availability (HA) configuration within the same region
C.Enable automatic backups and point-in-time recovery
D.Configure a cross-region read replica in us-west1
AnswerD

Configuring a cross-region read replica in us-west1 uses asynchronous replication from the primary Cloud SQL instance to a read-only instance in the chosen region. This replica continuously applies changes, with replication lag typically in seconds, making the RPO low enough to approach the under-five-second requirement under normal conditions. If the primary region fails, you can promote the read replica to a standalone primary, enabling a managed cross-region disaster recovery path without needing to operate an external Compute Engine instance.

Why this answer

Cloud SQL cross-region replication uses asynchronous replication and typically has an RPO of a few seconds. A read replica in another region can be promoted in a disaster. Backups have higher RPO.

HA within same region does not help for regional disaster. External replication is less managed.

391
Multi-Selectmedium

A company wants to migrate an on-premises MySQL database to Cloud SQL with minimal downtime. The database is 500 GB. Which TWO steps should be taken? (Choose 2 correct answers.)

Select 2 answers
A.Create a Cloud SQL instance to serve as the target for the migration.
B.Export the database using gcloud sql export sql, then import to Cloud SQL.
C.Create a Cloud SQL instance and configure it as an external replica of the on-premises database.
D.Use mysqldump to backup the database and restore into Cloud SQL.
E.Use Database Migration Service to create a continuous migration job.
AnswersA, E

The Database Migration Service requires a pre-provisioned Cloud SQL instance as the destination, so creating one first defines the target tier, storage, and network configuration before any migration job is started. Without an existing instance, DMS has nowhere to replicate the initial snapshot or stream incoming changes. This is the necessary first step in a low-downtime migration, even though the actual data movement happens later via a DMS job.

Why this answer

To minimize downtime, you can perform a Database Migration Service (DMS) continuous migration or export/import with a consistent snapshot. DMS supports MySQL and provides continuous sync. Alternatively, you can export the database using mysqldump, then import, but this requires downtime.

However, for minimal downtime, DMS is best. Another approach is to create a read replica then promote, but Cloud SQL does not support external read replicas directly. The correct two are: use DMS for continuous migration, and optionally create a clone for testing, but the question asks for migration steps.

The best two from the options: use DMS migration job and create a Cloud SQL instance.

392
MCQhard

An organization has a folder hierarchy with multiple projects. They want to grant a support team the ability to view all IAM policies across the entire folder. What is the most efficient way?

A.Grant roles/iam.securityReviewer at the folder level.
B.Grant roles/iam.securityReviewer on each project individually.
C.Grant roles/owner at the folder level.
D.Grant roles/viewer at the folder level.
AnswerA

Granting roles/iam.securityReviewer at the folder level is correct because IAM permissions propagate through the resource hierarchy. This predefined role includes resourcemanager.folders.getIamPolicy and resourcemanager.projects.getIamPolicy, allowing the user to read IAM policies on the folder and every project, folder, and resource beneath it. Because the audit scope is the entire folder hierarchy, one grant at the folder root covers all child projects without per-project assignments, satisfying the requirement efficiently and with least privilege.

Why this answer

Granting the role at the folder level applies to all projects under it, which is efficient and follows best practices for hierarchical IAM.

393
MCQmedium

A developer needs to use Application Default Credentials (ADC) in a local development environment to call the Cloud Translation API. They have already run `gcloud auth login`. What additional step is required to make ADC work correctly?

A.Run `gcloud auth application-default login` to generate ADC credentials.
B.Set the `GOOGLE_CLOUD_PROJECT` environment variable to the project ID.
C.Download a service account JSON key and set `GOOGLE_APPLICATION_CREDENTIALS`.
D.Run `gcloud config set account` to switch to the correct account.
AnswerA

`gcloud auth application-default login` is the canonical command for locally developing with Google Cloud client libraries because it downloads OAuth2 user credentials and stores them in `application_default_credentials.json` in the well-known gcloud config directory. This file is one of the primary sources in the ADC lookup chain, so client libraries automatically discover these credentials without any further configuration. Unlike `gcloud auth login`, which only authenticates the gcloud CLI, this command specifically populates the credentials that your application code will find when it calls the ADC helper.

Why this answer

`gcloud auth application-default login` creates a special credential file (typically at `~/.config/gcloud/application_default_credentials.json`) that Application Default Credentials (ADC) uses to authenticate API calls. While `gcloud auth login` sets up user credentials for gcloud CLI commands, ADC does not use those credentials directly; it requires its own separate credential file. Running this command ensures that the local development environment can authenticate to the Cloud Translation API via ADC without additional configuration.

Exam trap

Google Cloud often tests the distinction between `gcloud auth login` (for CLI authentication) and `gcloud auth application-default login` (for ADC), leading candidates to mistakenly think the former is sufficient for ADC-based API calls.

How to eliminate wrong answers

Option B is wrong because setting the `GOOGLE_CLOUD_PROJECT` environment variable only specifies the project ID for quota and billing purposes; it does not provide authentication credentials, so ADC would still fail without valid credentials. Option C is wrong because downloading a service account JSON key and setting `GOOGLE_APPLICATION_CREDENTIALS` is a valid method for ADC, but it is not required after `gcloud auth login`; the question asks for the additional step to make ADC work correctly, and the simpler, recommended step for local development is to use `gcloud auth application-default login` rather than managing service account keys. Option D is wrong because `gcloud config set account` switches the active account for gcloud CLI commands but does not create or configure the ADC credential file, so ADC would still not have credentials to use.

394
Multi-Selecthard

An engineer needs to choose a location for a new GCP project's resources to maximize availability and minimize latency for users in Europe and Asia. Which three actions should they take? (Choose THREE)

Select 3 answers
A.Use a global load balancer to distribute traffic
B.Set the project default region to us-central1
C.Deploy resources in europe-west1 and asia-east1
D.Use a single zone in europe-west1 for simplicity
E.Enable Cloud CDN to cache content at edge locations
AnswersA, C, E

Global external HTTPS load balancing leverages a single anycast IP address and Google's global backbone to forward each user request to the optimal backend based on latency and health. It performs traffic distribution at L7 to the nearest available region, allowing active/active serving across multiple regions without DNS round-robin. This is the standard control plane that unifies multi-region deployments into one global endpoint.

Why this answer

Using multiple regions, load balancing, and a global resource like Cloud CDN can help achieve high availability and low latency.

395
Multi-Selectmedium

You need to set up log-based alerting in Cloud Logging to send notifications when a specific error pattern appears in your application logs. Which TWO components are required to accomplish this?

Select 2 answers
A.An alerting policy
B.A log sink
C.A Cloud Pub/Sub topic
D.An uptime check
E.A log-based metric
AnswersA, E

The alerting policy is the actual alerting mechanism in Cloud Logging. It defines the conditions that trigger an incident, such as a threshold on a metric (e.g., a log-based metric exceeding a value) and specifies the notification channels (email, Slack, etc.) to receive alerts. Without an alerting policy, a log-based metric only counts or samples log entries; it does not perform any active monitoring or notify anyone.

Why this answer

To create a log-based alert, you need a log-based metric that counts the matching log entries, and an alerting policy that uses that metric. The metric is the source of the condition, and the policy defines when to notify.

396
Multi-Selecteasy

A company wants to ensure that only users from a specific domain (@example.com) can access Cloud Storage buckets in a project. Which two steps should be taken? (Choose two.)

Select 2 answers
A.Use VPC Service Controls to restrict access.
B.Enable domain restricted sharing in Cloud Storage settings.
C.Set an organization policy to restrict allowed domains for IAM.
D.Add an IAM condition to the bucket policy to require that the user's domain is @example.com.
E.Grant access to the bucket to a Cloud Identity group that only includes @example.com users.
AnswersC, E

The organization policy constraint iam.allowedPolicyMemberDomains is the canonical mechanism to restrict which domains can be granted IAM roles. When this constraint lists example.com, any attempt to add a principal outside that domain to a bucket policy, project, or folder is rejected. Because it is inherited from the organization, it protects all resources under that hierarchy without per-resource configuration.

Why this answer

The organization policy constraint `iam.allowedPolicyMemberDomains` restricts which domains can be used as members in IAM policies across the entire project. This ensures that only principals from @example.com can be granted access to any resource, including Cloud Storage buckets. Option E is correct because a Cloud Identity group containing only @example.com users can be granted IAM roles on the bucket, and membership in the group is controlled by the domain, effectively limiting access to that domain.

Exam trap

Google Cloud often tests the distinction between organization policies (which enforce constraints globally at the resource hierarchy level) and IAM conditions (which are per-binding and evaluated at access time), leading candidates to incorrectly choose IAM conditions as a domain restriction mechanism.

397
MCQmedium

A company has multiple VPC networks in their project. They want Compute Engine instances in one VPC to communicate with instances in another VPC using internal IP addresses. Which feature should they use?

A.Cloud NAT
B.VPC Network Peering
C.Cloud VPN
D.Firewall rules
AnswerB

VPC Network Peering directly connects two VPC networks over Google's private backbone, allowing instances in each network to communicate using internal RFC 1918 addresses without needing public IPs or a VPN. It is the recommended method for inter-VPC connectivity because it offers low latency, no bandwidth restrictions, and no single point of failure. Peering works across projects and organizations, and it automatically exchanges routes for all subnets in the peered networks, so it fully satisfies the requirement to connect multiple VPC networks.

Why this answer

VPC Peering allows connectivity between two VPC networks using internal IPs. VPN is for on-premises connectivity. Cloud NAT is for outbound internet access.

Firewall rules control traffic but do not enable routing between VPCs.

398
MCQhard

A company has 50+ Compute Engine instances running a stateful application in the us-central1 region. The instances are part of a managed instance group behind an internal load balancer. The application stores data on zonal persistent disks. The company wants to migrate the entire application stack to the europe-west1 region to reduce latency for European users. They have a Cloud VPN tunnel between their on-premises data center and us-central1. They want to extend connectivity to europe-west1 with minimal downtime. The current on-premises router uses BGP to advertise a specific CIDR block (10.0.0.0/8) to Google Cloud. The VPC is in custom mode with subnets in us-central1 and europe-west1 already created. The Cloud VPN gateway in us-central1 is attached to a Cloud Router with a BGP session to the on-premises router. Which course of action should the company take to achieve the migration with minimal downtime?

A.Create a second Cloud VPN tunnel on the existing Cloud VPN gateway to Europe with a new BGP session, and update the on-premises router to accept the new route advertisement.
B.Set up VPC Network Peering between the us-central1 and europe-west1 VPCs to allow cross-region communication.
C.Create a new Cloud VPN gateway in europe-west1, attach it to a Cloud Router, and establish a BGP session with the on-premises router. Use route priority or metrics to gradually shift traffic to europe-west1.
D.Provision a Dedicated Interconnect connection to europe-west1 and attach a new Cloud Router. Remove the existing Cloud VPN gateway.
AnswerC

A new Cloud VPN gateway in europe-west1 with its own Cloud Router gives the on-premises router a second BGP session and a new set of routes to the europe-west1 subnets, allowing traffic to enter GCP at the closest region. By adjusting BGP route priority or MED values, you can gradually shift a percentage of traffic to the new tunnel while monitoring application health and roll back if needed. Because both tunnels remain up during the transition, there is no downtime and the Cloud Router can automatically fail over if one tunnel fails.

Why this answer

Adding a second Cloud VPN gateway in europe-west1 and configuring a new BGP session to the on-premises router allows the on-premises router to learn routes for europe-west1 subnets and route traffic accordingly. This can be done without modifying existing sessions, and traffic can be shifted gradually by adjusting route priority (MED) or using BGP metrics. Option A is wrong because a second VPN tunnel on the same gateway would still be in us-central1 and might not provide optimal routing.

Option B is wrong because VPC Network Peering does not extend on-premises connectivity; it only connects VPC networks, and the on-premises router would still only have a BGP session to the us-central1 Cloud Router. Option D is wrong because Dedicated Interconnect is a dedicated physical connection that requires significant provisioning time and may not be suitable for a quick migration, and it does not inherently allow gradual traffic shifting without additional BGP configuration.

399
Drag & Dropmedium

Arrange the steps to create a Compute Engine instance with a custom service account in the correct order.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

The service account must exist before attaching to an instance; instance creation is the final step.

400
MCQhard

A company has a Google Cloud organization with multiple folders and projects. The security team wants to audit all actions that create or modify IAM policies across the entire organization. Which type of audit log should they examine?

A.System Event audit logs
B.Data Access audit logs
C.VPC Flow Logs
D.Admin Activity audit logs
AnswerD

Admin Activity audit logs are enabled by default and capture all API calls that modify the configuration or metadata of resources, including IAM policy updates. For an organization with multiple folders, these logs at the org level record IAM binding changes on any resource in the hierarchy, such as 'setIamPolicy' from projects or folders. They provide an audit trail of who changed what, when, from where, and for which resource, making them the correct log type for investigating IAM policy modifications.

Why this answer

Admin Activity audit logs record all API calls that modify the configuration or metadata of resources, including IAM policy changes. These logs are enabled by default and cannot be disabled. Data Access logs record read operations and are not enabled by default.

System Event logs cover GCP infrastructure events, not IAM changes.

401
MCQmedium

A DevOps engineer needs to deploy a new GKE Pod that mounts a ConfigMap named 'app-config' as environment variables. The ConfigMap already exists in the cluster. Which YAML snippet correctly references it?

A.envFrom: - configMapRef: name: app-config
B.volumes: - name: config / configMap: name: app-config
C.env: - name: CONFIG / valueFrom: secretKeyRef: name: app-config
D.envFrom: - secretRef: name: app-config
AnswerA

The `envFrom` field with a `configMapRef` entry creates environment variables for every key in the `app-config` ConfigMap, with the key name becoming the variable name. This is the correct, declarative way to inject an entire ConfigMap's data as environment variables without listing each key individually. Note that the variables are snapshotted at pod creation; later ConfigMap updates do not update the already-running container's environment.

Why this answer

The `envFrom` field with a `configMapRef` allows a Pod to load all key-value pairs from a ConfigMap as environment variables. This is the standard Kubernetes syntax for injecting ConfigMap data into a container's environment without specifying individual keys.

Exam trap

Google Cloud often tests the distinction between `configMapRef` and `secretRef` in `envFrom` blocks, and the trap here is that candidates confuse ConfigMaps with Secrets or incorrectly use volume syntax for environment variables.

How to eliminate wrong answers

Option B is wrong because it defines a volume mount for a ConfigMap, not environment variables; the correct syntax for a ConfigMap volume uses `configMap` (not `config`) and requires a `volumes` block plus a `volumeMounts` entry. Option C is wrong because it uses `secretKeyRef` to reference a ConfigMap, which is only valid for Secrets, not ConfigMaps; also, the `valueFrom` field is used for individual key references, not for loading the entire ConfigMap. Option D is wrong because it uses `secretRef` instead of `configMapRef`; `secretRef` is used to load Secrets as environment variables, not ConfigMaps.

402
Multi-Selectmedium

You are troubleshooting a Pub/Sub subscription that is not delivering messages promptly. Which THREE factors should you investigate? (Choose THREE.)

Select 3 answers
A.The subscription's backlog size
B.The topic's retention duration
C.The subscriber's processing latency
D.The message ordering key
E.The acknowledgment deadline
AnswersA, C, E

The subscription's backlog size is the primary indicator of delivery problems: it counts messages that have been published but not yet acknowledged. When troubleshooting a subscription that is not delivering, an ever-growing backlog means messages are arriving faster than the subscriber can process them, or the subscriber has stopped pulling entirely. Large backlog also correlates with slow processing and can help you decide whether to scale out subscribers or inspect subscriber logs.

Why this answer

Common causes include backlog, subscriber latency, and ack deadlines.

403
Multi-Selecteasy

A company is deploying a web application on Compute Engine and wants to distribute traffic across multiple instances in different zones for high availability. They also need to terminate SSL/TLS at the load balancer. Which TWO services should they use together?

Select 2 answers
A.Managed instance group
B.External HTTP(S) load balancer
C.Cloud CDN
D.Internal TCP/UDP load balancer
E.Cloud NAT
AnswersA, B

A managed instance group (MIG) is the correct backend infrastructure because it maintains a pool of identical VM instances across multiple zones, enabling the HTTP(S) load balancer to distribute traffic and automatically heal failed instances. MIGs support autoscaling based on load, which is essential for a scalable web application, and they provide the instance-level health checking that the load balancer relies on to route requests only to healthy VMs.

Why this answer

An external HTTP(S) load balancer provides SSL/TLS termination and distributes traffic across instances in multiple zones. Managed instance groups allow you to manage the instances and autoscale if needed. The load balancer uses the instance group as a backend.

404
MCQmedium

Your application exposes a REST API that external partners consume. You need rate limiting per partner (API key), usage analytics, and developer portal for onboarding. Traffic is currently 1,000 requests/day but expected to grow to 10M/day within a year. Which GCP service best fits these requirements?

A.Cloud Endpoints with Extensible Service Proxy
B.Apigee API Management
C.Cloud Armor with rate limiting rules
D.API Gateway with a backend Cloud Run service
AnswerB

Apigee provides all required features: per-key rate limiting, built-in developer portal for partner onboarding, detailed API analytics, and scales to billions of requests.

Why this answer

Apigee API Management is correct because it provides built-in rate limiting per API key (via quota policies), detailed analytics dashboards for usage tracking, and a developer portal for partner onboarding and key management. Unlike simpler API gateways, Apigee is designed for enterprise-grade API management at scale, handling growth from 1,000 to 10M requests/day with features like monetization, traffic management, and security policies.

Exam trap

Google Cloud often tests the distinction between a simple API gateway (like Cloud Endpoints or API Gateway) and a full API management platform (Apigee), where the presence of a developer portal and per-partner analytics is the key differentiator, not just rate limiting or traffic growth.

How to eliminate wrong answers

Option A is wrong because Cloud Endpoints with Extensible Service Proxy (ESP) is a lightweight API gateway that lacks a built-in developer portal and advanced analytics; it relies on Google Cloud's operations suite for basic metrics and does not offer per-partner rate limiting via API keys without custom code. Option C is wrong because Cloud Armor is a web application firewall (WAF) and DDoS protection service that can rate-limit by IP address, not by API key or partner, and it provides no developer portal or usage analytics per partner. Option D is wrong because API Gateway with a backend Cloud Run service is a managed gateway that supports rate limiting and basic analytics but lacks a developer portal for partner onboarding and is designed for simpler use cases, not the enterprise-grade API management and analytics required for 10M requests/day.

405
MCQhard

A company has a Cloud Storage bucket that stores sensitive files. They want to ensure that objects are automatically deleted after 30 days to comply with data retention policies. Additionally, they need to keep a copy of all object deletions for audit purposes. Which combination of bucket settings should they use?

A.Enable bucket lock and use object holds
B.Enable object versioning and set a retention policy with a retention period of 30 days
C.Enable a lifecycle rule with condition 'Age: 30 days' and action 'Delete'
D.Enable object versioning and add a lifecycle rule with condition 'Age: 30 days' and action 'Delete' for the current version
AnswerD

Versioning retains noncurrent versions when objects are deleted, providing an audit trail. The lifecycle rule deletes current versions after 30 days, and the noncurrent versions remain (or can be deleted later with a separate rule). This combination meets both requirements.

Why this answer

Cloud Storage lifecycle management can automatically delete objects after 30 days using a SetStorageClass or Delete action with an Age condition. Object versioning enables keeping deleted or overwritten versions (noncurrent versions). By combining lifecycle rules to delete noncurrent versions after a period (e.g., 0 days) or simply keeping them, you can audit deletions.

However, the question says 'keep a copy of all object deletions for audit purposes' – versioning retains noncurrent versions when objects are deleted or overwritten. Lifecycle rules can be set to expire the noncurrent versions after a longer period, but for audit purposes, you would keep them indefinitely or for a long period. The simplest is to enable versioning and set a lifecycle rule to delete objects after 30 days; deleted objects become noncurrent versions and are retained until a lifecycle rule removes them.

To keep a copy, you might not delete noncurrent versions. The correct answer: enable versioning and add a lifecycle rule with condition Age:30 and action Delete for current objects. Noncurrent versions will remain unless a separate rule deletes them.

For audit, you may also set a rule to delete noncurrent versions after a longer period, but the question asks for 'which combination' – the combination that achieves both requirements is versioning + lifecycle rule to delete current objects after 30 days. The deleted objects become noncurrent versions, which are retained (so audit copy is kept). If they need to keep the deletion records forever, they should not delete noncurrent versions.

Among options, the one that includes versioning and a lifecycle rule that deletes objects after 30 days is correct. Option D includes versioning and lifecycle rule: 'Delete object after 30 days' – that's it. Option A is 'Object versioning' only – no deletion.

Option B is 'Bucket lock' – not for automatic deletion. Option C is 'Lifecycle rule to delete objects after 30 days' without versioning – then when deleted, there is no version history. So D is best.

406
MCQmedium

A team is deploying a Cloud Function that requires a private environment variable containing an API key. They want the key stored securely and automatically injected at runtime. Which approach follows GCP best practices?

A.Hardcode the API key in the function source code
B.Pass the API key as a plain-text environment variable in the function configuration
C.Store the key in Secret Manager and reference it as a secret environment variable in the function deployment
D.Store the API key in a Cloud Storage bucket and download it at function startup
AnswerC

Storing the key in Secret Manager and referencing it as a secret environment variable is the correct approach because Cloud Functions integrates natively with Secret Manager through the --set-secrets flag. At runtime, the function's service account fetches the secret value using the IAM role roles/secretmanager.secretAccessor, and the secret is injected into the function environment without ever being stored in the function configuration or visible in the console, gcloud, or Cloud Monitoring metadata.

Why this answer

Secret Manager is the GCP-native service designed to securely store API keys and other sensitive data. By referencing a secret as an environment variable in the Cloud Function deployment configuration, the key is automatically decrypted and injected at runtime without exposing it in source code or configuration files. This follows the principle of least privilege and ensures the secret is encrypted at rest and in transit.

Exam trap

Google Cloud often tests the misconception that storing secrets in Cloud Storage with fine-grained ACLs is sufficient, but the trap here is that Secret Manager is the only service that provides automatic encryption, versioning, and audit logging for secrets without requiring custom code.

How to eliminate wrong answers

Option A is wrong because hardcoding the API key in source code exposes it in version control systems, logs, and build artifacts, violating security best practices. Option B is wrong because passing the API key as a plain-text environment variable in the function configuration stores it unencrypted in the deployment metadata and can be viewed in the Cloud Console or API responses. Option D is wrong because storing the key in a Cloud Storage bucket requires additional code to download and parse the file at startup, introduces latency, and risks exposing the key if bucket permissions are misconfigured or if the bucket is publicly accessible.

407
MCQeasy

A team's GKE application is running out of memory due to a memory leak. Pods are restarting with OOMKilled status. As an immediate measure before a code fix is available, what kubectl action provides the most insight into which container is leaking?

A.kubectl get events --field-selector=reason=OOMKilling
B.kubectl top pods --containers -n [NAMESPACE]
C.kubectl delete pod [POD_NAME] -- force=true to clear the memory leak
D.gcloud container clusters describe [CLUSTER] --memory-usage
AnswerB

`kubectl top pods --containers -n [NAMESPACE]` is the correct command because it queries the metrics-server API to show real-time CPU and memory utilization per individual container inside each Pod. This granularity is essential in GKE because a Pod often runs sidecars alongside the main application, and aggregating metrics at the Pod level can hide which container is consuming excessive memory. By comparing each container's usage to its requests and limits, you can pinpoint the leaking container and confirm the diagnosis before taking any remediation action.

Why this answer

`kubectl top pods --containers` shows per-container CPU and memory usage for each pod in the namespace. This allows you to identify which specific container within a pod is consuming excessive memory and triggering the OOMKilled status, even before a code fix is deployed. It provides immediate, real-time insight into resource consumption at the container level, which is essential for diagnosing a memory leak in a multi-container pod.

Exam trap

Google Cloud often tests the misconception that cluster-level or event-based commands (like `kubectl get events` or `gcloud container clusters describe`) provide container-level resource diagnostics, when in fact only `kubectl top` with the `--containers` flag gives per-container memory usage in real time.

How to eliminate wrong answers

Option A is wrong because `kubectl get events --field-selector=reason=OOMKilling` only shows that an OOMKill event occurred, but does not reveal which specific container within the pod leaked memory; it lacks the granularity needed to pinpoint the leaking container. Option C is wrong because `kubectl delete pod --force=true` merely terminates the pod, which does not provide any diagnostic insight into which container caused the memory leak; it is a destructive action that removes the evidence without analysis. Option D is wrong because `gcloud container clusters describe` does not support a `--memory-usage` flag; cluster-level description commands provide static configuration metadata, not real-time per-container memory metrics.

408
MCQhard

Your organization uses VPC Service Controls to protect BigQuery and Cloud Storage. A data pipeline service account needs to read from a protected Cloud Storage bucket and write results to a protected BigQuery dataset. Both resources are in the same perimeter. The service account is outside the perimeter (it runs in a Cloud Run service in a different project). How do you grant the pipeline access?

A.Add the Cloud Run project to the VPC Service Controls perimeter.
B.Create an Ingress Rule in the VPC-SC perimeter that allows the service account from the external project to access the specific BigQuery and Storage resources.
C.Grant the service account `roles/bigquery.admin` and `roles/storage.admin` to bypass the perimeter restrictions.
D.Move the Cloud Run service into a VPC and set up VPC peering to the perimeter VPC.
AnswerB

An ingress rule in VPC Service Controls is the precise mechanism for allowing an external identity, such as the Cloud Run service account, to access protected resources inside the perimeter. The rule specifies the source identity (the service account), the source project (the Cloud Run project), and the exact target resources (particular BigQuery datasets and Storage buckets), limiting exposure to only what the service genuinely needs. This is the least-privileged and context-aware approach, and it is the only option that correctly addresses the boundary enforcement.

Why this answer

VPC Service Controls (VPC-SC) allow you to define ingress rules that grant access to protected resources from identities outside the perimeter. In this scenario, the service account running in Cloud Run is outside the perimeter, so an ingress rule must explicitly permit that service account to access the specific BigQuery dataset and Cloud Storage bucket. This approach maintains the security boundary while enabling the required data pipeline access.

Exam trap

Google Cloud often tests the misconception that IAM roles can override VPC Service Controls, but the trap here is that VPC-SC operates independently of IAM and requires explicit ingress or egress rules for cross-perimeter access.

How to eliminate wrong answers

Option A is wrong because adding the entire Cloud Run project to the VPC-SC perimeter would extend the security boundary to include all resources in that project, which is overly permissive and may violate security policies. Option C is wrong because granting `roles/bigquery.admin` and `roles/storage.admin` does not bypass VPC-SC restrictions; VPC-SC enforces access controls at the network layer, and IAM roles alone cannot override perimeter boundaries. Option D is wrong because moving the Cloud Run service into a VPC and setting up VPC peering does not address VPC-SC restrictions; VPC peering operates at the network level and does not grant access to resources protected by VPC-SC.

409
Multi-Selectmedium

A DevOps engineer wants to set up budget alerts for a GCP project so that the finance team is notified when costs reach 50% and 90% of the budget. Which two configurations are required? (Choose TWO.)

Select 2 answers
A.Enable billing export to BigQuery
B.Create a budget in the Cloud Billing console
C.Set up a Cloud Function to monitor billing
D.Configure alert thresholds at 50% and 90%
E.Assign the roles/billing.admin IAM role to the finance team
AnswersB, D

Creating a budget in the Cloud Billing console is the foundational action that enables all budget alerting. You define the total budget amount, optionally scope it to specific projects, folders, or billing accounts, and then attach alert threshold rules. Without an actual budget object, there is nothing to trigger a notification, so this is the non-negotiable first step in the workflow.

Why this answer

To set up a budget alert with thresholds, you need to create a budget (specifying the amount and scope) and then set alert thresholds (percentages). The budget can also include Pub/Sub notifications, but the question asks for required configurations.

410
Multi-Selecthard

A DevOps engineer is responsible for deploying a new microservice to GKE. They need to expose the service externally on a static IP address and scale based on HTTP request load. Which THREE resources must be created? (Choose 3 correct answers.)

Select 3 answers
A.Ingress
B.Deployment
C.Service (type LoadBalancer)
D.ConfigMap
E.HorizontalPodAutoscaler
AnswersB, C, E

A Deployment is the core workload resource that declaratively manages a set of identical pods through a ReplicaSet. It defines the desired state—container image, replicas, and labels—and performs rolling updates and rollbacks, ensuring pods converge to that state. For a stateless microservice, a Deployment is mandatory to run the application reliably; scaling (manually or via HPA) and service selection all operate on the Deployment's pod labels. Without it, you would have no managed pod lifecycle, no self-healing, and no update strategy.

Why this answer

To expose a microservice externally with a static IP and load-based scaling, you typically create a Deployment, a Service of type LoadBalancer (which provisions a TCP load balancer with a static IP), and a HorizontalPodAutoscaler to scale based on CPU (or custom metrics). Ingress is not required if using LoadBalancer, but it's another option. ConfigMap is not needed for this.

411
MCQmedium

Microservices in a GKE cluster need to discover each other by name without using public DNS. Service A calls Service B at `http://service-b.production.svc.cluster.local`. Which GCP/Kubernetes feature provides this internal DNS resolution?

A.Cloud DNS private zone configured for the cluster's namespace
B.Kubernetes cluster DNS (CoreDNS) resolving Service names within the cluster
C.Anthos Service Mesh — required for service-to-service DNS
D.A custom /etc/hosts entry on each Pod
AnswerB

CoreDNS is the standard in-cluster DNS server for Kubernetes. It automatically creates DNS records for every Service in the format `[service].[namespace].svc.cluster.local`, so Pods can resolve those names to cluster IPs and reach Services without hardcoding IPs. This built-in DNS is the foundation of service-to-service discovery on GKE, requiring no additional configuration or external DNS infrastructure.

Why this answer

Kubernetes cluster DNS, typically implemented by CoreDNS, is the built-in mechanism that resolves Service names like `service-b.production.svc.cluster.local` to the corresponding ClusterIP. This allows Pods to discover each other by name without relying on external or public DNS. CoreDNS runs as a Deployment in the kube-system namespace and automatically creates DNS records for every Service based on its name and namespace.

Exam trap

The trap here is that candidates confuse Cloud DNS (a GCP-managed DNS service for VPCs) with Kubernetes cluster DNS, or assume that a service mesh like Anthos is necessary for internal service discovery, when in fact CoreDNS provides this capability out of the box in any standard GKE cluster.

How to eliminate wrong answers

Option A is wrong because Cloud DNS private zones are used for resolving custom domain names within a VPC network, not for Kubernetes internal Service DNS; the cluster's internal DNS is handled entirely by CoreDNS within the cluster. Option C is wrong because Anthos Service Mesh (based on Istio) provides traffic management, security, and observability, but it is not required for basic service-to-service DNS resolution; CoreDNS works independently of any service mesh. Option D is wrong because manually editing /etc/hosts on each Pod is impractical, does not scale, and would require constant updates as Services are added or removed; Kubernetes DNS automates this resolution dynamically.

412
MCQeasy

A developer deployed a new version of a Compute Engine instance but the startup script fails to run. The developer needs to debug the startup script. Which step should be taken first?

A.RDP into the instance and check the system logs.
B.Check the instance's metadata for startup script errors.
C.Recreate the instance with a new image.
D.Review the serial port 1 output in the Google Cloud console.
AnswerD

The serial port 1 (COM1) output in the Google Cloud console is the canonical way to see the full boot sequence, kernel messages, and any startup script output or errors. Unlike network-based access (RDP/SSH), serial output is available even if the instance has not fully booted or has no network connectivity. This is why Cloud Console provides a 'Serial port 1' view under the instance's 'Logs' section, and it is the first place to look for startup script failures.

Why this answer

Serial port 1 output in the Google Cloud console captures the instance's serial console logs, including startup script execution output and any errors. This is the first and most direct step to debug a failing startup script because it shows the script's stdout, stderr, and any system messages during boot, without requiring network access or additional tools.

Exam trap

The trap here is that candidates confuse checking instance metadata (which stores the script) with viewing execution logs (serial port output), or they assume RDP/SSH is available when the script failure may prevent those services from starting.

How to eliminate wrong answers

Option A is wrong because Compute Engine instances typically run Linux, not Windows, so RDP is not applicable; even for Windows instances, RDP may not be available if the startup script fails before the network stack is ready. Option B is wrong because the instance's metadata stores the startup script content and configuration, not runtime errors or execution logs; checking metadata will not show why the script failed. Option C is wrong because recreating the instance with a new image does not help debug the existing script failure; it would only reset the environment without revealing the root cause.

413
Multi-Selecthard

A team is deploying a containerized microservice on GKE. They want to ensure the service is externally accessible via a stable IP address and can automatically scale the number of pods based on CPU utilization. Which TWO actions should they perform?

Select 2 answers
A.Expose the deployment using kubectl expose deployment my-service --type=LoadBalancer
B.Set the service type as ClusterIP
C.Create a Cluster Autoscaler on the GKE cluster
D.Create a HorizontalPodAutoscaler targeting the deployment with kubectl autoscale deployment my-service --cpu-percent=80 --min=1 --max=10
E.Expose the deployment using kubectl expose deployment my-service --type=NodePort
AnswersA, D

Running `kubectl expose deployment my-service --type=LoadBalancer` creates a Service of type LoadBalancer, which on GKE signals the cloud controller manager to provision a Google Cloud TCP/UDP load balancer. This load balancer receives a stable external IP address that persists for the lifetime of the Service, independent of node lifecycle. It is the standard way to expose a single deployment to the internet, as it also automatically forwards traffic to the backing pods.

Why this answer

To expose the service externally with a stable IP, use a LoadBalancer service type. To autoscale pods based on CPU, create a HorizontalPodAutoscaler. NodePort only exposes on node IPs, not stable external.

ClusterIP is internal. Cluster autoscaler scales nodes, not pods.

414
MCQmedium

A Cloud Function needs to be triggered whenever a message is published to a Pub/Sub topic. Which 'gcloud functions deploy' command flag is required to set the trigger?

A.--trigger-topic
B.--trigger-http
C.--trigger-event
D.--trigger-bucket
AnswerA

This flag directly associates the Cloud Function with a Pub/Sub topic. When a message is published to that topic, Pub/Sub delivers it as an event to the function, which is how you configure a message-triggered function. Unlike other triggers, this is the standard and only appropriate flag for Pub/Sub message events in the gcloud beta functions deploy command. It ensures the function is invoked asynchronously with the message payload as the event data.

Why this answer

The --trigger-topic flag configures a Cloud Function to be triggered by Pub/Sub messages.

415
MCQeasy

You need to add an IAM binding for a user to a project using the gcloud command. Which command should you use?

A.gcloud projects add-iam-policy-binding
B.gcloud iam service-accounts add-iam-policy-binding
C.gcloud projects set-iam-policy
D.gcloud iam roles update
AnswerA

gcloud projects add-iam-policy-binding PROJECT_ID --member=user:email@example.com --role=roles/viewer is the correct command because it performs an additive update to the project's IAM policy. It reads the current policy, appends the new binding (role + member) to the existing set, and writes the merged policy back atomically, leaving all other bindings untouched. This is the standard CLI operation for granting a specific role to a user at the project scope.

Why this answer

The command `gcloud projects add-iam-policy-binding <project-id> --member user:<email> --role <role>` adds an IAM policy binding to a project.

416
MCQhard

An organization has strict security policies requiring that all Compute Engine instances use OS Login for SSH access instead of metadata-based SSH keys. Which two actions must be taken to enforce this for all new instances? (Choose two.)

A.Remove all SSH keys from project metadata
B.Use 'gcloud compute ssh' with the --tunnel-through-iap flag
C.Set metadata 'enable-oslogin=FALSE' at the instance level
D.Set metadata 'block-project-ssh-keys=TRUE' at the instance level
E.Set metadata 'enable-oslogin=TRUE' at the project level
AnswerA, E

Ensures no metadata-based keys exist; OS Login then becomes the only method.

Why this answer

To enforce OS Login, you enable it at the project level project-wide (enabled by a specific metadata key) and ensure instances have no metadata-based SSH keys. The other options are incorrect.

417
Multi-Selecteasy

Which TWO of the following are valid ways to grant IAM roles to a service account for accessing a Cloud Storage bucket? (Select 2 correct answers)

Select 2 answers
A.Use gcloud projects set-iam-policy with a policy file that includes the binding.
B.Use gcloud storage buckets add-iam-policy-binding to grant the role directly on the bucket.
C.Use gcloud iam roles create to assign the role to the service account.
D.Use gcloud projects add-iam-policy-binding to grant the role at the project level.
E.Use gcloud iam service-accounts add-iam-policy-binding.
AnswersB, D

`gcloud storage buckets add-iam-policy-binding` is the dedicated command to add a single IAM binding on a specific Cloud Storage bucket. You specify the bucket name with `--member` and `--role` to grant that role directly to a user, group, or service account at the bucket level. This is a valid, surgical way to grant permissions to exactly that bucket and no other resource.

Why this answer

IAM roles can be granted at the bucket level using gcloud storage buckets add-iam-policy-binding (or gsutil iam ch) or at the project level which applies to all buckets in the project. The other options are incorrect: gcloud iam roles create creates a custom role definition, not a grant; gcloud iam service-accounts add-iam-policy-binding grants roles on the service account itself; and gcloud projects set-iam-policy replaces the entire policy, not a granular add.

418
MCQmedium

You want to allow a vendor to upload files to a specific Cloud Storage bucket in your project without creating a GCP account for them. The upload URL should expire after 24 hours. Which mechanism should you use?

A.Create a GCP service account for the vendor and share the key JSON file.
B.Generate a Signed URL with a 24-hour expiration for the specific bucket path.
C.Make the Cloud Storage bucket publicly writable and share the bucket URL.
D.Add the vendor's email to the bucket's IAM policy with Storage Object Creator role.
AnswerB

A signed URL with a 24-hour expiration provides a time-limited, authenticated upload (HTTP PUT) link for a specific Cloud Storage object path. The URL is signed with a service account private key that you retain, and the vendor does not need a Google account or any extra credentials—they simply perform an HTTP PUT to the unique, query-parameter-bearing URL. Once 24 hours pass, the link expires and access is automatically revoked, making it the ideal solution for a one-time, temporary external upload.

Why this answer

A signed URL allows time-limited, permissionless access to a specific Cloud Storage object or bucket path without requiring a GCP identity. The URL is cryptographically signed using a service account key, and the 24-hour expiration is set via the `expires` parameter. This meets the requirement of allowing the vendor to upload files without creating a GCP account.

Exam trap

Google Cloud often tests the distinction between identity-based access (IAM) and resource-based access (signed URLs), and the trap here is that candidates may confuse adding an email to IAM (which still requires a Google identity) with the truly identity-free, time-limited access provided by a signed URL.

How to eliminate wrong answers

Option A is wrong because creating a GCP service account and sharing the key JSON file effectively gives the vendor a GCP identity, which contradicts the requirement of not creating a GCP account for them; it also introduces long-term credential management risks. Option C is wrong because making the bucket publicly writable allows anyone on the internet to upload files indefinitely, which violates the 24-hour expiration requirement and poses a severe security risk. Option D is wrong because adding the vendor's email to the bucket's IAM policy requires the vendor to have a GCP account (or a Google account) to authenticate, which directly contradicts the requirement of not creating a GCP account for them.

419
Multi-Selecteasy

An engineer wants to view the current IAM policy for a project. Which TWO commands will accomplish this?

Select 2 answers
A.gcloud projects get-iam-policy my-project --format json
B.gcloud resource-manager folders get-iam-policy my-folder
C.gcloud iam service-accounts get-iam-policy my-sa@my-project.iam.gserviceaccount.com
D.gcloud projects get-iam-policy my-project
E.gcloud projects get-ancestors-iam-policy my-project
AnswersA, D

This is the correct command to retrieve the IAM policy for a specific project, and using `--format json` explicitly instructs the CLI to output the policy as a JSON object. The `--format` flag does not change the underlying policy data, but it provides a structured, machine-readable representation that is ideal for scripting with tools like `jq` or for programmatic inspection. Without this flag, the same data would be rendered in YAML by default, so this flag only ensures the output format is standard and predictable.

Why this answer

The gcloud projects get-iam-policy command retrieves the IAM policy for a project. The gcloud projects get-ancestors-iam-policy retrieves policies from ancestors, not the project itself. The other commands are for different purposes.

420
MCQhard

Your application running on GKE is experiencing intermittent 500 errors. You want to create an alert that fires when the 99th percentile latency exceeds 2 seconds OR when the error rate (5xx responses) exceeds 1% of all requests over a 5-minute window. You have Cloud Monitoring configured with the application exporting metrics via OpenTelemetry. What should you create in Cloud Monitoring?

A.Two separate alerting policies — one for latency and one for error rate — each with their own notification channel.
B.A single alerting policy with two conditions (p99 latency and error rate) joined with OR logic.
C.A log-based alert using Cloud Logging to detect 5xx response codes in access logs.
D.An SLO with error budget burn rate alerts configured in Cloud Monitoring.
AnswerB

A single alerting policy can define two separate conditions — one on p99 latency and one on 5xx error rate — and use an OR combiner so that the policy enters the firing state if either condition is breached. Each condition can be built on the appropriate Cloud Monitoring time series, such as a distribution-valued metric for the 99th percentile latency and a ratio metric for the error rate, with its own threshold and duration window. This approach creates a single incident and sends one notification when any condition fires, reducing noise while still covering both critical signals. It is also easier to maintain and update because the notification channels, documentation, and incident grouping are centralized in one policy.

Why this answer

Cloud Monitoring alerting policies support multiple conditions combined with AND/OR logic, allowing you to trigger a single alert when either the 99th percentile latency exceeds 2 seconds or the error rate exceeds 1% over a 5-minute window. This directly matches the requirement without needing separate policies or relying on log-based detection.

Exam trap

Google Cloud often tests the distinction between metric-based alerts and log-based alerts, and the trap here is that candidates may choose a log-based alert (Option C) because they associate error detection with logs, but the question explicitly states metrics are exported via OpenTelemetry, making metric-based alerts the correct and more efficient choice.

How to eliminate wrong answers

Option A is wrong because creating two separate alerting policies would result in two independent alerts, which is unnecessary and less manageable; Cloud Monitoring supports multiple conditions in a single policy with OR logic, making this approach inefficient. Option C is wrong because a log-based alert using Cloud Logging would only detect 5xx errors from access logs, but the question specifies that metrics are exported via OpenTelemetry, so a metric-based alert is more appropriate and avoids log parsing latency. Option D is wrong because an SLO with error budget burn rate alerts is designed for tracking service-level objectives over longer periods (e.g., 30 days), not for real-time threshold-based alerting on latency and error rate over a 5-minute window.

421
MCQeasy

A startup wants to run a small, event-driven application that processes files uploaded to Cloud Storage. The function should be triggered by object finalize events and should have a maximum execution time of 10 minutes. Which compute option is most cost-effective and easy to manage?

A.Compute Engine with a startup script
B.App Engine Standard
C.Cloud Run jobs
D.Cloud Functions (Gen 2)
AnswerD

Cloud Functions (Gen 2) is the right choice because it offers first-class event triggers from Cloud Storage through Eventarc, letting you run code directly when an object is finalized or deleted. It is fully serverless, scales automatically from zero, and you only pay for execution time, which is ideal for a small startup. The maximum timeout of 60 minutes comfortably covers the stated 10-minute processing requirement, and the function is invoked automatically without any polling or VM management.

Why this answer

Cloud Functions (Gen 2) can be triggered by Cloud Storage events and supports longer timeouts (up to 60 minutes). It is serverless and cost-effective for event-driven workloads. Cloud Run also works but requires running a container; Cloud Functions is simpler for single-purpose functions.

422
MCQeasy

A team is building a mobile app backend that requires real-time data synchronization across devices and offline support. The data model is simple and document-based. Which database service should they use?

A.Cloud Bigtable
B.BigQuery
C.Cloud SQL
D.Firestore
AnswerD

Firestore is a flexible, scalable NoSQL document database designed natively for mobile app development, with real-time listeners that push data changes to clients instantly and offline data persistence that automatically syncs when connectivity returns. Its client SDKs for iOS, Android, and web handle multi-device synchronization, conflict resolution, and data integrity out of the box, making it the ideal choice for this real-time mobile backend use case.

Why this answer

Firestore is a NoSQL document database that provides real-time synchronization, offline support, and is designed for mobile and web apps. It integrates with Firebase SDKs.

423
MCQmedium

You have a Compute Engine VM instance that is currently running. You need to resize it to a different machine type. What must you do first?

A.Stop the instance, then use gcloud compute instances set-machine-type, then start the instance.
B.Use gcloud compute instances update --machine-type while the instance is running.
C.Detach all disks, change machine type, then reattach disks.
D.Create a snapshot of the disk and use it to create a new instance with the desired machine type.
AnswerA

Stopping the instance transitions it to the TERMINATED state, which releases the underlying host resources while preserving the boot disk, metadata, and attachment of persistent disks. The `gcloud compute instances set-machine-type` command can then change the vCPU and memory allocation, and after that you start the instance. This is the correct workflow because Compute Engine rejects machine type changes on running instances.

Why this answer

Changing the machine type requires the VM to be in a stopped state. You must stop the instance, change the machine type, then start it.

424
MCQmedium

A FinOps team wants to analyze daily GCP spending trends, allocate costs by team using labels, and create custom dashboards. Which configuration exports billing data for this analysis?

A.Enable Cloud Monitoring billing metrics and build dashboards in Metrics Explorer
B.Download the monthly billing PDF from the Console and import it into a spreadsheet
C.Enable Cloud Billing data export to BigQuery and query the exported dataset
D.Use the Cloud Billing API to pull cost data into Cloud Firestore nightly
AnswerC

Cloud Billing data export to BigQuery is the native, recommended way to access detailed billing data. Google Cloud automatically writes cost and usage line items, including project, SKU, service, usage amount, unit price, cost, and resource labels, into a BigQuery dataset multiple times a day, allowing you to run SQL queries to slice costs by project, label, service, or date for chargeback, budgeting, and trend analysis.

Why this answer

Exporting GCP billing data to BigQuery enables granular, daily cost analysis, label-based allocation, and custom dashboard creation via tools like Looker Studio. BigQuery's SQL interface allows querying detailed cost and usage data, which is essential for the FinOps team's requirements.

Exam trap

Google Cloud often tests the misconception that Cloud Monitoring or simple API pulls are sufficient for detailed cost analysis, but the exam expects candidates to recognize that BigQuery export is the only option that provides the required granularity, label support, and queryability for custom dashboards.

How to eliminate wrong answers

Option A is wrong because Cloud Monitoring billing metrics provide only aggregated, pre-defined cost views and lack the granular, label-based cost allocation and custom querying capabilities needed for detailed analysis. Option B is wrong because monthly billing PDFs offer only a high-level summary, not daily granularity or label-based cost breakdowns, and cannot be queried programmatically for custom dashboards. Option D is wrong because Cloud Firestore is a NoSQL document database not designed for cost analytics; using the Cloud Billing API to pull data into Firestore nightly would require custom code, lacks native querying for cost trends, and is not a standard or scalable approach for this use case.

425
MCQeasy

Which gcloud command is used to set the default project for a configuration profile?

A.gcloud init
B.gcloud config set project
C.gcloud projects set
D.gcloud projects list
AnswerB

gcloud config set project PROJECT_ID is the correct command because it updates the core/project property in the active gcloud configuration. This directly sets the default project used by subsequent gcloud commands when no --project flag or CLOUDSDK_CORE_PROJECT environment variable is provided. It is the standard, non-interactive method to change the current default project within a given configuration.

Why this answer

The command 'gcloud config set project [PROJECT_ID]' sets the default project in the current active configuration. The other commands are for other purposes.

426
MCQmedium

An organization wants to enforce a policy that disables the creation of VMs with external IPs across all projects. Which resource hierarchy level should the policy be attached to for maximum coverage?

A.Project
B.Resource (VM)
C.Organization
D.Folder
AnswerC

The organization node is the root of the GCP resource hierarchy, and it is the correct place to attach an organization-wide policy. Any IAM role binding or organization policy constraint set at this level is inherited by every folder, project, and resource in the hierarchy, thereby ensuring the policy is enforced across all projects while also applying automatically to any future projects created under the organization.

Why this answer

Organization policies can be applied at the organization level to affect all projects and folders underneath. This ensures the policy covers all resources.

427
MCQeasy

Where in the Google Cloud Console can a user view all APIs currently enabled for their project and monitor their usage?

A.Cloud Shell > Active Sessions
B.IAM & Admin > Service Accounts
C.APIs & Services > Dashboard
D.Monitoring > Metrics Explorer
AnswerC

APIs & Services > Dashboard is the correct destination because it is the single project-level overview of the Google Cloud API ecosystem. It shows which APIs are enabled, total usage metrics (requests and errors), and per-API quota utilization. From this page you can click through to individual API details, enable or disable APIs, and manage credentials—making it the canonical place to check API enablement status.

Why this answer

The 'APIs & Services > Dashboard' page in the Google Cloud Console provides a centralized view of all enabled APIs for a project, along with real-time usage metrics such as requests per second, error rates, and latency. This dashboard is the primary interface for monitoring API consumption and identifying throttling or quota issues.

Exam trap

The trap here is that candidates confuse the 'APIs & Services > Dashboard' with the 'Monitoring > Metrics Explorer' because both show usage data, but only the Dashboard provides a project-level view of enabled APIs and their aggregate usage in one place.

How to eliminate wrong answers

Option A is wrong because Cloud Shell > Active Sessions shows active terminal sessions in Cloud Shell, not API enablement or usage. Option B is wrong because IAM & Admin > Service Accounts is used to manage service account identities and keys, not to view enabled APIs or their usage metrics. Option D is wrong because Monitoring > Metrics Explorer is a tool for creating custom charts and alerts from Cloud Monitoring metrics, but it does not provide a consolidated list of enabled APIs for the project.

428
MCQhard

A company has a GKE Autopilot cluster and wants to run a stateful application that requires persistent volumes with high read/write throughput. The application is deployed in a single region and does not require multi-region redundancy. Which storage option is the best choice for the persistent volumes?

A.Cloud Filestore (NFS)
B.Compute Engine persistent disks (SSD) using StorageClass 'pd-ssd'
C.Bigtable
D.Cloud Storage FUSE
AnswerB

Compute Engine persistent disks (SSD) using the 'pd-ssd' StorageClass is the correct choice because these are core GKE block volumes that are dynamically provisioned, attached to the node, and mounted by the pod with standard filesystem semantics. The SSD persistent disk provides high IOPS and low latency with synchronous, zone-level replication, making it suitable for stateful applications like databases that require durable, consistent storage. In GKE Autopilot, persistent volumes using 'pd-ssd' are fully supported, and the StorageClass abstracts away infrastructure provisioning so the workload gets a dedicated high-performance block device.

Why this answer

GKE Autopilot supports persistent volumes via Compute Engine persistent disks (PD) or Cloud Filestore. For high throughput, regional persistent disks (pd-balanced or pd-ssd) offer excellent performance. Cloud Storage is not a persistent volume.

Filestore is file storage but is more expensive and adds network latency. Persistent disks are native and provide the best performance for stateful applications.

429
Matchingmedium

Match each Cloud Monitoring resource to its purpose.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Measurable data point from a resource

Notification based on a condition

Customizable view of metrics

Monitors availability of a service

Metric derived from log entries

Why these pairings

Cloud Monitoring resources serve distinct purposes: Workspace organizes monitoring data, Alerting Policies define alert conditions, Notification Channels specify delivery methods, and Uptime Checks verify resource availability. The distractors confuse these roles.

430
MCQmedium

A company is deploying a microservices application on Google Kubernetes Engine (GKE). They want to expose their services to the internet using a single external IP address and route traffic based on the request path. Which resource should they use?

A.An Ingress resource
B.A Service of type NodePort
C.A Service of type LoadBalancer for each microservice
D.A Network Endpoint Group (NEG)
AnswerA

An Ingress resource is the Kubernetes API object that manages external HTTP(S) access to services, providing L7 load balancing with path-based and host-based routing. In GKE, it integrates with Google Cloud Load Balancing to expose all microservices through a single external IP address, forwarding requests to the appropriate backend Service based on the URL path. This makes it the correct choice for routing traffic to multiple microservices without creating separate external IPs.

Why this answer

An Ingress resource is the correct choice because it provides HTTP(S) layer 7 routing, allowing you to expose multiple services behind a single external IP address and route traffic based on request paths (e.g., /api to one service, /web to another). This meets the requirement of using one external IP and path-based routing, which a Service alone cannot achieve.

Exam trap

The trap here is that candidates often confuse a Service of type LoadBalancer with an Ingress, thinking that a LoadBalancer can also provide path-based routing, but a LoadBalancer operates at layer 4 (TCP/UDP) and cannot inspect HTTP paths, whereas Ingress operates at layer 7 and is specifically designed for such routing.

How to eliminate wrong answers

Option B is wrong because a Service of type NodePort exposes the service on a static port on each node's IP, but it does not provide a single external IP or path-based routing; it requires additional infrastructure (like an external load balancer) to route traffic. Option C is wrong because a Service of type LoadBalancer for each microservice would create a separate external IP per service, violating the requirement for a single external IP and not supporting path-based routing. Option D is wrong because a Network Endpoint Group (NEG) is a backend resource used with load balancers to specify endpoints (e.g., pods), but it does not itself expose services or route traffic based on request paths; it is a configuration component, not a routing resource.

431
MCQhard

A company manages a production GKE cluster with node auto-upgrade enabled. They want to ensure that during a node upgrade, the workloads are rescheduled gracefully without downtime. What Kubernetes resource should be configured on their Deployments?

A.PodDisruptionBudget
B.HorizontalPodAutoscaler
C.ResourceQuota
D.Node affinity rules
AnswerA

PodDisruptionBudget (PDB) is the correct answer because it is the Kubernetes object specifically designed to protect applications during voluntary disruptions, such as GKE node auto-upgrades that drain nodes. A PDB uses minAvailable or maxUnavailable to define how many pods must remain available during evictions; when a node is being upgraded, the eviction API checks the PDB and blocks eviction of a pod if it would violate the budget. This ensures the production workload retains a guaranteed number of replicas, preventing downtime during node maintenance.

Why this answer

PodDisruptionBudget (PDB) allows you to specify the minimum available or maximum unavailable pods during voluntary disruptions like node upgrades. Without a PDB, a node upgrade could evict all pods at once, causing downtime. ResourceQuota and HorizontalPodAutoscaler do not control disruption.

432
Multi-Selectmedium

A company wants to automate the response to specific log entries by triggering a Cloud Function. Which THREE components are required? (Choose 3)

Select 3 answers
A.Cloud Function (Pub/Sub trigger)
B.Cloud Logging log sink
C.Pub/Sub topic
D.BigQuery dataset
E.Cloud Monitoring notification channel
AnswersA, B, C

A Cloud Function with a Pub/Sub trigger is the compute piece that executes your custom response logic asynchronously. When a message lands on the subscribed topic, the function is invoked with the message payload, letting you parse the log data and call external APIs, send alerts, or modify resources. This event-driven model avoids maintaining a server and scales automatically with message volume. Without this function, the sink and topic would merely transport logs with no automated reaction.

Why this answer

Log entries must be routed to a Pub/Sub topic via a log sink. The Cloud Function subscribes to that topic (triggered by Pub/Sub). The log sink is the exporter, Pub/Sub is the intermediary, and Cloud Function is the action.

A notification channel is for alerts, not triggers. BigQuery is not needed.

433
MCQeasy

A startup's application uses both GCP services and an existing on-premises Kubernetes cluster. They want a single control plane to manage Kubernetes clusters across both environments with consistent policy enforcement. Which Google service provides this?

A.GKE Hub (Fleet management)
B.Anthos (Google Distributed Cloud) for hybrid multi-cluster management
C.Cloud Interconnect — connects on-premises clusters to GCP so they share a control plane
D.Cloud Composer — a managed Kubernetes workflow across environments
AnswerB

Anthos (Google Distributed Cloud) is a hybrid multi-cloud platform built on Kubernetes that provides consistent clusters across on-premises data centers, GCP, AWS, and Azure. It integrates Anthos Config Management for policy propagation, Anthos Service Mesh for traffic and observability, and a unified multicluster control plane, enabling consistent security, CI/CD, and application operations. This platform-level approach is what actually delivers unified hybrid multi-cluster management.

Why this answer

Anthos (Google Distributed Cloud) is the correct answer because it provides a unified control plane for managing Kubernetes clusters across on-premises and GCP environments, enabling consistent policy enforcement, configuration, and observability. Anthos uses GKE on-prem and GKE in the cloud, with a centralized Anthos Config Management and Service Mesh for policy and security consistency, directly addressing the hybrid multi-cluster management requirement.

Exam trap

The trap here is that candidates confuse GKE Hub (a fleet management feature) with the full Anthos platform, forgetting that GKE Hub alone does not manage on-premises clusters without Anthos GKE On-Prem.

How to eliminate wrong answers

Option A is wrong because GKE Hub (Fleet management) is a component within Anthos that provides a centralized view and policy management for GKE clusters, but it is not a standalone service that manages both on-premises and GCP clusters with a single control plane; it relies on Anthos for hybrid capabilities. Option C is wrong because Cloud Interconnect provides dedicated network connectivity between on-premises and GCP, but it does not provide a control plane for managing Kubernetes clusters; it is a networking service, not a cluster management service. Option D is wrong because Cloud Composer is a managed Apache Airflow workflow orchestration service, not a Kubernetes cluster management platform; it can run workflows across environments but does not provide a unified control plane or policy enforcement for Kubernetes clusters.

434
MCQeasy

An engineer needs to monitor the external HTTP availability of a web application hosted on Compute Engine. Which Cloud Monitoring feature should they use?

A.Uptime check
B.Dashboard
C.Metric Explorer
D.Log-based alert
AnswerA

An uptime check is a Cloud Monitoring synthetic probe that periodically sends an HTTP(S) request to the specified URL from configurable global locations. It validates availability by checking for expected HTTP status codes, response time thresholds, and optional content matches, and it emits metrics such as uptime, latency, and check success. This is the correct choice because it actively measures external HTTP reachability from outside the network, which is exactly what is needed to monitor external availability.

Why this answer

Uptime checks are designed to verify that a resource is accessible and measure response latency from various locations. They can check HTTP/HTTPS/TCP endpoints.

435
MCQhard

A media company ingests 500,000 events per second from IoT sensors and needs to store them for time-series analytics queries that scan billions of rows. Which storage service is most appropriate?

A.Cloud Firestore
B.Cloud SQL for MySQL
C.Cloud Bigtable
D.BigQuery streaming inserts
AnswerC

Cloud Bigtable is purpose-built for high-throughput, low-latency NoSQL workloads, including IoT time-series ingestion at 500K events/second. It scales linearly by adding nodes, supports millions of writes per second, and uses row keys like device timestamp to enable fast point reads and range scans. Its wide-column storage model is optimized for analytical patterns over sequential time-series data, making it the ideal choice over relational or document databases.

Why this answer

Cloud Bigtable is the most appropriate service because it is a fully managed, scalable NoSQL database designed for high-throughput, low-latency workloads like IoT sensor data ingestion at 500,000 events per second. It supports time-series analytics queries scanning billions of rows via its wide-column storage model and integration with BigQuery for complex analytics, while providing sub-10ms latency for point lookups and efficient range scans.

Exam trap

Google Cloud often tests the misconception that BigQuery streaming inserts are a storage service for high-ingestion workloads, but the trap here is that BigQuery is a data warehouse for analytics, not a low-latency storage system for time-series data, and its streaming limit is far lower than Bigtable's throughput.

How to eliminate wrong answers

Option A is wrong because Cloud Firestore is a document-oriented NoSQL database optimized for mobile and web app real-time synchronization, not for high-ingestion-rate time-series workloads; it has a maximum write rate of 10,000 writes per second per database, far below 500,000 events per second. Option B is wrong because Cloud SQL for MySQL is a relational database with limited horizontal scaling and a maximum of 30,000 queries per second for the highest tier, making it unsuitable for ingesting 500,000 events per second and scanning billions of rows. Option D is wrong because BigQuery streaming inserts are designed for real-time analytics ingestion into a data warehouse, but they have a per-project streaming limit of 100,000 rows per second (default) and are not optimized for sub-second point lookups or high-frequency time-series storage; Bigtable is the correct storage layer before streaming into BigQuery for analytics.

436
MCQmedium

A security team wants to centrally identify misconfigured GCP resources across their organization — such as publicly accessible Cloud Storage buckets, unencrypted disks, and overly permissive firewall rules. Which GCP service provides these findings?

A.Cloud Asset Inventory — query for all resources and write custom checks
B.Security Command Center (SCC) with Security Health Analytics enabled
C.Cloud Monitoring alert policies with metric conditions for firewall rule changes
D.Cloud Logging audit log analysis for admin activity changes
AnswerB

Security Command Center (SCC) with Security Health Analytics enabled is the correct choice because it automatically runs continuous, built-in scans for known security misconfigurations and vulnerabilities across your GCP resources. It uses detectors based on CIS benchmarks and other GCP best practices, surfacing findings such as publicly exposed Cloud Storage buckets, overly permissive firewall rules, and non-compliant IAM bindings at the organization, folder, and project level. It provides a centralized dashboard and API to see the current security posture without requiring custom logic or manual log parsing.

Why this answer

Security Command Center (SCC) with Security Health Analytics enabled is the correct service because it provides built-in, automated scanning for common misconfigurations such as publicly accessible Cloud Storage buckets, unencrypted disks, and overly permissive firewall rules. Security Health Analytics uses a set of pre-defined detectors (e.g., `PUBLIC_BUCKET_ACL`, `DISK_ENCRYPTION_DISABLED`, `FIREWALL_RULE_OPEN`) to continuously assess resources and surface findings in the SCC dashboard, without requiring custom code or manual queries.

Exam trap

The trap here is that candidates often confuse Cloud Asset Inventory's ability to list all resources with the ability to automatically detect misconfigurations, when in reality it only provides raw resource metadata and requires custom logic to identify security issues.

How to eliminate wrong answers

Option A is wrong because Cloud Asset Inventory is a metadata and history service for querying resource snapshots and changes, but it does not have built-in detectors for security misconfigurations; it requires writing custom checks or exporting data to other tools to identify issues like public buckets or unencrypted disks. Option C is wrong because Cloud Monitoring alert policies with metric conditions can notify on firewall rule changes (e.g., via metric `firewall_rule_count`), but they cannot directly detect the misconfiguration (e.g., overly permissive rules) — they only react to change events, not assess the security posture of the rule itself. Option D is wrong because Cloud Logging audit log analysis for admin activity changes can track who changed a firewall rule or bucket ACL, but it does not evaluate whether the resulting configuration is insecure (e.g., public access or missing encryption); it provides an audit trail, not a security assessment.

437
Drag & Dropmedium

Arrange the steps to deploy a containerized application to Google Kubernetes Engine (GKE) using a Deployment and expose it via a Service.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

The correct sequence for deploying a containerized application to GKE is to first create a GKE cluster (the underlying infrastructure), then deploy your application using a Kubernetes Deployment, and finally expose that Deployment via a Service to allow external access. This order ensures all dependencies are met: the cluster must exist before any workloads are created, and the Service references an existing Deployment.

438
Multi-Selectmedium

Your company has a production project and a development project. You want to ensure that no one can delete the production project accidentally. Which TWO actions should you take? (Choose 2)

Select 2 answers
A.Apply an organization policy constraint that blocks project deletion.
B.Set a deletion protection policy on the project.
C.Set a budget alert at 100% of projected spend.
D.Remove the Owner role from all users and grant only Editor.
E.Add a label to the project indicating it is production.
AnswersA, B

Organization policy constraints are centralized guardrails evaluated by Google Cloud Resource Manager before IAM. Applying a boolean constraint such as `constraints/resourcemanager.projectDelete` at the organization or folder level explicitly denies the `resourcemanager.projects.delete` action for every principal, overriding project-level IAM roles. This makes it an authoritative, non-bypassable control that prevents a production project from being deleted from any console or API path.

Why this answer

To prevent accidental deletion, you can set a deletion protection policy at the project level. Additionally, using an organization policy constraint 'constraints/resourcemanager.projectDelete' at the folder or organization level can block deletion. Labels don't prevent deletion.

Removing the Owner role from all users would break management. Budget alerts don't prevent deletion.

439
MCQeasy

A developer accidentally grants the Owner role to a test service account on the production project. The team wants to remove only this specific IAM binding without affecting other members' access. Which gcloud command achieves this?

A.gcloud projects set-iam-policy [PROJECT] --member=serviceAccount:[SA] --role=roles/owner
B.gcloud projects remove-iam-policy-binding [PROJECT] --member=serviceAccount:[SA_EMAIL] --role=roles/owner
C.gcloud iam remove-binding --project=[PROJECT] --member=[SA] --role=owner
D.gcloud projects delete-member [PROJECT] --member=serviceAccount:[SA_EMAIL]
AnswerB

This is the correct command because it surgically removes the specified service account from the roles/owner role on the project while leaving every other IAM binding untouched. The command takes the project name, member string in serviceAccount: format, and role ID to precisely identify the binding to delete. It is the safe, expected way to revoke a single principal's role, and it performs an atomic update to the IAM policy without requiring you to fetch or rewrite the entire policy.

Why this answer

`gcloud projects remove-iam-policy-binding` is the precise command to remove a single IAM binding (member-role pair) from a project's policy without affecting other bindings. It takes the project ID, member (service account email), and role as parameters, ensuring only the specified binding is removed. This command modifies the existing policy by removing only that specific entry, leaving all other IAM bindings intact.

Exam trap

Google Cloud often tests the distinction between commands that modify the entire policy (`set-iam-policy`) versus those that surgically remove a single binding (`remove-iam-policy-binding`), and candidates may confuse the valid command syntax or assume a generic `remove-binding` subcommand exists.

How to eliminate wrong answers

Option A is wrong because `gcloud projects set-iam-policy` replaces the entire IAM policy for the project with a new policy file; it does not remove a single binding and would overwrite all existing permissions if used incorrectly. Option C is wrong because `gcloud iam remove-binding` is not a valid gcloud command; the correct verb is `remove-iam-policy-binding` under the `projects` resource, and the role flag should be `roles/owner` not `owner`. Option D is wrong because `gcloud projects delete-member` is not a valid gcloud command; there is no such subcommand for removing a member from a project.

440
MCQmedium

A Cloud Run service is experiencing high latency. You suspect one revision is causing the issue. The service is configured to split traffic 90% to revision A and 10% to revision B. You want to gradually shift traffic back to revision A only. Which command should you use?

A.kubectl set traffic my-service --revision=my-service-00001=100
B.gcloud run services update-traffic my-service --to-revisions=my-service-00001=100
C.gcloud run revisions delete my-service-00002
D.gcloud run services update my-service --set-revision my-service-00001
AnswerB

This is the correct, supported command for adjusting traffic on a Cloud Run service. The 'update-traffic' subcommand directly modifies the revision routing percents, and '--to-revisions' allows explicit targeting of a specific revision; here, setting 'my-service-00001=100' routes all live traffic to the known-good revision A. This immediately reduces load on the suspect revision B and is exactly how you roll back a bad deployment on Cloud Run.

Why this answer

gcloud run services update-traffic allows you to set traffic percentages for revisions. Setting 100% to revision A achieves the goal.

441
MCQhard

A security auditor needs to check whether a specific user (user@company.com) currently has sufficient permissions to delete a Cloud SQL instance in project 'prod-db'. Without making any changes, which tool simulates this check?

A.Run the delete command with `--dry-run` flag to simulate without executing
B.Use the IAM Policy Troubleshooter (Policy Simulator) to check if the permission is granted
C.Inspect the IAM policy with `gcloud projects get-iam-policy` and manually trace inheritance
D.Grant the user the permission temporarily, test the delete, then revoke it
AnswerB

The IAM Policy Troubleshooter (also known as the Policy Simulator in some contexts) calculates the effective IAM policy for a specific principal, permission, and resource, taking into account inherited roles, group memberships, conditional bindings, and deny policies. For a Cloud SQL delete, it can verify whether the principal has the `cloudsql.instances.delete` permission. It provides an immediate, non-destructive answer through the Cloud Console or the `gcloud policy-troubleshoot` CLI, without requiring any policy changes.

Why this answer

The IAM Policy Troubleshooter (Policy Simulator) is the correct tool because it allows you to check whether a specific user has a particular permission (e.g., cloudsql.instances.delete) on a given resource (the Cloud SQL instance in project 'prod-db') without making any changes. It evaluates the effective IAM policy, including all inherited roles and policies, and returns a result indicating whether the permission is granted. This directly addresses the auditor's need to simulate a permission check without executing any action.

Exam trap

Google Cloud often tests the misconception that a dry-run flag or manual policy inspection is sufficient for permission checks, but the trap here is that only the IAM Policy Troubleshooter provides a comprehensive, no-change simulation that evaluates all policy types and inheritance paths, which is essential for security audits.

How to eliminate wrong answers

Option A is wrong because the `--dry-run` flag is not supported by the `gcloud sql instances delete` command; Cloud SQL does not implement a dry-run mode for deletion operations, and even if it did, it would simulate the deletion action itself, not check permissions. Option C is wrong because manually inspecting the IAM policy with `gcloud projects get-iam-policy` and tracing inheritance is error-prone, time-consuming, and does not account for all policy types (e.g., deny policies, conditional roles, or resource-level policies) that the Policy Troubleshooter evaluates automatically. Option D is wrong because granting the user the permission temporarily, testing the delete, and then revoking it is an insecure and disruptive approach that changes the environment, violates the 'without making any changes' requirement, and could lead to unintended consequences or audit compliance issues.

442
Multi-Selectmedium

An engineer is setting up a new GCP project for a containerized application. They need to enable the required APIs. Which TWO APIs must be enabled to deploy and manage a Kubernetes cluster and build container images?

Select 2 answers
A.compute.googleapis.com
B.bigquery.googleapis.com
C.cloudbuild.googleapis.com
D.container.googleapis.com
E.cloudfunctions.googleapis.com
AnswersC, D

Cloud Build is Google Cloud's CI/CD service that can compile source code and build Docker container images. If the engineer's containerized application is built from a repository, enabling cloudbuild.googleapis.com is required before Cloud Build can push built images to Container Registry or Artifact Registry. Thus, for a project that automates image creation for GKE, this API is a correct and necessary dependency.

Why this answer

Kubernetes Engine API and Cloud Build API are needed for cluster management and building images.

443
Multi-Selectmedium

A company needs to audit all actions that modify a Cloud Storage bucket. Which TWO steps should they take to enable this? (Choose 2 answers.)

Select 2 answers
A.Use Log Explorer to filter logs by the Cloud Storage service and the 'data_access' log type.
B.Create a VPC Service Controls perimeter.
C.Enable Admin Activity audit logs for the Cloud Storage service.
D.Assign the roles/logging.viewer role to the security team.
E.Enable Data Access audit logs for the Cloud Storage service in the project's IAM audit config.
AnswersA, E

Using Log Explorer in the Google Cloud console lets you query and filter audit logs once they are enabled. By applying a filter for the Cloud Storage service and the 'data_access' log type, you can view object-level operations such as writes, deletes, and overwrites. This is the final step that makes the audit trail visible and actionable for compliance, but it requires Data Access logging to already be enabled in the IAM audit config.

Why this answer

To audit data access modifications, you need to enable Data Access audit logs for the storage service and then view those logs in Log Explorer. Admin Activity logs record configuration changes (like creating a bucket), but data modifications (like uploading objects) require Data Access logs.

444
MCQmedium

A team discovers their Cloud Logging costs are unexpectedly high. The majority of costs come from verbose DEBUG-level logs from a development service in production. They want to stop storing DEBUG logs without modifying the application. What is the solution?

A.Set the application's log level to INFO — this is the only way to reduce log volume
B.Create a Cloud Logging exclusion filter to discard DEBUG-level log entries from the service
C.Move the development service to a separate GCP project with a lower logging tier
D.Delete old DEBUG log entries manually — Cloud Logging charges for stored volume
AnswerB

A Cloud Logging exclusion filter in the Log Router can match DEBUG entries from the service's resource type (e.g., `resource.type="cloud_run_revision"` and `severity=DEBUG`) and discard them before they are written to any sink or storage. Because exclusion filters are evaluated during ingestion, the matched entries are never billed, so this reduces logging costs immediately without code changes or redeployment. The application can keep emitting DEBUG logs; Log Router simply drops them, making this the operational solution that directly addresses the cost driver.

Why this answer

Cloud Logging exclusion filters allow you to discard log entries based on criteria such as severity level, log name, or resource labels before they are ingested and stored. By creating an exclusion filter that matches DEBUG-level log entries from the specific development service, you can stop storing those logs without modifying the application code. This approach directly reduces storage costs because excluded logs are not indexed or retained.

Exam trap

The trap here is that candidates may think modifying the application's log level is the only way to reduce log volume, but Cloud Logging exclusion filters provide a non-invasive, infrastructure-level solution that avoids code changes.

How to eliminate wrong answers

Option A is wrong because setting the application's log level to INFO would require modifying the application code or configuration, which the question explicitly states is not allowed. Option C is wrong because moving the service to a separate GCP project does not reduce log volume; it merely shifts the cost to another project, and Cloud Logging charges are based on ingestion and storage regardless of project. Option D is wrong because deleting old DEBUG log entries manually does not prevent future DEBUG logs from being ingested and stored, and Cloud Logging charges are primarily for ingestion volume, not just stored volume.

445
MCQmedium

A data analytics team runs Apache Spark jobs to process large datasets. They need a managed cluster that provisions quickly, scales dynamically, and integrates with Cloud Storage and BigQuery. Which service should they use?

A.Cloud Dataflow
B.Cloud Dataproc
C.Cloud Composer
D.Cloud Run with a custom Spark container
AnswerB

Cloud Dataproc is the fully managed Apache Spark and Hadoop service on Google Cloud, purpose-built to run Spark jobs at scale. It offers fast cluster provisioning via ephemeral clusters, direct connectors to Cloud Storage and BigQuery for reading and writing data without ETL, and automatically manages the HDFS/YARN infrastructure. Because it is native to Spark and integrates with the Google Cloud ecosystem, it is the correct choice for executing Spark workloads.

Why this answer

Cloud Dataproc is the correct choice because it is a managed Spark and Hadoop service that provisions clusters in under 90 seconds, supports autoscaling, and natively integrates with Cloud Storage (via the gs:// connector) and BigQuery (via the BigQuery Storage API and Spark BigQuery connector). This makes it ideal for teams needing fast, dynamic, and integrated Spark job execution.

Exam trap

The trap here is that candidates confuse Cloud Dataflow (a Beam-based service) with a managed Spark service, or assume Cloud Run can handle dynamic Spark cluster scaling, when in fact only Cloud Dataproc provides the native Spark runtime and auto-scaling cluster management required for this use case.

How to eliminate wrong answers

Option A is wrong because Cloud Dataflow is a unified stream and batch data processing service based on Apache Beam, not Apache Spark, and it does not provide a managed Spark cluster. Option C is wrong because Cloud Composer is a managed Apache Airflow workflow orchestration service, not a compute engine for running Spark jobs; it can trigger Dataproc jobs but does not run Spark itself. Option D is wrong because Cloud Run is a serverless container platform that does not support dynamic cluster scaling for Spark workloads and lacks native integration with Cloud Storage and BigQuery for Spark; running a custom Spark container on Cloud Run would require manual cluster management and does not provide the managed, auto-scaling Spark environment that Dataproc offers.

446
MCQeasy

Which gcloud CLI command authenticates a developer's local environment with their Google account?

A.gcloud config set account [EMAIL]
B.gcloud auth login
C.gcloud init --authenticate
D.gcloud accounts activate
AnswerB

`gcloud auth login` is the correct way to initiate interactive user authentication via Google's OAuth 2.0 flow. It opens a browser to obtain an access token and refresh token, then securely stores those credentials in your local `~/.config/gcloud/` directory. After this step, all `gcloud` commands automatically use these stored credentials for the active account, eliminating the need to re-authenticate for each command.

Why this answer

`gcloud auth login`, is correct because it initiates the OAuth 2.0 flow to authenticate the gcloud CLI with a user's Google account, storing the resulting credentials locally for subsequent API calls. This command is the standard way to authorize a developer's local environment for the first time or when switching users.

Exam trap

The trap here is that candidates confuse configuration commands (like `gcloud config set account`) with authentication commands, mistakenly thinking setting an account name is sufficient to establish credentials, when in fact it only selects a pre-existing authenticated account.

How to eliminate wrong answers

Option A is wrong because `gcloud config set account [EMAIL]` only sets the active account configuration to an already-authenticated account; it does not perform any authentication or credential acquisition. Option C is wrong because `gcloud init --authenticate` is not a valid gcloud command; `gcloud init` can configure a new environment and optionally trigger authentication, but the `--authenticate` flag does not exist. Option D is wrong because `gcloud accounts activate` is not a valid gcloud command; the correct command to switch between authenticated accounts is `gcloud config set account` or `gcloud auth login` to re-authenticate.

447
MCQeasy

Which gcloud command creates a Compute Engine VM named 'web-01' using the e2-medium machine type in zone us-central1-a?

A.gcloud vm create web-01 --zone=us-central1-a --machine=e2-medium
B.gcloud compute instances create web-01 --zone=us-central1-a --machine-type=e2-medium
C.gcloud instances create web-01 --region=us-central1 --type=e2-medium
D.gcloud compute create-instance web-01 --zone=us-central1-a --size=e2-medium
AnswerB

This is the correct syntax. 'gcloud compute instances create' targets the Compute Engine service's 'instances' resource and the 'create' verb. The '--zone' flag designates the zonal location for the VM (required if no region-level default), and '--machine-type' specifies the predefined machine type (e.g., 'e2-medium'). This creates an instance in the current project with the given configuration.

Why this answer

The `gcloud compute instances create` command is the proper syntax for creating a Compute Engine VM, and it requires the `--machine-type` flag (not `--machine`) to specify the machine type. The zone is specified with `--zone`, and the VM name is provided as a positional argument.

Exam trap

Google Cloud often tests the exact command syntax, and the trap here is that candidates confuse the `gcloud compute instances create` command with shorter, non-existent variants like `gcloud vm create` or `gcloud instances create`, or they use incorrect flag names like `--machine` or `--size` instead of the correct `--machine-type`.

How to eliminate wrong answers

Option A is wrong because `gcloud vm create` is not a valid gcloud command; the correct resource hierarchy is `gcloud compute instances create`. Additionally, the flag for machine type is `--machine-type`, not `--machine`. Option C is wrong because it uses `--region=us-central1` instead of `--zone=us-central1-a`, and zones are required for VM creation (regions are used for regional resources like managed instance groups).

It also uses `--type=e2-medium` instead of `--machine-type=e2-medium`. Option D is wrong because `gcloud compute create-instance` is not a valid command; the correct verb is `instances create`. It also uses `--size=e2-medium` instead of `--machine-type=e2-medium`.

448
MCQeasy

You need to update the container image of a deployment named 'my-app' in GKE to a new version. Which command should you use?

A.kubectl apply -f updated-deployment.yaml
B.kubectl update deployment my-app --image=my-image:v2
C.kubectl edit deployment my-app --image=my-image:v2
D.kubectl set image deployment/my-app my-app-container=my-image:v2
AnswerD

kubectl set image deployment/my-app my-app-container=my-image:v2 is correct because it imperatively changes the image of the container named 'my-app-container' in the deployment 'my-app'. The syntax is RESOURCE_TYPE/RESOURCE_NAME CONTAINER_NAME=IMAGE, and the command triggers a rolling update by creating a new ReplicaSet and scaling it up while scaling down the old one. This is the standard kubectl command for updating a container image without modifying a manifest or entering a text editor. After running it, you can monitor progress with kubectl rollout status deployment/my-app.

Why this answer

kubectl set image updates the image of a deployment.

449
MCQhard

A financial services company needs to run analytics queries on transaction data that arrives in real-time. The queries must return results within 2 seconds and the dataset grows by ~100 GB per day. The company also needs to retain all data for 7 years for regulatory compliance. Which architecture best satisfies these requirements?

A.Write transactions to Cloud Spanner; run analytics queries directly against Spanner.
B.Stream transactions through Pub/Sub → Dataflow → BigQuery; run analytics on BigQuery.
C.Store transactions in Cloud Bigtable and use Dataproc/Spark for analytics queries.
D.Use Cloud SQL for storage and Cloud Dataprep for analytics transformations.
AnswerB

This is the canonical Google Cloud streaming analytics architecture: Pub/Sub ingests transaction streams asynchronously, Dataflow provides exactly-once, auto-scaling transformations (including windowing and enrichment), and BigQuery stores the results in columnar, partitioned tables. BigQuery's Dremel execution engine and optional BI Engine provide sub-second-to-2-second query performance on recent data, while table partitioning and time-based expiration handle multi-year retention cost-effectively. This serverless pattern avoids managing infrastructure and scales seamlessly from low to very high streaming throughput, making it the only option that meets both the performance and retention requirements.

Why this answer

It uses Pub/Sub for real-time ingestion, Dataflow for stream processing, and BigQuery for analytics, which can handle 100 GB/day growth and return queries within 2 seconds using BigQuery's columnar storage and automatic sharding. BigQuery's 7-year retention is supported by its time-based partitioning and long-term storage at reduced cost, meeting regulatory compliance without manual intervention.

Exam trap

Google Cloud often tests the distinction between OLTP (Spanner, Cloud SQL) and OLAP (BigQuery) services, and candidates mistakenly choose Spanner for analytics because of its global scale and strong consistency, overlooking that it is not optimized for large-scale analytical queries with strict latency SLAs.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner is designed for transactional (OLTP) workloads with strong consistency, not for large-scale analytics (OLAP); running complex analytics queries directly on Spanner would exceed the 2-second latency requirement and incur high costs due to its node-based pricing and row-oriented storage. Option C is wrong because Cloud Bigtable is a NoSQL wide-column store optimized for high-throughput, low-latency point lookups and time-series data, but it lacks native SQL analytics capabilities; using Dataproc/Spark adds overhead for query parsing and job scheduling, making it difficult to consistently return results within 2 seconds, and Bigtable's storage is not cost-effective for 7 years of retention at 100 GB/day. Option D is wrong because Cloud SQL is a relational database with limited scalability (max ~30 TB per instance) and is not designed for real-time streaming or petabyte-scale analytics; Cloud Dataprep is a data preparation tool for cleaning and transforming data, not for running analytics queries, and it cannot meet the 2-second query latency requirement.

450
MCQmedium

An organization needs to audit all data access (read/write) to a Cloud Storage bucket for compliance. Which type of audit log should they enable?

A.System Event audit logs
B.Access Transparency logs
C.Admin Activity audit logs
D.Data Access audit logs
AnswerD

Data Access audit logs are the correct Cloud Audit Logs category for recording data-plane read/write operations, including Cloud Storage object GETs, BigQuery query reads, and Pub/Sub message publishes/pulls. They are typically disabled by default for most services and must be explicitly enabled for each service in the Audit Logs configuration, after which they deliver the who/what/when trail needed to audit data access across the organization.

Why this answer

Data Access audit logs record who accessed what data, including read and write operations. Admin Activity logs record changes to configurations, not data access. To enable Data Access logs, they need to configure the audit policy at the organization, folder, or project level for the specific service (storage.googleapis.com).

Page 5

Page 6 of 11

Page 7

All pages