Courseiva

Google Associate Cloud Engineer (ACE) — Questions 301375

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

Page 4

Page 5 of 11

Page 6
301
MCQmedium

A security audit found that several Cloud Storage buckets in your project have `allAuthenticatedUsers` in their IAM policy with `storage.objectViewer`. What does `allAuthenticatedUsers` grant, and why is it a security risk?

A.It grants access only to users within your Google Workspace domain — a minor risk if your domain is small.
B.It grants read access to any person with a Google account — effectively near-public access since Google accounts are free to create.
C.It grants access only to Google service accounts, which is acceptable since those are controlled.
D.It grants access to authenticated GCP users in your organization's IAM policy — this is normal for shared resources.
AnswerB

In Cloud IAM, allAuthenticatedUsers is a special principal that matches any identity that is authenticated with Google, which includes not only your organization's users but every Gmail account, Workspace account, and even service account in the world. Because anyone can create a Google account for free, this permission is functionally equivalent to public access — a random individual only needs a few seconds to sign up and gain the granted role. For internal or sensitive data, this exposure is unacceptable, so the security risk is severe rather than minor.

Why this answer

`allAuthenticatedUsers` is a special IAM member that includes any person authenticated with a Google account, regardless of whether they belong to your organization or domain. Granting `storage.objectViewer` to this group means anyone with a free Google account (e.g., Gmail) can list and read objects in the bucket, making the data effectively public. This is a significant security risk because it exposes sensitive data to a vast, uncontrolled audience.

Exam trap

Google Cloud often tests the distinction between `allAuthenticatedUsers` and `allUsers`, where candidates mistakenly think `allAuthenticatedUsers` is safe because it requires authentication, but the trap is that any Google account (free or otherwise) qualifies, making it nearly as risky as `allUsers` for sensitive data.

How to eliminate wrong answers

Option A is wrong because `allAuthenticatedUsers` is not restricted to a Google Workspace domain; it includes all Google account holders, not just domain users. Option C is wrong because `allAuthenticatedUsers` includes human users with Google accounts, not just service accounts; service accounts are covered by `allUsers` or specific service account emails. Option D is wrong because `allAuthenticatedUsers` is not limited to users in your organization's IAM policy; it encompasses any authenticated Google identity, including external users.

302
MCQmedium

A GKE application Pod needs a sidecar container that proxies all outbound network requests through an audit logger before they reach the internet. Both containers share the same network namespace. Which Kubernetes pattern implements this?

A.Run the audit logger as a separate Deployment and route traffic via a Service
B.Add the audit logger as a second container in the same Pod spec (sidecar pattern)
C.Use a DaemonSet for the audit logger on each node to intercept node-level traffic
D.Add an initContainer to start the audit logger before the main application
AnswerB

A sidecar container in the same Pod shares the network namespace with the main application container, meaning both can bind to the same localhost interface and the sidecar can transparently proxy or audit all traffic entering or leaving the Pod. This pattern is ideal for audit logging because it requires no code changes to the application and provides a complete view of the Pod's network activity, including both inbound and outbound connections, at the Pod boundary.

Why this answer

The sidecar pattern allows two containers to share the same network namespace within a single Pod, enabling the audit logger to intercept all outbound traffic from the application container before it reaches the internet. This is achieved by configuring the application container to route its outbound requests through the sidecar (e.g., via a localhost proxy or iptables rules), ensuring all traffic is logged without external network hops.

Exam trap

Google Cloud often tests the distinction between initContainers and sidecars, where candidates mistakenly choose initContainers because they think 'start before the main app' implies ongoing traffic interception, but initContainers exit after completion and cannot proxy runtime traffic.

How to eliminate wrong answers

Option A is wrong because running the audit logger as a separate Deployment and routing traffic via a Service introduces network latency and a separate IP address, breaking the requirement for the sidecar to intercept traffic within the same network namespace; the application would need to be explicitly configured to use the Service, which is not a transparent proxy. Option C is wrong because a DaemonSet runs a pod on each node for node-level traffic interception (e.g., using eBPF or iptables), but it does not share the same network namespace as the application Pod and cannot intercept per-Pod outbound requests without complex network policies. Option D is wrong because an initContainer runs to completion before the main application starts and cannot persist to proxy ongoing outbound traffic; it is used for setup tasks, not for runtime traffic interception.

303
MCQmedium

A company is using BigQuery for analytics. They notice that queries are slow and expensive. The data is loaded daily into a single table. Which action would most improve performance and reduce cost?

A.Use a flat-rate reservation to improve query concurrency.
B.Denormalize the table to reduce joins.
C.Increase the number of slots available for the project.
D.Partition the table by date and cluster by frequently filtered columns.
AnswerD

Partitioning the table by date allows BigQuery to use partition pruning, so queries with date range filters only read the relevant daily partitions instead of the full table. Clustering on frequently filtered columns further organizes data within each partition, enabling block-level pruning based on the cluster columns' values. Together, these features dramatically reduce the bytes scanned and the underlying I/O, directly improving query speed and reducing cost.

Why this answer

Partitioning the table by date allows BigQuery to prune partitions during query execution, scanning only the relevant daily data instead of the entire table. Clustering on frequently filtered columns further reduces the data scanned by sorting data within partitions. This directly reduces both query cost (pay-per-byte) and latency, addressing the core issue of slow, expensive queries on a large daily-loaded table.

Exam trap

Google Cloud often tests the misconception that increasing compute resources (slots or concurrency) is the primary fix for slow queries, when in reality data pruning via partitioning and clustering is the first and most impactful optimization for cost and performance.

How to eliminate wrong answers

Option A is wrong because a flat-rate reservation improves query concurrency and provides predictable slot capacity, but it does not reduce the amount of data scanned per query; slow and expensive queries due to scanning the entire table would persist. Option B is wrong because denormalization reduces joins but does not address the primary issue of scanning a massive single table; it may even increase storage costs and data scanned if not combined with partitioning/clustering. Option C is wrong because increasing slots (via reservations or flex slots) improves query execution speed by providing more parallel processing, but it does not reduce the bytes billed; queries would still scan the entire table, keeping costs high.

304
MCQeasy

You need to install the Google Cloud SDK on a Linux machine. Which command should you use to add the Cloud SDK distribution URI as a package source?

A.curl https://sdk.cloud.google.com | bash
B.gcloud init
C.sudo apt-get install google-cloud-sdk
D.echo 'deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main' | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
AnswerD

This command correctly configures the official Cloud SDK apt repository on a Debian or Ubuntu system by appending a sources.list entry with the signed-by parameter pointing to the imported Google signing key at /usr/share/keyrings/cloud.google.gpg. Using signed-by binds the repository to that specific key instead of trusting the global apt keyring, which is the recommended security practice. After running this, you still need to run sudo apt-get update and sudo apt-get install google-cloud-sdk, but this repository definition is the essential correct foundation for the package-manager installation method.

Why this answer

The Cloud SDK installation guide for Linux uses echo to add the URI to /etc/apt/sources.list.d/google-cloud-sdk.list.

305
MCQmedium

A platform admin creates a new GCP project for a team. The team lead's email is teamlead@company.com. The admin needs the team lead to be able to create resources in the project but not manage IAM policies or billing. Which role is most appropriate?

A.Owner
B.Editor
C.Viewer
D.Billing Account Administrator
AnswerB

Editor provides create, read, update, and delete permissions on all GCP resources, but explicitly excludes IAM policy changes and billing management. This aligns exactly with the team lead's requirement to create and manage resources without managing access controls or billing. It is a primitive role that is broader than needed for many tasks, but in this scenario it matches the stated need precisely without overprivileged access.

Why this answer

The Editor role (roles/editor) grants all permissions necessary to create, modify, and delete resources within a GCP project, but explicitly excludes permissions to manage IAM policies (roles/iam.securityAdmin or roles/owner) and billing (roles/billing.admin). This makes it the correct choice for a team lead who needs to deploy and manage resources without having the ability to change access controls or alter billing configurations.

Exam trap

Google Cloud often tests the distinction between resource-level permissions and management-level permissions, and the trap here is that candidates may confuse the Editor role with Owner because both can create resources, but only Owner can manage IAM and billing.

How to eliminate wrong answers

Option A is wrong because the Owner role (roles/owner) includes all Editor permissions plus the ability to manage IAM policies and billing, which violates the requirement that the team lead should not manage IAM or billing. Option C is wrong because the Viewer role (roles/viewer) only allows read-only access to existing resources and does not permit creating any resources. Option D is wrong because the Billing Account Administrator role (roles/billing.admin) manages billing accounts and budgets but does not grant any permissions to create project resources.

306
MCQmedium

An engineer needs to enable the Compute Engine API for a project using the gcloud command line. Which command should they run?

A.gcloud compute instances enable-api
B.gcloud services list --enabled
C.gcloud api enable compute
D.gcloud services enable compute.googleapis.com
AnswerD

This is the correct command to enable the Compute Engine API. `gcloud services enable compute.googleapis.com` tells the Service Usage API to enable the service in the current project. It uses the fully-qualified service name and is the standard gcloud method for this operation. After running it, you can create and manage Compute Engine instances via gcloud or the Console.

Why this answer

The command 'gcloud services enable compute.googleapis.com' enables the Compute Engine API for the current project. The other options either list services or are incorrect.

307
MCQmedium

A company is migrating a legacy monolithic application to Google Cloud. The application runs on a single VM and contains both the web server and backend processes. The team wants to separate concerns and deploy the web tier on Cloud Run and the backend on Compute Engine. They need to allow the Cloud Run service to initiate HTTPS connections to the backend VM. What is the most secure way to accomplish this?

A.Assign a public IP to the backend VM and configure firewall rules to allow HTTPS from any source
B.Set up a VPN tunnel between Cloud Run and the VPC
C.Use Cloud NAT to provide outbound internet access to Cloud Run
D.Use Serverless VPC Access to connect Cloud Run to the VPC, and keep the VM internal
AnswerD

Using Serverless VPC Access to connect Cloud Run to the VPC and keeping the VM internal is the correct approach because it enables private, encrypted communication over the Google network. The connector lets Cloud Run reach the VM's internal IP address without the VM ever needing a public IP or a firewall rule for public traffic. This minimizes the attack surface and is the recommended pattern for serverless-to-VPC connectivity.

Why this answer

Serverless VPC Access creates a direct, private connection between Cloud Run and your VPC, allowing the Cloud Run service to reach the backend VM using its internal IP address. This avoids exposing the VM to the public internet, which is the most secure approach for initiating HTTPS connections between the two tiers.

Exam trap

Google Cloud often tests the misconception that Cloud NAT or public IPs are needed for serverless-to-VM communication, but the correct approach is to use Serverless VPC Access for private, secure connectivity without exposing the backend.

How to eliminate wrong answers

Option A is wrong because assigning a public IP and allowing HTTPS from any source exposes the backend VM to the entire internet, violating the principle of least privilege and creating a significant security risk. Option B is wrong because a VPN tunnel is used to connect external networks (e.g., on-premises) to a VPC, not to connect a serverless service like Cloud Run to a VM within the same VPC. Option C is wrong because Cloud NAT provides outbound internet access for private instances, but Cloud Run already has outbound internet access by default; the issue is inbound connectivity to the backend VM, which Cloud NAT does not address.

308
MCQmedium

An engineer needs to attach an existing persistent disk to a Compute Engine instance. They have created the disk using 'gcloud compute disks create'. Which command should they use to attach it?

A.gcloud compute disks resize
B.gcloud compute instances attach-disk
C.gcloud compute instances add-disk
D.gcloud compute disks attach
AnswerB

gcloud compute instances attach-disk is the correct command: it attaches an existing zonal or regional persistent disk to a specified Compute Engine instance, using --disk and optionally --device-name. It works on both running and stopped instances, and it ensures the disk becomes visible as a block device in the instance's guest OS.

Why this answer

'gcloud compute instances attach-disk' attaches a disk to an instance. 'gcloud compute disks attach' does not exist. 'gcloud compute instances add-disk' is not a valid command. 'gcloud compute disks resize' resizes the disk.

309
MCQeasy

You want to export a subset of Cloud Logging logs to BigQuery for long-term analysis. Which method should you use?

A.Create a log-based metric and export the metric to BigQuery
B.Create a log sink with a filter and destination BigQuery
C.Set up a Cloud Function that triggers on logs and inserts into BigQuery
D.Use gcloud logging read and pipe to bq load
AnswerB

A log sink with a filter and a BigQuery destination is the fully managed, native way to export logs: Cloud Logging continuously routes any newly ingested log entries that match the filter into a specified BigQuery dataset. The sink automatically creates a table with the log schema, and you can use the _PARTITIONTIME pseudo-column for time-based partitioning. This gives reliable, near-real-time export without custom code or manual intervention.

Why this answer

Log sinks route logs to destinations like BigQuery, Cloud Storage, or Pub/Sub. Creating a sink with a filter is the correct approach.

310
Matchingmedium

Match each GCP networking concept to its description.

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

Concepts
Matches

Virtual private cloud network

Regional IP address range within a VPC

Outbound internet access for private instances

Distributes traffic across instances

Content delivery network for low-latency delivery

Why these pairings

VPC is a global network, Subnet is regional, Firewall rules control traffic, Cloud Router uses BGP for hybrid connectivity, and VPC Peering connects VPCs privately.

311
MCQmedium

You want to use gcloud CLI to set the default project to 'my-project' and the default compute zone to 'us-central1-a'. Which two gcloud config commands should you run?

A.gcloud config configurations set project my-project and gcloud config configurations set zone us-central1-a
B.gcloud config set project my-project and gcloud config set compute/zone us-central1-a
C.gcloud config set project my-project and gcloud config set zone us-central1-a
D.gcloud projects set my-project and gcloud compute zones set us-central1-a
AnswerB

The correct way to set the default project is `gcloud config set project my-project`, which updates the active configuration's core project property. The zone must be set as `compute/zone` because it belongs to the compute section of the property hierarchy; `gcloud config set compute/zone us-central1-a` is the accepted syntax. Together these commands ensure that subsequent gcloud commands automatically use the intended project and zone, which is essential for quick CLI workflows.

Why this answer

The commands are 'gcloud config set project my-project' and 'gcloud config set compute/zone us-central1-a'.

312
MCQmedium

A company wants to deploy a containerized application on Google Cloud that automatically scales to zero when not in use, and they want to minimize operational overhead. They also need to avoid managing any underlying infrastructure such as Kubernetes clusters or VMs. Which service should they use?

A.Google Kubernetes Engine (GKE)
B.App Engine Standard Environment
C.Cloud Run
D.Compute Engine with managed instance groups
AnswerC

Cloud Run is a fully managed serverless container platform that automatically scales in response to incoming requests, including scaling to zero when idle, so you only pay for the exact compute time consumed. It doesn't require any cluster or infrastructure management, and it can be used with Knative Serving APIs, making it the most direct fit for a stateless containerized application that needs to scale to zero.

Why this answer

Cloud Run is a fully managed serverless platform that can scale to zero when there is no traffic, and it abstracts away infrastructure management. GKE requires managing a cluster, Compute Engine involves managing VMs, and App Engine is also serverless but Cloud Run provides more flexibility with containers and also scales to zero.

313
MCQhard

A Cloud KMS key used to encrypt a Cloud Storage bucket's data is being destroyed. What happens to the data in the bucket when the KMS key is destroyed?

A.The data in Cloud Storage is automatically deleted along with the key.
B.The encrypted data becomes permanently inaccessible (cryptographic erasure) since the decryption key no longer exists.
C.Cloud Storage automatically re-encrypts the data using Google-managed keys as a fallback.
D.The key enters a 'disabled' state where data can still be decrypted by Google support.
AnswerB

Cloud Storage objects are encrypted with envelope encryption: a data encryption key (DEK) is generated per object and then wrapped by the Cloud KMS key. When that KMS key is destroyed, the DEK can never be unwrapped, so the ciphertext bytes in Cloud Storage remain but are mathematically unreadable. This is cryptographic erasure — effective deletion without physically deleting the stored object.

Why this answer

When a Cloud KMS key is destroyed, the encrypted data in Cloud Storage becomes permanently inaccessible because the cryptographic key material is irrecoverably deleted. This is known as cryptographic erasure: without the key, the ciphertext cannot be decrypted, even though the raw encrypted bytes still exist in the bucket. Cloud Storage does not store a copy of the KMS key, and there is no fallback mechanism to re-encrypt or recover the data.

Exam trap

Google Cloud often tests the misconception that destroying a KMS key triggers automatic data deletion or that Google provides a fallback re-encryption mechanism, when in fact the data remains but is cryptographically erased and unrecoverable.

How to eliminate wrong answers

Option A is wrong because destroying the KMS key does not trigger automatic deletion of the encrypted data objects in Cloud Storage; the objects remain but are unreadable. Option C is wrong because Cloud Storage does not automatically re-encrypt data with Google-managed keys when a customer-managed KMS key is destroyed; the data remains encrypted with the destroyed key and is permanently inaccessible. Option D is wrong because key destruction is irreversible and does not enter a 'disabled' state; Google Support cannot decrypt data after a KMS key is destroyed, as the key material is permanently deleted and no backup exists.

314
MCQeasy

Which gcloud command is used to deploy a Cloud Function triggered by HTTP requests?

A.gcloud functions call my-function --data '{"key":"value"}'
B.gcloud run deploy my-function --source . --platform managed
C.gcloud functions deploy my-function --runtime python39 --trigger-http
D.gcloud functions deploy my-function --runtime python39 --trigger-topic my-topic
AnswerC

This command correctly deploys an HTTP-triggered Cloud Function: `gcloud functions deploy` creates or updates a function resource, `--runtime python39` selects the Python 3.9 execution environment, and `--trigger-http` configures an HTTPS endpoint that invokes the function on web requests. No other trigger type is needed. The command will return a URL for the deployed function.

Why this answer

The command 'gcloud functions deploy' with --trigger-http creates an HTTP-triggered function. --runtime specifies the language runtime. --trigger-topic is for Pub/Sub triggers.

315
MCQhard

Your Cloud SQL for MySQL primary instance in `us-central1` has failed. Cloud SQL HA automatically fails over to the standby. After the failover, your application is experiencing intermittent connection errors. What is the most likely cause and solution?

A.The standby instance has a different IP address; update the connection string.
B.Application connection pools hold stale connections to the failed primary; configure pools to validate connections and reconnect after failure.
C.The standby replica must be manually promoted before it can accept connections.
D.The MySQL binary log is incomplete after failover; run `mysqlcheck` to repair tables.
AnswerB

Connection pools retain TCP sessions that were established with the original primary; when failover occurs, those sessions are forcibly terminated and remain marked as 'open' in the pool. Without validation, the pool hands out dead connections and the application sees errors immediately after failover. Configure the pool to test connections before borrowing (e.g., testOnBorrow with a lightweight SELECT 1, or initialization/eviction checks) and to create new connections automatically. Using the Cloud SQL Auth Proxy also masks this by re-establishing connections to the new primary seamlessly.

Why this answer

After a Cloud SQL HA failover, the standby instance becomes the new primary with the same IP address, but existing application connections that were established to the old primary are now broken. Connection pools that do not validate connections before reuse will attempt to use these stale connections, causing intermittent errors. Configuring the pool to test connections (e.g., via `SELECT 1` or JDBC `connectionTestQuery`) and automatically reconnect resolves this by discarding dead connections and establishing fresh ones to the new primary.

Exam trap

Google Cloud often tests the misconception that IP addresses change during HA failover, leading candidates to incorrectly choose Option A, but in Cloud SQL HA the VIP remains constant, and the real issue is stale connections in the application pool.

How to eliminate wrong answers

Option A is wrong because Cloud SQL HA failover preserves the same IP address (the VIP is moved to the standby), so updating the connection string is unnecessary and would not fix stale connection pool issues. Option C is wrong because Cloud SQL HA automatically promotes the standby to primary during failover; no manual promotion is required, and the standby accepts connections immediately after failover completes. Option D is wrong because MySQL binary logs are replicated continuously to the standby in HA configurations, so the binary log is not incomplete after failover; `mysqlcheck` is used for table corruption repair, not for connection errors, and is unrelated to the described symptom.

316
MCQhard

A company is migrating a PostgreSQL database to Cloud SQL. They need high availability with automatic failover and a read replica for reporting queries that must not impact the primary. Which Cloud SQL configuration should they choose?

A.High Availability (HA) configuration with automatic storage increase
B.High Availability (HA) configuration with a read replica
C.Single zone instance with a failover replica
D.Single zone instance with cross-region replication
AnswerB

Cloud SQL HA automatically fails over to a synchronous standby in a different zone, protecting against zonal outages. A read replica, created using binary log replication, serves read-only queries like reporting without burdening the primary. Together, these features satisfy both availability and performance needs, allowing the reporting workload to run in parallel with production.

Why this answer

Cloud SQL High Availability provides a synchronous standby in a different zone with automatic failover. Adding a read replica offloads reporting queries and does not affect the primary.

317
MCQmedium

An engineer wants to create a Google-managed SSL certificate for an HTTPS load balancer. Which command should they use?

A.gcloud compute ssl-policies create my-policy --profile MODERN
B.gcloud compute ssl-certificates create my-cert --domains example.com
C.gcloud compute ssl-certificates create my-cert --certificate cert.pem --private-key key.pem
D.gcloud compute target-https-proxies create my-proxy --ssl-certificates my-cert
AnswerB

This is the correct command because it explicitly instructs Compute Engine to provision a Google-managed certificate for the specified domains. The --domains flag triggers Google's automatic certificate management lifecycle: Google Cloud obtains the certificate and handles renewals approximately 30 days before expiration, though you must verify domain ownership first. After creation, the certificate resource still needs to be attached to a target HTTPS proxy and associated with a forwarding rule before it can serve traffic.

Why this answer

To create a Google-managed SSL certificate, use 'gcloud compute ssl-certificates create' with the '--domains' flag. The other commands are for other purposes or require manual certificate provisioning.

318
MCQmedium

A team wants to grant a contractor the Storage Object Viewer role on a specific bucket path, but only during business hours (Monday–Friday, 9am–5pm local time). Which IAM feature supports these conditions?

A.IAM deny policies scoped to non-business hours
B.IAM Conditions on the role binding
C.VPC Service Controls with a time-based access policy
D.Cloud Scheduler removing and re-adding the IAM binding on a schedule
AnswerB

IAM Conditions attach to a specific role binding and can include expressions using request.time, which supports date/time, day-of-week, and time-of-day comparisons such as Monday through Friday between 09:00 and 17:00. The condition narrows the binding's effect without altering the rest of the organization, folder, or project IAM policy. This approach is the recommended pattern because it is evaluated in real time by Cloud IAM, requires no external orchestration, and applies automatically to every API request that uses that binding.

Why this answer

IAM Conditions allow you to define time-based constraints on role bindings using the `request.time` attribute. By setting a condition that restricts access to Monday–Friday, 9am–5pm, the contractor is granted the Storage Object Viewer role only during those hours. This is the native IAM feature designed for such fine-grained, attribute-based access control.

Exam trap

Google Cloud often tests the distinction between IAM Conditions (which are attribute-based and evaluated at runtime) and external scheduling mechanisms like Cloud Scheduler, leading candidates to mistakenly choose the latter as a 'valid' solution despite its lack of native IAM integration and potential for access gaps.

How to eliminate wrong answers

Option A is wrong because IAM deny policies are used to explicitly deny access regardless of other allow policies, but they cannot be scoped to non-business hours in a way that grants access during business hours; they would deny access at all times unless combined with an allow policy, which is not the intended use. Option C is wrong because VPC Service Controls are designed to protect data within a VPC service perimeter based on network context and identity, not to enforce time-based access conditions on IAM roles. Option D is wrong because Cloud Scheduler removing and re-adding IAM bindings on a schedule is an overly complex, error-prone workaround that introduces latency and potential race conditions; it is not an IAM feature and does not provide real-time conditional access.

319
MCQmedium

An organization has a VPC with instances in two subnets: subnet-a (10.0.1.0/24) and subnet-b (10.0.2.0/24). They want to allow HTTP traffic from any instance in subnet-a to any instance in subnet-b. What firewall rule should be created?

A.An egress rule on subnet-b allowing traffic to 10.0.1.0/24 on TCP port 80
B.An ingress rule on subnet-a allowing traffic to 10.0.2.0/24 on TCP port 80
C.An ingress rule on subnet-b allowing traffic from 10.0.1.0/24 on TCP port 80
D.An egress rule on subnet-a allowing traffic to 10.0.2.0/24 on TCP port 80
AnswerC

This is correct because the HTTP request travels from an instance in subnet-a (source 10.0.1.0/24) to an instance in subnet-b (destination) on TCP port 80. An ingress rule on subnet-b with the source range set to 10.0.1.0/24 explicitly allows that inbound connection at the destination. In GCP, the destination subnet's ingress rules are the primary gate for allowing traffic to reach the target instance.

Why this answer

Firewall rules are defined with direction and source/target. To allow inbound traffic to subnet-b from subnet-a, an ingress rule with source range 10.0.1.0/24 is needed.

320
MCQeasy

A user wants to use gcloud to create a Cloud Storage bucket but receives a permission denied error. What is the most likely cause?

A.The bucket name is already taken
B.The user is not authenticated
C.The user does not have storage.buckets.create permission
D.The project does not have billing enabled
AnswerC

The gcloud storage buckets create command calls the Cloud Storage API, which verifies that the authenticated user has the storage.buckets.create permission on the project. A 'permissionDenied' error indicates a missing IAM role, such as Storage Admin (roles/storage.admin) or a custom role containing that permission. Since the request is authenticated but not authorized, this is the correct explanation.

Why this answer

C is correct because Cloud Storage uses IAM permissions to control access to bucket creation. The specific permission required is `storage.buckets.create`, which must be granted at the project level. Without this permission, the gcloud command will fail with a permission denied error, even if the user is authenticated and billing is enabled.

Exam trap

Google Cloud often tests the distinction between authentication (who you are) and authorization (what you can do), so the trap here is that candidates may confuse a permission denied error with an authentication failure or a naming conflict.

How to eliminate wrong answers

Option A is wrong because a bucket name being taken results in a '409 Conflict' error, not a permission denied error. Option B is wrong because if the user is not authenticated, gcloud would return an authentication error (e.g., 'ERROR: (gcloud) You do not have permission to access project') or prompt for login, not a generic permission denied. Option D is wrong because billing is not required to create a bucket; it is required for using the bucket (e.g., storing data) but not for the creation API call itself.

321
MCQmedium

A Cloud Identity admin needs to grant a user access to manage billing for a specific GCP project without giving them access to any other projects in the organization. Which role should be assigned at the project level?

A.Billing Account Administrator at the organization level
B.Project Billing Manager on the specific project
C.Editor on the specific project
D.Billing Account User at the billing account level
AnswerB

Project Billing Manager on the specific project is correct because the role roles/billing.projectManager includes billing.projects.update, which permits linking or unlinking a billing account to precisely that project. It is scoped at the project level, so the user gains no access to other projects or to the billing account's administrative settings, satisfying least privilege.

Why this answer

The Project Billing Manager role is the correct choice because it grants permissions to manage billing for a specific GCP project, including viewing billing reports and setting budget alerts, without providing access to other projects. This role is assigned at the project level, ensuring the user's billing management scope is limited to that single project.

Exam trap

The trap here is that candidates often confuse the Project Billing Manager role with the Billing Account User role, mistakenly thinking the latter provides project-level billing management, when in fact it only allows linking projects to a billing account and does not grant billing management permissions for a specific project.

How to eliminate wrong answers

Option A is wrong because the Billing Account Administrator role at the organization level grants full control over the billing account, including the ability to link or unlink projects, which would give the user access to billing for all projects under that billing account, not just the specific one. Option C is wrong because the Editor role on the specific project includes permissions to modify project resources (e.g., compute, storage) beyond billing management, violating the principle of least privilege. Option D is wrong because the Billing Account User role at the billing account level allows the user to link projects to the billing account but does not grant permissions to manage billing for a specific project; it is designed for users who need to associate projects with a billing account, not for project-level billing administration.

322
MCQhard

A company uses Cloud CDN to accelerate content delivery. They notice that some requests are not being cached, despite the cache-control headers being set correctly. The origin is a Compute Engine instance behind an HTTP load balancer. What is a likely cause?

A.The cache key includes the query string, causing too many variations.
B.The load balancer is using HTTP/2, which disables caching.
C.The content type is not supported by Cloud CDN.
D.The origin returns a Set-Cookie header, which prevents caching by default.
AnswerD

When an origin includes a Set-Cookie header in a response, Cloud CDN's default cache mode treats that response as private and skips caching entirely. This prevents any user-specific response from being accidentally served to other users, and follows the principle that responses with cookies often contain personalized data. Unless you explicitly configure the cache mode to FORCE_CACHE_ALL or configure Cloud CDN to ignore Set-Cookie, the presence of Set-Cookie effectively disables caching for that response.

Why this answer

Cloud CDN will not cache responses that include a Set-Cookie header by default, even if Cache-Control headers are correctly set. This is because Set-Cookie indicates user-specific or session-specific content, and caching it could lead to serving private data to other users. The origin (Compute Engine behind an HTTP load balancer) returning Set-Cookie effectively disables caching for those responses.

Exam trap

The trap here is that candidates often focus on cache-control headers or query strings, but Google Cloud tests the less obvious behavior that Set-Cookie headers implicitly prevent caching in Cloud CDN, even when other caching directives appear correct.

How to eliminate wrong answers

Option A is wrong because query string variations in the cache key can reduce cache hit ratio but do not prevent caching entirely; Cloud CDN can still cache responses with query strings if the cache key is configured appropriately. Option B is wrong because HTTP/2 does not disable caching; Cloud CDN fully supports HTTP/2 and caching behavior is independent of the HTTP version. Option C is wrong because Cloud CDN supports caching for all standard content types (e.g., text, image, video, application) and does not restrict caching based on content type.

323
MCQmedium

An engineer needs to grant a service account the ability to impersonate another service account when making API calls. Which IAM role should be assigned to the impersonating service account?

A.roles/iam.serviceAccountAdmin
B.roles/serviceusage.serviceUsageConsumer
C.roles/iam.serviceAccountUser
D.roles/iam.serviceAccountTokenCreator
AnswerC

roles/iam.serviceAccountUser is the correct role because it includes the permissions iam.serviceAccounts.actAs and iam.serviceAccounts.implicitDelegation. The actAs permission allows a principal to use the service account to access resources and create resources that are owned by or signed with the service account's identity. ImplicitDelegation also permits the principal to impersonate service accounts that are arranged in a delegated chain, making this the minimal standard role for granting a service account the ability to act on behalf of another entity.

Why this answer

The roles/iam.serviceAccountUser role allows a principal to impersonate a service account (by getting an access token for that account). roles/iam.serviceAccountTokenCreator allows creating tokens but not full impersonation. roles/serviceusage.serviceUsageConsumer is for service usage, not impersonation. roles/iam.serviceAccountAdmin allows administrative actions but not impersonation.

324
MCQeasy

A developer needs to create a Compute Engine VM with 4 vCPUs, 15 GB of memory, and a Debian 10 boot disk. Which gcloud compute instances create command is correct?

A.gcloud compute instances create my-vm --machine-type=n1-highmem-4 --image-family=debian-10 --image-project=debian-cloud
B.gcloud compute instances create my-vm --machine-type=n1-standard-4 --image-family=debian-10 --image-project=debian-cloud
C.gcloud compute instances create my-vm --machine-type=n1-standard-4 --image-family=ubuntu-1804 --image-project=ubuntu-os-cloud
D.gcloud compute instances create my-vm --machine-type=n1-standard-4
AnswerB

This is the correct command because n1-standard-4 is the general-purpose machine type that provides exactly 4 vCPUs and 15 GB of memory, satisfying the stated requirement. It also explicitly sets --image-family=debian-10 and --image-project=debian-cloud, which tells gcloud to use the latest active Debian 10 image from the official debian-cloud project. The command is complete and creates a reproducible Debian 10 VM with the desired vCPU count.

Why this answer

The correct command specifies machine-type n1-standard-4 (4 vCPU, 15 GB RAM), image-family debian-10, and image-project debian-cloud. The other options either use wrong machine type, wrong image project, or miss required flags.

325
MCQmedium

You want to monitor the uptime of an external HTTP endpoint every minute and receive an email notification if the endpoint is unavailable for more than two consecutive checks. What should you do?

A.Create a log-based alert in Cloud Logging that triggers on network errors
B.Create an uptime check in Cloud Monitoring, then create an alerting policy with condition 'metric threshold' for 'check_failed' and set notification channel to email
C.Use Cloud Functions to periodically call the endpoint and send an email on failure
D.Configure a TCP health check on the load balancer
AnswerB

Uptime checks in Cloud Monitoring are the managed, intended way to verify that an external HTTP endpoint is reachable and returning expected responses from multiple locations across the globe. The check_failed metric increments each time a probe fails, and a metric-threshold alerting policy lets you define a condition—for instance, when the number of failed checks is consistently above zero over a specified period—and route it to an email notification channel. This directly implements the requirement without custom code.

Why this answer

Uptime checks in Cloud Monitoring can be configured to check HTTP endpoints. You can set alerting conditions based on the duration of the outage and choose email as a notification channel.

326
MCQmedium

A team needs to create a new service account and grant it the roles/storage.objectViewer role on a project. Which two gcloud commands are required?

A.gcloud iam service-accounts create and gcloud iam service-accounts add-iam-policy-binding
B.gcloud projects add-iam-policy-binding only
C.gcloud iam service-accounts create and gcloud projects add-iam-policy-binding
D.gcloud iam service-accounts create and gcloud iam roles create
AnswerC

This is the correct sequence: first, `gcloud iam service-accounts create` provisions the service account and generates its unique email address, which becomes the IAM member identity. Then, `gcloud projects add-iam-policy-binding` adds that service account email as a member in the project's IAM policy and grants the specified role (e.g., roles/storage.objectAdmin) for the whole project. This binds the service account as an identity to the project-level resource, which is exactly what is needed.

Why this answer

First, create the service account with gcloud iam service-accounts create. Then grant the role on the project using gcloud projects add-iam-policy-binding with the service account as member. The commands in other options are either missing steps or incorrect.

327
MCQhard

A platform team is deploying a multi-tier application on GKE: a frontend Deployment, a backend Deployment, and a Redis StatefulSet. The backend must be reachable by name from the frontend, but not from outside the cluster. Which Kubernetes resource enables internal name-based service discovery?

A.A NodePort Service for the backend
B.A ClusterIP Service for the backend
C.A LoadBalancer Service for the backend
D.A Kubernetes Ingress resource for the backend
AnswerB

A ClusterIP Service is the correct choice because it provisions a stable virtual IP and an internal DNS record (e.g., backend.default.svc.cluster.local) that is resolvable only within the cluster. Frontend pods can communicate with the backend by its service name, and kube-proxy load-balances traffic to the backend pods automatically. Because the Service is not published on any node IP or external load balancer, it remains strictly internal, fully matching the requirement.

Why this answer

A ClusterIP Service exposes the backend Pods on a stable, internal IP address that is only reachable from within the GKE cluster. The frontend can resolve the backend by the Service's DNS name (e.g., `backend.default.svc.cluster.local`) using the cluster's internal DNS (CoreDNS), enabling name-based service discovery without exposing the backend to external traffic.

Exam trap

Google Cloud often tests the misconception that Ingress is used for internal service discovery, but Ingress is an external-facing layer-7 routing resource that requires a Service (typically ClusterIP or NodePort) to route traffic, and it does not provide internal DNS-based name resolution by itself.

How to eliminate wrong answers

Option A is wrong because a NodePort Service exposes the backend on a static port on every node's IP address, making it reachable from outside the cluster, which violates the requirement that the backend not be accessible externally. Option C is wrong because a LoadBalancer Service provisions an external cloud load balancer with a public IP, explicitly exposing the backend to the internet or external networks. Option D is wrong because a Kubernetes Ingress resource is an API object that manages external HTTP/S traffic routing to Services, typically requiring an Ingress controller and exposing the backend to external clients; it does not provide internal-only name-based discovery.

328
MCQmedium

You need to export logs from Cloud Logging to a BigQuery dataset for long-term analysis. What should you create?

A.An alerting policy with a log-based trigger
B.A log-based metric
C.An export job in BigQuery
D.A log sink with BigQuery as the destination
AnswerD

A log sink with BigQuery as the destination is the correct method: Cloud Logging's log router matches your chosen log entries and delivers them to a BigQuery dataset, where each daily collection becomes a table. You configure the destination by providing a dataset name, and the sink automatically handles batching and streaming writes. This is the officially supported, commonly used way to export logs to BigQuery for analytics.

Why this answer

Log sinks are used to route logs to destinations like BigQuery, Cloud Storage, or Pub/Sub.

329
MCQhard

You need to drain a GKE node for maintenance, ensuring that daemonsets and pods using emptyDir volumes are handled properly. Which command should you use?

A.kubectl taint nodes NODE key=value:NoSchedule
B.kubectl drain NODE --ignore-daemonsets --delete-emptydir-data
C.kubectl delete node NODE
D.kubectl cordon NODE && kubectl delete pods --all
AnswerB

`kubectl drain` gracefully evicts all pods from the node while respecting PodDisruptionBudgets, making the node unschedulable and empty for maintenance. The `--ignore-daemonsets` flag skips DaemonSet-managed pods, which are intended to run on every node and would otherwise block eviction, while `--delete-emptydir-data` allows deletion of pods using emptyDir volumes, which would otherwise prevent the drain from finishing. These flags together ensure the command completes cleanly on nodes with these pod types.

Why this answer

kubectl drain with flags ignores daemonsets and deletes emptyDir pods.

330
Multi-Selectmedium

An engineer needs to allow a set of Compute Engine instances (with tag 'web-server') to receive traffic on port 443 from the internet. The VPC has a default network with default firewall rules. Which TWO actions should the engineer take? (Choose TWO)

Select 2 answers
A.Create a firewall rule allowing ingress from 0.0.0.0/0 on port 443 with target tag 'https-server' and priority 1000.
B.Modify the default-allow-https rule to change the target tag to 'web-server'.
C.Delete the default-allow-https rule to avoid conflicts.
D.Create a firewall rule allowing ingress from 0.0.0.0/0 on port 443 with target tag 'web-server' and priority 1000.
E.Ensure that instances have the 'web-server' network tag applied.
AnswersD, E

Correct: This rule allows the desired traffic.

Why this answer

To allow ingress on port 443 to instances with tag 'web-server', the engineer must create a firewall rule allowing that traffic. The default rules are already there but may not include port 443; the default-allow-https rule exists but only for instances with tag 'https-server', not 'web-server'. So a new rule is needed.

The engineer should not modify the default rule (cannot be modified) or delete it. Creating a rule with priority 1000 is appropriate.

331
MCQmedium

A team's Cloud Build jobs are consistently failing with 'quota exceeded' errors. Billing is active and the project has available budget. What should the team do?

A.Delete unused projects in the same organization to release global quota
B.Upgrade the billing account to a higher payment tier
C.Request a quota increase for the Cloud Build API in the project settings
D.Use a larger machine type for Cloud Build worker pools
AnswerC

The correct resolution is to submit a quota increase request for Cloud Build API metrics, such as concurrent builds or daily build time, in the project's IAM & Admin > Quotas page (or the Cloud Quotas product). Choose the specific metric that triggered the error, specify a new limit, and provide a justification; the request is then reviewed by Google Cloud. Once approved, the new limit applies to that project, resolving the quota exhaustion error.

Why this answer

Cloud Build quota errors indicate that the project has reached its API rate limit or concurrent build limit, not a billing issue. Quotas are per-project and can be increased by requesting a higher limit from the Cloud Build API quotas page in the Google Cloud Console. Billing being active and having budget means the issue is not financial, so the team must specifically request a quota increase for the Cloud Build API.

Exam trap

The trap here is that candidates confuse billing-related errors (e.g., 'insufficient funds') with quota errors (e.g., 'quota exceeded'), leading them to incorrectly choose billing upgrades or project deletions instead of recognizing that API quotas are a separate, project-level limit that must be explicitly increased.

How to eliminate wrong answers

Option A is wrong because deleting unused projects does not release global quota; quotas are per-project and independent, so removing other projects has no effect on the Cloud Build quota in the affected project. Option B is wrong because upgrading the billing account to a higher payment tier does not affect API quotas; billing tiers relate to payment methods and invoicing, not resource limits. Option D is wrong because using a larger machine type for Cloud Build worker pools changes the compute resources for builds but does not increase the API quota for the number of concurrent builds or API requests; quota errors are about rate limits, not machine size.

332
MCQmedium

A network team is creating a new VPC and must decide between auto mode and custom mode. Why would they choose custom mode?

A.Auto mode VPCs cost more per subnet than custom mode
B.Custom mode allows full control over which regions have subnets and what CIDR ranges are used
C.Auto mode VPCs cannot be used with GKE clusters
D.Custom mode VPCs support more IP addresses per subnet than auto mode
AnswerB

In custom mode, you explicitly define every subnet, choosing the exact region and CIDR block, which lets you align your VPC address space with on-premises networks and avoid overlapping IP ranges that would break VPN or Interconnect peering. Unlike auto mode, which automatically creates subnets in all regions using a reserved 10.128.0.0/9 range (each with a /20), custom mode gives you the flexibility to create subnets only where needed and with appropriate sizes, preventing subnet sprawl and preserving address space for future growth. This control is essential for hybrid cloud designs that require careful CIDR planning to ensure route propagation doesn't conflict.

Why this answer

Custom mode VPCs give the network team full control over the IP address range (CIDR block) and the ability to create subnets in any region, unlike auto mode VPCs which automatically create subnets in every region with a fixed /20 range per region. This is essential when you need to avoid overlapping CIDRs with on-premises networks or other VPCs, or when you want to restrict subnets to specific regions for compliance or cost reasons.

Exam trap

Google Cloud often tests the misconception that auto mode VPCs are more expensive or have IP limitations, when in fact the key differentiator is control over subnet placement and CIDR range, not cost or capacity.

How to eliminate wrong answers

Option A is wrong because auto mode and custom mode VPCs have the same pricing model—there is no cost difference per subnet; both are free to create and use, with charges only for resources like NAT gateways or VPNs. Option C is wrong because auto mode VPCs can be used with GKE clusters; GKE supports both auto and custom mode VPCs, though custom mode is often preferred for more precise subnet control. Option D is wrong because both auto and custom mode VPCs support the same maximum IP address per subnet (the default limit is 256 IPs per subnet, which can be increased via quota request, but the mode does not affect this limit).

333
MCQeasy

A team needs to run a simple containerized script that processes a batch of files once per night and exits when done — no HTTP endpoint needed. Which GCP service is most appropriate?

A.Cloud Run Services with a timeout set to 24 hours
B.Cloud Run Jobs triggered by Cloud Scheduler
C.Cloud Functions with a 540-second maximum timeout
D.App Engine Standard with a background service
AnswerB

Cloud Run Jobs execute a container to completion in response to an explicit execution request, making them ideal for a nightly batch script. You can configure the job with a command, environment variables, a timeout (up to 24 hours or more), and the number of parallel tasks, and the job exits with a success/failure exit code. Cloud Scheduler can trigger the job via Pub/Sub or a direct API call using IAM authentication, providing a serverless cron that runs each night without maintaining an HTTP server.

Why this answer

Cloud Run Jobs is the correct choice because it is designed for batch workloads that run to completion, with no requirement for an HTTP endpoint. It can handle long-running tasks (up to 24 hours) and can be triggered by Cloud Scheduler for nightly execution, making it ideal for processing files once per night.

Exam trap

Google Cloud often tests the distinction between Cloud Run Services (HTTP-driven, always-on) and Cloud Run Jobs (batch, run-to-completion), leading candidates to incorrectly choose Cloud Run Services for batch workloads due to familiarity with the 'Cloud Run' name.

How to eliminate wrong answers

Option A is wrong because Cloud Run Services are intended for HTTP-driven applications that must handle continuous requests; setting a 24-hour timeout is technically possible but misuses the service, as it is not designed for batch jobs that exit. Option C is wrong because Cloud Functions has a maximum timeout of 540 seconds (9 minutes), which is insufficient for a batch job that may run for hours processing files nightly. Option D is wrong because App Engine Standard with a background service is not designed for short-lived batch tasks; it is meant for long-running background processes within a web application, and it lacks native scheduling integration for one-off nightly jobs.

334
MCQmedium

An engineering team is deciding between App Engine Standard and App Engine Flexible for a Python API. The API has unpredictable traffic, must scale to zero when idle, runs standard Python code with no custom system packages, and requires < 1 second startup time. Which environment is most suitable?

A.App Engine Flexible — it supports Python with custom packages
B.App Engine Standard — it scales to zero, starts in sub-second, and supports standard Python runtimes
C.Both are equivalent — the difference is only in supported languages
D.Neither — use Cloud Run instead for Python APIs
AnswerB

App Engine Standard is the correct choice because it runs on a fully managed, sandboxed PaaS that automatically scales to zero instances when idle, eliminating compute cost between requests. Its stateless runtime instances start in under a second even from cold, which is critical for latency-sensitive or sporadically used APIs. The API's requirement of standard Python runtimes fits Standard's supported runtimes exactly, and the absence of any need for custom system packages sidesteps Standard's primary limitation.

Why this answer

App Engine Standard is the correct choice because it automatically scales to zero instances during idle periods, starts new instances in under a second, and supports standard Python runtimes without custom system packages. The requirement for sub-second startup time and scaling to zero aligns perfectly with Standard's sandboxed, pre-loaded runtime environment, whereas Flexible environment has slower startup times due to VM provisioning and cannot scale to zero.

Exam trap

Google Cloud often tests the misconception that App Engine Flexible is more capable because it supports custom runtimes, leading candidates to overlook the critical requirements of scaling to zero and sub-second startup that only Standard satisfies.

How to eliminate wrong answers

Option A is wrong because App Engine Flexible does not scale to zero instances (it maintains at least one VM) and has startup times of several minutes, failing the <1 second requirement; custom packages are irrelevant since the API uses standard Python code. Option C is wrong because the environments differ significantly in scaling behavior, startup latency, and sandboxing — they are not equivalent. Option D is wrong because Cloud Run can scale to zero and start quickly, but App Engine Standard is equally suitable and is a first-class option for this use case; the question asks which environment is most suitable, and Standard directly meets all criteria without requiring a different service.

335
MCQmedium

An engineer needs to enable the Compute Engine API for a project using the CLI. Which command should they run?

A.gcloud compute enable
B.gcloud services enable compute
C.gcloud api enable compute.googleapis.com
D.gcloud services enable compute.googleapis.com
AnswerD

'gcloud services enable compute.googleapis.com' is the correct command to enable the Compute Engine API for the active project. The 'gcloud services' command group interacts with the Service Usage API to manage service availability. This command uses the fully qualified service name 'compute.googleapis.com', which is required for successful enablement. You can also specify a project with the '--project' flag if the API should be enabled for a different project than the current one.

Why this answer

The 'gcloud services enable' command enables APIs in a project. The service name for Compute Engine is compute.googleapis.com.

336
MCQmedium

You notice that your Cloud SQL for PostgreSQL instance's `pg_stat_activity` shows many connections in `idle in transaction` state, and the connection count is near the max_connections limit. Application threads are blocking waiting for connections. What is the most effective solution to manage database connections for a GKE-hosted application?

A.Increase `max_connections` in the Cloud SQL PostgreSQL instance flags.
B.Deploy PgBouncer as a sidecar or deployment to pool connections to Cloud SQL in transaction mode.
C.Switch from Cloud SQL to Cloud Spanner, which has no connection limits.
D.Restart the Cloud SQL instance to clear idle connections.
AnswerB

PgBouncer in transaction pooling mode multiplexes many application connections onto fewer database connections, eliminating idle-in-transaction waste and staying well below max_connections.

Why this answer

PgBouncer is a lightweight connection pooler that can be deployed as a sidecar or separate deployment in GKE to manage connections to Cloud SQL for PostgreSQL. By operating in transaction mode, it holds database connections only for the duration of a transaction, not for the entire client session, which drastically reduces the number of concurrent connections to the database. This directly addresses the `idle in transaction` connections and the near-max_connections issue without requiring application code changes.

Exam trap

Google Cloud often tests the misconception that simply increasing `max_connections` is a safe scaling solution, when in fact it can lead to resource exhaustion and does not address the underlying idle connection problem.

How to eliminate wrong answers

Option A is wrong because increasing `max_connections` only raises the hard limit without solving the root cause of idle connections; it can also degrade database performance due to increased context switching and memory overhead. Option C is wrong because Cloud Spanner is a globally distributed, horizontally scalable database with a different API and consistency model, not a drop-in replacement for PostgreSQL, and it still has connection limits (though higher). Option D is wrong because restarting the instance is a disruptive, temporary fix that kills all connections but does not prevent idle connections from reaccumulating, and it causes downtime for the application.

337
MCQhard

A company runs a batch job on Compute Engine that processes large files from Cloud Storage. The job is taking longer than expected. The instances are using standard persistent disks. Which change would most likely improve I/O performance?

A.Use regional persistent disks instead of zonal.
B.Increase the machine type to have more vCPUs.
C.Add local SSDs to the instances.
D.Replace standard persistent disks with SSD persistent disks.
AnswerD

SSD persistent disks are built on flash-based media and deliver substantially higher IOPS, throughput, and lower latency than standard persistent disks, directly addressing an I/O-bound workload. Unlike local SSDs, they remain durable across instance lifecycle events and maintain the same persistent disk management model. Replacing standard persistent disks with SSD persistent disks is the appropriate change to remove the storage bottleneck while retaining data durability.

Why this answer

Standard persistent disks (pd-standard) are backed by HDDs and have lower IOPS and throughput compared to SSD persistent disks (pd-ssd). Since the batch job processes large files from Cloud Storage, the bottleneck is likely disk I/O performance. Upgrading to SSD persistent disks provides higher IOPS and throughput, directly improving I/O performance for read/write operations.

Exam trap

Google Cloud often tests the distinction between persistent disk types (standard vs. SSD) versus disk replication options (zonal vs. regional), leading candidates to mistakenly choose regional disks for performance instead of durability.

How to eliminate wrong answers

Option A is wrong because regional persistent disks provide synchronous replication across two zones for durability, not higher I/O performance; they have the same performance characteristics as zonal persistent disks. Option B is wrong because increasing vCPUs does not improve disk I/O performance; the bottleneck is the disk subsystem, not CPU capacity. Option C is wrong because local SSDs provide high IOPS but are ephemeral and cannot be used for persistent data; the job processes files from Cloud Storage, which requires persistent storage for the batch job's working data.

338
MCQmedium

You have a Kubernetes Deployment running 5 replicas. You need to update the container image with zero downtime, ensuring that at least 4 replicas are always available during the update, and no more than 6 replicas exist at any time. Which Deployment strategy and settings achieve this?

A.Recreate strategy with `minReadySeconds: 30`.
B.RollingUpdate with `maxUnavailable: 1` and `maxSurge: 1`.
C.RollingUpdate with `maxUnavailable: 0` and `maxSurge: 2`.
D.RollingUpdate with `maxUnavailable: 2` and `maxSurge: 1`.
AnswerB

With maxUnavailable=1 the Deployment is allowed to take down at most one pod at a time, so at least 5 - 1 = 4 pods remain available throughout the update. With maxSurge=1 the Deployment may create at most one extra pod above the desired count, capping total simultaneous pods at 5 + 1 = 6. These two parameters exactly satisfy both the minimum-4 available and maximum-6 total constraints while keeping the rollout incremental and service available.

Why this answer

A RollingUpdate strategy with `maxUnavailable: 1` and `maxSurge: 1` ensures that during the update, at most one replica is taken down (so at least 4 remain available) and at most one extra replica is created above the desired 5 (so no more than 6 exist at any time). This satisfies both constraints while achieving zero downtime.

Exam trap

Google Cloud often tests the interaction between `maxSurge` and `maxUnavailable` by presenting values that seem reasonable but violate the given constraints, and the trap here is assuming that a higher surge or higher unavailable count is safe without calculating the resulting minimum available and maximum total replicas.

How to eliminate wrong answers

Option A is wrong because the Recreate strategy terminates all existing pods before creating new ones, causing downtime and violating the requirement of at least 4 replicas always available. Option C is wrong because `maxSurge: 2` allows up to 7 replicas (5 desired + 2 surge), exceeding the limit of 6 replicas at any time. Option D is wrong because `maxUnavailable: 2` allows up to 2 replicas to be unavailable, which could drop the available count to 3, violating the requirement of at least 4 replicas always available.

339
MCQeasy

Which kubectl command is used to view the logs of a specific pod named 'my-pod'?

A.kubectl logs my-pod
B.kubectl exec my-pod -- logs
C.kubectl get pod my-pod
D.kubectl describe pod my-pod
AnswerA

The `kubectl logs my-pod` command retrieves the logs of the primary container running inside the specified pod by reading the container's stdout/stderr streams. This is the direct, native Kubernetes approach for accessing application log output, and if the pod has multiple containers, you must append `-c <container>` to select a specific one. It does not require shell access or any extra tooling, making it the correct command for viewing logs.

Why this answer

The 'kubectl logs' command streams logs from a pod. 'kubectl describe' shows metadata, 'kubectl get' shows status, and 'kubectl exec' runs commands inside the pod.

340
MCQmedium

You need to monitor a Cloud Run service for errors and receive a PagerDuty notification when the number of 5xx errors exceeds 10 in any 5-minute window. Which Cloud Monitoring feature should you use?

A.Create a log-based metric on Cloud Run error logs, then create an alerting policy on that metric with a PagerDuty notification channel.
B.Configure Cloud Run to send error emails directly to the PagerDuty email integration.
C.Use Cloud Pub/Sub to stream Cloud Run logs to a custom application that pages PagerDuty.
D.Enable Cloud Run's built-in alerting feature in the service configuration.
AnswerA

This is the correct pattern: first, create a log-based metric in Cloud Logging that counts Cloud Run errors, for example by filtering on status codes >= 500 or severity ERROR. Then, define a Cloud Monitoring alerting policy that watches that metric and triggers when the error count crosses a threshold. Finally, attach a PagerDuty notification channel to the policy so an incident is created automatically. This approach uses fully managed services and requires no custom application code.

Why this answer

A log-based metric extracts a numeric counter from Cloud Run error logs (e.g., HTTP 5xx status codes). An alerting policy can then evaluate that metric over a sliding 5-minute window, triggering a PagerDuty notification via a configured notification channel when the count exceeds 10. This is the native, serverless approach that requires no additional infrastructure.

Exam trap

Google Cloud often tests the misconception that Cloud Run has built-in alerting or that direct email integration is sufficient, when in fact Cloud Monitoring's log-based metrics and alerting policies are the required mechanism for threshold-based paging.

How to eliminate wrong answers

Option B is wrong because Cloud Run does not have a built-in feature to send error emails directly to a PagerDuty email integration; it would require custom log routing and filtering. Option C is wrong because using Cloud Pub/Sub and a custom application adds unnecessary complexity and latency compared to the native Cloud Monitoring alerting pipeline. Option D is wrong because Cloud Run does not have a built-in alerting feature in its service configuration; alerting must be configured externally via Cloud Monitoring.

341
MCQhard

An organization has a policy requiring all new GCP projects to be created within specific folders and linked to approved billing accounts only. Which combination of features enforces this at scale?

A.IAM deny policies on the organization + VPC Service Controls
B.Organization policies to restrict allowed billing accounts + granting Project Creator role only at approved folder level
C.Cloud Asset Inventory alerts + manual review of new projects
D.Requiring multi-factor authentication for all project creators
AnswerB

This is the correct preventive approach because the `billing.allowedBillingAccounts` organization policy (constraint: `constraints/billing.allowedBillingAccounts`) restricts the set of billing accounts that can be associated with a project, and it is evaluated at project creation time, not after the fact. Scoping the Project Creator role to only approved folders via IAM roles on those folders means a user can create a project only within those resource boundaries, because the permission to create a project is inherited down the hierarchy only from those folders. Together these controls ensure that any new project is created in an approved folder and must use an allowed billing account, preventing non-compliant project sprawl before it happens.

Why this answer

It combines two enforcement mechanisms: Organization policies (specifically the `constraints/compute.restrictBillingAccounts` constraint) to limit which billing accounts can be attached to projects, and granting the Project Creator role (`roles/resourcemanager.projectCreator`) only at the folder level (not the organization level). This ensures that new projects can only be created within the approved folders and must use an approved billing account, enforcing the policy at scale across the entire organization.

Exam trap

Google Cloud often tests the distinction between reactive monitoring (like Cloud Asset Inventory) and proactive enforcement (like Organization policies and IAM roles), leading candidates to choose a monitoring-based answer instead of the correct policy-based enforcement.

How to eliminate wrong answers

Option A is wrong because IAM deny policies are used to explicitly deny access to resources, not to restrict billing accounts or project creation locations; VPC Service Controls are designed to protect data in GCP services by controlling data exfiltration, not for enforcing project creation or billing constraints. Option C is wrong because Cloud Asset Inventory alerts and manual review are reactive, not proactive enforcement; they cannot prevent non-compliant projects from being created at scale. Option D is wrong because multi-factor authentication (MFA) is an identity security measure that does not restrict which billing accounts or folders can be used when creating projects.

342
MCQeasy

A team wants logs from their Python application running on a Compute Engine VM to appear in Cloud Logging. What must be installed on the VM?

A.Cloud Trace SDK for the Python application
B.Ops Agent (Google Cloud's combined logging and monitoring agent)
C.Cloud Monitoring agent only
D.No installation needed — GCE VMs automatically stream logs to Cloud Logging
AnswerB

The Ops Agent is the correct solution because it is Google Cloud's unified agent for both logging and monitoring on Compute Engine. It can be configured to collect logs from system daemons, application log files, and custom pipelines, then forward them as structured log entries to Cloud Logging, while also ingesting metrics for Cloud Monitoring. It must be explicitly installed on the VM, but it is the supported, modern replacement for the separate legacy logging and monitoring agents.

Why this answer

The Ops Agent is Google Cloud's unified agent for both logging and monitoring, and it is required to stream custom application logs from a Compute Engine VM to Cloud Logging. While the VM itself sends basic platform logs (e.g., serial console output), application-level logs (e.g., from a Python app) require the Ops Agent to collect, parse, and forward them to the Cloud Logging API.

Exam trap

The trap here is that candidates assume GCE VMs automatically send all logs (including application logs) to Cloud Logging, but in reality only platform-level logs are auto-streamed, and application logs require the Ops Agent.

How to eliminate wrong answers

Option A is wrong because the Cloud Trace SDK is used for distributed tracing, not for collecting or forwarding application logs to Cloud Logging. Option C is wrong because the Cloud Monitoring agent only handles metrics for Cloud Monitoring, not logs for Cloud Logging; the Ops Agent replaces both the legacy logging and monitoring agents. Option D is wrong because GCE VMs do not automatically stream application logs; they only send basic platform logs (e.g., from the guest environment), and custom application logs require an agent like the Ops Agent to be installed and configured.

343
MCQhard

Your organization uses Cloud Functions to process messages from a Pub/Sub topic. Each function processes a single message and writes results to BigQuery. Recently, the function has been timing out and the Pub/Sub subscription's unacknowledged message count is growing rapidly. The function's memory is set to 256 MB and timeout is 60 seconds. The function logs show occasional 'memory limit exceeded' errors. You suspect that the function is leaking memory when processing large messages. What should you do to resolve the issue while minimizing cost and complexity?

A.Increase the function's memory to 1 GB and timeout to 540 seconds.
B.Set up a retry policy on the Pub/Sub subscription to dead-letter undelivered messages.
C.Increase the function's timeout to 120 seconds and reduce the batch size.
D.Increase the function's memory to 512 MB and timeout to 120 seconds.
AnswerD

Allocating 512 MB gives the function enough headroom to handle the message payload without exhausting the default 256 MB limit, and extending the timeout to 120 seconds ensures slower processing steps aren't cut off. This directly addresses both the memory-termination error and the short timeout, while keeping costs significantly lower than the 1 GB option. It is a right-sized adjustment based on the observed failure pattern.

Why this answer

The function is timing out and running out of memory due to large messages. Increasing memory to 512 MB provides more headroom for processing, and raising the timeout to 120 seconds gives the function enough time to complete without unnecessary cost. This directly addresses the memory leak and timeout issues while keeping complexity low.

Exam trap

Google Cloud often tests the misconception that increasing timeout alone (Option C) or adding a dead-letter queue (Option B) solves memory-related failures, when in fact memory must be increased to prevent 'memory limit exceeded' errors.

How to eliminate wrong answers

Option A is wrong because increasing memory to 1 GB and timeout to 540 seconds is over-provisioned and unnecessarily increases cost without addressing the root cause of memory leaks; it also exceeds typical Cloud Functions limits for event-driven processing. Option B is wrong because a dead-letter queue only handles undelivered messages after retries, but does not fix the underlying memory leak or timeout; messages will still fail and accumulate. Option C is wrong because reducing batch size is irrelevant since each function processes a single message, and increasing timeout alone without addressing memory will still cause 'memory limit exceeded' errors.

344
MCQmedium

An engineer needs to grant a service account the ability to start and stop Compute Engine instances in a specific project. The service account should not have permissions to delete instances or modify other resources. Which IAM role should be assigned?

A.roles/compute.viewer
B.roles/compute.admin
C.roles/compute.osAdminLogin
D.roles/compute.instanceAdmin.v1
AnswerD

roles/compute.instanceAdmin.v1 is a predefined IAM role specifically designed for managing Compute Engine instances without granting broader administrative power. It includes permissions to start, stop, and reset instances, as well as modify metadata and change instance settings, but it does not allow deleting instances or creating new ones. This role exactly matches the requirement of enabling a service account to start and stop instances while maintaining least privilege.

Why this answer

The Compute Instance Admin (roles/compute.instanceAdmin.v1) role provides permissions to create, start, stop, and reset instances, but does not include delete permissions. The Compute Admin role is too broad, and Compute Viewer is read-only. Compute OS Admin Login is for OS login, not instance lifecycle.

345
MCQmedium

You need to resize a Compute Engine instance from n1-standard-4 to n1-highmem-8. The instance has a local SSD attached. What must you do before changing the machine type?

A.Stop the instance, change the machine type, then start the instance
B.Take a snapshot of the local SSD
C.Change the machine type without stopping
D.Detach the local SSD
AnswerA

To change the machine type of a Compute Engine instance, you must first stop it, which brings it to the TERMINATED state. While stopped, the persistent disks and instance settings remain intact, but any data on local SSDs is permanently lost because local SSDs are ephemeral storage tied to the host server. After updating the machine type, you start the instance; this process is the only supported way to resize an instance's vCPU and memory.

Why this answer

To change the machine type, the instance must be stopped. Local SSDs preserve data only if the instance is not stopped or terminated; however, when you stop the instance, local SSD data is lost. The correct procedure is to stop the instance, change the machine type, and then start it.

Data on local SSDs will be lost.

346
MCQeasy

Which feature of Cloud SQL provides automated backups and enables point-in-time recovery?

A.All Cloud SQL tiers
B.Only Cloud SQL Enterprise
C.Only Cloud SQL High Availability configuration
D.Only Cloud SQL Enterprise Plus
AnswerA

Automated backups and point-in-time recovery (PITR) via binary logging are foundational features of Cloud SQL, available on every edition: Enterprise, Enterprise Plus, and even the legacy basic tier. The backup infrastructure ingests daily snapshots and transaction logs regardless of the instance's tier, so no premium edition or add-on is required. Because these capabilities are guaranteed baseline functionality, the correct answer is that they apply to all Cloud SQL tiers.

Why this answer

Cloud SQL provides automated backups and point-in-time recovery (PITR) for all tiers, including Cloud SQL Enterprise, Enterprise Plus, and even the basic (non-HA) configurations. This is because the backup and PITR functionality is a core feature of the Cloud SQL service itself, not tied to a specific tier or high-availability setup. Automated backups are enabled by default, and PITR uses binary log (binlog) files to allow restoration to any point within the backup retention window.

Exam trap

Google Cloud often tests the misconception that advanced features like PITR or automated backups are reserved for higher-tier or HA configurations, when in fact they are available across all Cloud SQL tiers.

How to eliminate wrong answers

Option B is wrong because it incorrectly restricts automated backups and PITR to only the Enterprise tier, while these features are available across all Cloud SQL tiers, including the basic tier. Option C is wrong because it ties the feature to High Availability configuration, but HA only affects instance availability and failover, not backup or PITR capabilities. Option D is wrong because it limits the feature to Enterprise Plus, which is a higher-performance tier, but automated backups and PITR are not exclusive to that tier.

347
Multi-Selectmedium

A company wants to set up a Cloud SQL for MySQL instance with automated backups and a read replica for disaster recovery. Which THREE features or configurations should be enabled?

Select 3 answers
A.Enable automated backups
B.Enable binary logging
C.Enable deletion protection on the primary instance
D.Configure the read replica in a different region
E.Assign a public IP address to the read replica
AnswersA, B, D

Automated backups in Cloud SQL are mandatory for point-in-time recovery (PITR) and for creating read replicas. Without them, you cannot perform a restore to a specific timestamp, and you lose the baseline backup needed for replica creation. They also provide a daily recovery point that protects against data loss or corruption.

Why this answer

Automated backups are enabled by default but must be configured. A read replica requires the binary log to be enabled on the primary. The backup location can be set to multi-regional for DR.

Cross-region replication requires a replica in another region. Point-in-time recovery uses binary logs.

348
MCQhard

A team is using Terraform to manage GCP infrastructure. They want to store the state file in a Cloud Storage bucket with versioning enabled. Which backend configuration is correct?

A.provider "google" { backend "gcs" { bucket = "my-bucket" } }
B.terraform { backend "gcs" { bucket = "my-bucket" prefix = "terraform/state" } }
C.terraform { backend "gcs" { bucket = "my-bucket" versioning = true } }
D.terraform { backend "cloud-storage" { bucket = "my-bucket" } }
AnswerB

This is the correct configuration because it uses the required `terraform` block with a `backend "gcs"` block, and includes both the `bucket` name (where the state file is stored) and a `prefix` (the object path within the bucket). The backend type is exactly `"gcs"`, and this syntax registers Google Cloud Storage as the remote state backend, enabling shared state and locking across the team.

Why this answer

To use Cloud Storage as a backend, you must specify 'bucket' and optionally 'prefix' for the state file path. The provider block is for the Google provider, not state storage.

349
MCQmedium

An engineer needs to create a firewall rule that allows incoming HTTPS traffic only from a specific IP range to instances tagged 'web-server'. Which command should they use?

A.gcloud compute firewall-rules create allow-https --allow tcp:443 --source-ranges 192.168.0.0/16 --target-tags web-server
B.gcloud compute firewall-rules create allow-https --allow tcp:443 --source-tags web-server
C.gcloud compute firewall-rules create allow-https --allow udp:443 --source-ranges 192.168.0.0/16 --target-tags web-server
D.gcloud compute firewall-rules create allow-https --allow tcp:443 --source-ranges 0.0.0.0/0 --target-tags web-server
AnswerA

This rule is correct because it explicitly restricts inbound HTTPS (TCP port 443) to source IPs within the RFC 1918 private range 192.168.0.0/16 and applies only to VM instances bearing the network tag 'web-server'. The combination of --source-ranges with a CIDR and --target-tags ensures the rule targets exactly the intended web servers and only allows traffic from the specified internal subnet, satisfying the requirement.

Why this answer

The correct command creates a firewall rule allowing TCP port 443 from the specified source range to instances with the target tag 'web-server'.

350
MCQeasy

You need to monitor the CPU utilization across all instances in a managed instance group. What is the most efficient way to create an alerting policy?

A.Create an alerting policy using the Logs Explorer to parse instance logs.
B.Use Cloud Scheduler to call the monitoring API periodically.
C.Set up a cron job to run gcloud compute instances list and check CPU.
D.Create an alerting policy in Cloud Monitoring for the metric 'compute.googleapis.com/instance/cpu/utilization'.
AnswerD

Cloud Monitoring automatically collects `compute.googleapis.com/instance/cpu/utilization` from every Compute Engine VM without requiring an agent, storing it as a time-series metric. You can create an alerting policy with a threshold condition, setting an aggregation (e.g., mean value across instances) and a duration (e.g., 5 minutes) to reduce noise, and attach notification channels like email or Pub/Sub. This is the native, managed, and real-time mechanism for CPU monitoring, and it integrates directly with the rest of Cloud Monitoring, including dashboards and incident escalation.

Why this answer

Cloud Monitoring provides a pre-built metric, 'compute.googleapis.com/instance/cpu/utilization', which directly measures CPU usage for VM instances. Creating an alerting policy based on this metric is the most efficient approach, as it requires no custom scripting or external scheduling, and integrates natively with managed instance groups to aggregate data across all instances.

Exam trap

Google Cloud often tests the distinction between logs and metrics, and the trap here is that candidates may confuse log-based analysis (Option A) with metric-based alerting, or assume that custom scripting (Options B and C) is necessary when a native monitoring service already provides the required functionality.

How to eliminate wrong answers

Option A is wrong because the Logs Explorer parses log entries, not real-time metrics; CPU utilization is a metric, not a log event, and parsing logs for CPU data would be inefficient and miss real-time thresholds. Option B is wrong because Cloud Scheduler calling the Monitoring API periodically introduces latency and complexity, and is not the recommended method for continuous metric-based alerting; alerting policies are designed to evaluate metrics automatically. Option C is wrong because a cron job running 'gcloud compute instances list' only retrieves instance metadata, not CPU utilization metrics, and would require additional commands and scripting to fetch and analyze monitoring data, making it inefficient and non-native.

351
MCQeasy

An engineer wants to create a Google-managed SSL certificate for a domain and attach it to an HTTPS load balancer. Which gcloud command should they use to create the certificate?

A.gcloud compute target-https-proxies create --ssl-certificates
B.gcloud compute ssl-certificates create --domains example.com
C.gcloud compute ssl-policies create
D.gcloud compute ssl-certificates create --certificate example.crt --private-key example.key
AnswerB

The `gcloud compute ssl-certificates create` command with the `--domains` flag provisions a Google-managed SSL certificate, which satisfies the stem’s requirement for a Google-managed certificate rather than a self-managed one. This command triggers Google’s Certificate Authority to automatically handle domain validation and renewal for `example.com`, eliminating the need for manual certificate uploads. It directly attaches to the HTTPS load balancer’s target proxy, meeting the load-balancer constraint.

Why this answer

The gcloud compute ssl-certificates create command with the --domains flag creates a Google-managed SSL certificate. The other commands are for creating SSL policies, self-managed certificates, or target HTTPS proxies.

352
MCQmedium

A team wants to roll back a GKE Deployment to its previous revision because the new version introduced a regression. Which kubectl command performs this rollback?

A.kubectl revert deployment/my-app --to-previous
B.kubectl rollout undo deployment/my-app
C.kubectl apply -f previous-deployment.yaml
D.kubectl delete deployment/my-app && kubectl create -f deployment.yaml
AnswerB

`kubectl rollout undo deployment/my-app` is the built-in rollback mechanism. It instructs the Deployment controller to revert the pod template to the spec from the previous ReplicaSet revision, scaling up the old ReplicaSet and scaling down the new one. This preserves the Deployment's revision history, so you can undo again or jump to a specific revision with `--to-revision`. It is the correct, declarative way to return to a stable version without recreating the Deployment object or disrupting its managed state.

Why this answer

`kubectl rollout undo deployment/my-app` is the standard Kubernetes command to roll back a Deployment to the previous revision. This command leverages the Deployment's revision history, which is automatically maintained by the Kubernetes controller, to revert the desired state to the prior revision without needing to manually reapply an old manifest.

Exam trap

Google Cloud often tests the distinction between `rollout undo` and non-existent commands like `revert`, or the misconception that reapplying an old YAML file is equivalent to a proper rollback, when in fact it bypasses the Deployment's revision history and can cause version mismatches.

How to eliminate wrong answers

Option A is wrong because `kubectl revert` is not a valid kubectl command; the correct verb is `rollout undo`, not `revert`. Option C is wrong because `kubectl apply -f previous-deployment.yaml` would reapply an old manifest file, but it does not perform a rollback to the previous revision tracked by the Deployment's history; it simply applies whatever YAML is provided, which may not match the exact previous revision and could introduce configuration drift. Option D is wrong because deleting and recreating the Deployment from a YAML file is a manual, error-prone process that bypasses the built-in revision history and does not guarantee a clean rollback to the exact previous revision; it also causes unnecessary downtime and does not leverage the Deployment's automatic revision tracking.

353
MCQhard

An application is experiencing intermittent high latency. Using Cloud Trace, an engineer identifies that the bottleneck is a Pub/Sub subscription with a large backlog. Which action would MOST directly help reduce the backlog?

A.Increase the ack deadline
B.Increase the maximum message size
C.Increase the message retention duration
D.Increase the number of subscribers
AnswerD

Increasing the number of subscribers (i.e., scaling out the subscriber fleet) directly raises the aggregate processing throughput of the subscription. Because the intermittent high latency is likely due to a backlog of messages accumulating faster than the current subscribers can drain, adding more subscribers allows messages to be pulled and processed in parallel, reducing the queue depth and lowering end-to-end latency. This is the correct scaling action for a latency problem caused by insufficient compute, assuming the subscribers are stateless and can process messages independently.

Why this answer

Increasing the number of subscribers (e.g., scaling out the subscriber application) will increase the processing rate and reduce backlog. Increasing the retention duration keeps messages longer, not reducing backlog. The ack deadline and message size are not the primary causes of backlog.

354
MCQeasy

Your organization has multiple Google Cloud projects. You want to separate development and production environments. Which resource hierarchy structure is recommended?

A.Create two separate organizations.
B.Use labels on projects to differentiate environments.
C.Use a single project with separate VPC networks.
D.Use folders under the organization node to separate dev and prod projects.
AnswerD

Folders provide logical grouping and policy inheritance.

Why this answer

Using folders under an organization node allows grouping projects by environment. Folders support IAM policies and org policies, enabling environment separation. Projects alone cannot nest; folders provide the logical grouping.

355
MCQhard

A security team wants to ensure that a service account created for an application cannot create new service accounts or modify IAM policies within the project. Which IAM role restriction achieves this?

A.Grant the service account only the specific roles its application requires — omitting IAM admin roles
B.Create an IAM deny policy blocking iam.serviceAccounts.create and iam.projects.setIamPolicy for the service account
C.Set an organization policy constraint restricting service account creation to admin users only
D.Disable the IAM API for the project so service accounts cannot manage IAM
AnswerA

IAM permissions are additive — not granting `iam.serviceAccountAdmin` and `resourcemanager.projectIamAdmin` naturally prevents the service account from performing those actions. Least privilege is the approach.

Why this answer

The principle of least privilege dictates that a service account should only be granted the specific roles required for its application's functionality. By deliberately omitting roles that include IAM administrative permissions (such as roles/iam.serviceAccountAdmin or roles/iam.serviceAccountUser with the iam.serviceAccounts.create permission, or roles/resourcemanager.projectIamAdmin), the service account is inherently restricted from creating new service accounts or modifying IAM policies. This approach avoids the complexity of deny policies and aligns with Google Cloud's recommended IAM best practices.

Exam trap

Google Cloud often tests the principle of least privilege by presenting complex alternatives like deny policies or organization constraints, but the simplest and most correct answer is to grant only the necessary roles, which inherently prevents unauthorized IAM administration.

How to eliminate wrong answers

Option B is wrong because IAM deny policies are a valid mechanism but they are not the most straightforward or recommended restriction for this scenario; they require careful management and can be circumvented if not applied at the correct hierarchy level, and the question asks for a restriction that 'achieves' the goal, implying a simpler, built-in approach. Option C is wrong because organization policy constraints (e.g., constraints/iam.disableServiceAccountCreation) apply to all principals in the organization, not specifically to a single service account, and they do not prevent the service account from modifying IAM policies. Option D is wrong because disabling the IAM API for the project would break all IAM operations, including those required by the application itself, making the service account and the application non-functional.

356
MCQmedium

Your team needs to manage Google Kubernetes Engine clusters across multiple projects. Rather than granting `roles/container.admin` on each project individually, you want a centralized approach. What is the most maintainable solution?

A.Create a service account with `roles/container.admin` and share its key JSON with team members.
B.Grant `roles/container.admin` to the team's Google Group at the folder level containing all relevant projects.
C.Grant `roles/container.admin` to each team member individually in each project's IAM policy.
D.Use the GKE Hub to create a fleet and assign RBAC roles within each cluster.
AnswerB

Folder-level IAM grants inherit to all child projects. Using a Google Group means membership changes (add/remove people) automatically update access without modifying IAM policies.

Why this answer

Granting `roles/container.admin` at the folder level to a Google Group is the most maintainable solution because it centralizes IAM policy management. When new projects are added under that folder, they automatically inherit the role, and team membership changes are handled by updating the Google Group rather than modifying individual project IAM policies. This approach follows Google Cloud's recommended practice of using groups and resource hierarchy for scalable access control.

Exam trap

The trap here is that candidates confuse Kubernetes RBAC (which controls access within a cluster) with Google Cloud IAM (which controls access to the GKE API and cluster management), leading them to choose fleet-based RBAC solutions that do not address the centralized IAM requirement.

How to eliminate wrong answers

Option A is wrong because sharing a service account key JSON with team members violates security best practices, creates a long-lived credential that cannot be easily revoked per user, and bypasses audit logging tied to individual identities. Option C is wrong because granting `roles/container.admin` to each team member individually in each project's IAM policy is not scalable, creates significant administrative overhead, and violates the principle of least privilege by requiring per-project updates for any team change. Option D is wrong because GKE Hub fleets manage multi-cluster features like service discovery and policy propagation, but they do not replace IAM roles at the project or folder level; RBAC roles within clusters control Kubernetes-level permissions, not GCP-level access to the GKE API or cluster management.

357
Multi-Selecteasy

A company is migrating a legacy application to Google Cloud. The application requires a shared file system that can be mounted by multiple compute instances across different zones for high availability. Which two Google Cloud services can meet this requirement?

Select 2 answers
A.Persistent Disk
B.Cloud Storage FUSE
C.Cloud Run
D.Google Cloud NetApp Volumes
E.Cloud Filestore
AnswersD, E

Google Cloud NetApp Volumes offers enterprise-grade managed NFS and SMB file shares built on NetApp ONTAP. It can be mounted by multiple Compute Engine instances across different zones via NFSv3 or NFSv4.1, providing high throughput and low latency along with advanced features like snapshots and clones, making it a strong choice for migrating legacy applications that require a reliable, POSIX-compliant shared file system.

Why this answer

Cloud Filestore and Google Cloud NetApp Volumes provide NFS-based file shares that can be mounted by multiple instances across zones. Persistent Disk cannot be attached in read-write mode to multiple instances across zones. Cloud Storage FUSE is not a POSIX-compliant shared file system.

Cloud Run is a compute service, not a storage service.

358
MCQeasy

A developer needs to test a Cloud Run service locally before deploying it to GCP. The service is packaged as a Docker container. Which tool allows them to run and test the container locally in a way that closely mimics the Cloud Run execution environment?

A.Run the container using `docker run -p 8080:8080 IMAGE` with the required environment variables.
B.Deploy the service to a staging Cloud Run environment using `gcloud run deploy --no-traffic`.
C.Use `gcloud run services describe` to simulate a local run.
D.Use Cloud Shell to run the container since Cloud Shell has Docker installed.
AnswerA

`docker run` with the `-p 8080:8080` flag binds the host port to the container's port 8080, which matches Cloud Run's default expected `$PORT` value and lets the service be exercised via `localhost:8080`. Supplying the same environment variables the Cloud Run service will receive replicates its runtime configuration, so the local container behaves like the deployed revision, enabling accurate functional and integration testing before deployment.

Why this answer

`docker run -p 8080:8080 IMAGE` with the required environment variables directly runs the containerized Cloud Run service on your local machine, mapping port 8080 to the container's port 8080 (the default Cloud Run listens on). This approach closely mimics the Cloud Run execution environment because Cloud Run also runs containers in a Docker-like runtime, and you can replicate environment variables, memory limits, and concurrency settings locally for accurate testing before deployment.

Exam trap

The trap here is that candidates assume any `gcloud` command or Cloud Shell can simulate a local runtime, but the ACE exam tests the distinction between local container execution (Docker) and cloud deployment commands, where only `docker run` with proper port mapping and environment variables provides a local test that closely mimics the Cloud Run execution environment.

How to eliminate wrong answers

Option B is wrong because deploying to a staging Cloud Run environment using `gcloud run deploy --no-traffic` does not test the service locally; it deploys the container to GCP, which requires network connectivity and incurs costs, and the `--no-traffic` flag only prevents routing requests to the new revision, not enabling local testing. Option C is wrong because `gcloud run services describe` is a read-only command that retrieves metadata about an existing Cloud Run service (e.g., URL, revision details) and cannot simulate or execute a local run of the container. Option D is wrong because Cloud Shell, while having Docker installed, runs in a remote, resource-constrained environment that does not replicate the Cloud Run execution environment (e.g., it lacks the same sandboxing, request handling, and scaling behavior), and it is not intended for local testing of containerized services.

359
MCQeasy

A team wants to receive an email alert when the average CPU utilization of VMs in a managed instance group exceeds 80% for more than 5 minutes. What should they create in Cloud Monitoring?

A.A dashboard with a CPU utilization chart
B.An alerting policy with a CPU utilization threshold condition
C.A log-based metric filter for high-CPU events
D.An uptime check targeting the managed instance group
AnswerB

An alerting policy with a CPU utilization threshold condition is the correct choice because it continuously evaluates the compute.googleapis.com/instance/cpu/utilization metric against the threshold you set. Once the metric exceeds the threshold for the specified duration (e.g., 5 minutes), the policy triggers a notification through the configured channel (email, SMS, webhook, etc.). This provides the real-time proactive notification that dashboards, log-based metrics, and uptime checks cannot.

Why this answer

B is correct because Cloud Monitoring alerting policies allow you to define conditions based on metric thresholds, such as average CPU utilization exceeding 80% for a specified duration (5 minutes). This directly meets the requirement to trigger an email alert when the condition is met.

Exam trap

Google Cloud often tests the distinction between alerting policies (which trigger notifications) and dashboards (which only display data), so candidates mistakenly choose a dashboard thinking it can send alerts.

How to eliminate wrong answers

Option A is wrong because a dashboard with a CPU utilization chart only visualizes data; it does not send alerts. Option C is wrong because log-based metric filters are used to extract metrics from log entries (e.g., custom application logs), not to monitor VM CPU utilization metrics which are already collected by Cloud Monitoring. Option D is wrong because uptime checks monitor the availability and response of HTTP/HTTPS services, not CPU utilization of VMs.

360
MCQmedium

A team enables OS Login on their GKE node pool. What does OS Login provide for SSH access to GKE nodes compared to the default metadata-based SSH key approach?

A.OS Login stores SSH keys in a Cloud KMS-managed keystore for enhanced encryption
B.OS Login links SSH access to IAM roles — access is centrally managed and revocable via IAM without updating VM metadata
C.OS Login automatically generates and rotates SSH key pairs every 24 hours
D.OS Login restricts SSH access to connections from specific IP ranges defined in Cloud Armor
AnswerB

OS Login links SSH access to IAM roles like `roles/compute.osLogin` or `roles/compute.osAdminLogin`. When a user is granted one of these roles, they can SSH into instances using their own identity, and revoking that role immediately removes access across all VMs without requiring metadata edits or key cleanup. This centralizes access management, simplifies revocation, and improves auditability compared to storing keys per instance.

Why this answer

OS Login links SSH access to IAM roles, so access is centrally managed and revocable via IAM without updating VM metadata. This means you can grant or revoke SSH access to GKE nodes by assigning or removing IAM roles (e.g., roles/compute.osLogin) on user or service accounts, eliminating the need to manage SSH keys in instance metadata. This provides a more secure and auditable access control mechanism compared to the default metadata-based SSH key approach.

Exam trap

The trap here is that candidates often confuse OS Login with SSH key management in metadata, thinking it still requires manual key distribution, when in fact it delegates authentication entirely to IAM, making access fully revocable and auditable without metadata updates.

How to eliminate wrong answers

Option A is wrong because OS Login does not store SSH keys in a Cloud KMS-managed keystore; instead, it uses IAM-based authentication and generates temporary SSH keys that are not stored in KMS. Option C is wrong because OS Login does not automatically generate and rotate SSH key pairs every 24 hours; it generates a temporary key per session that is valid only for the duration of the SSH connection. Option D is wrong because OS Login does not restrict SSH access based on IP ranges defined in Cloud Armor; IP-based restrictions are handled separately via VPC firewall rules or Cloud Armor policies, not by OS Login.

361
Multi-Selectmedium

An administrator needs to create a custom IAM role that allows listing projects and viewing billing accounts. Which TWO permissions should be included?

Select 2 answers
A.billing.accounts.list
B.billing.accounts.create
C.resourcemanager.projects.create
D.resourcemanager.projects.list
E.resourcemanager.projects.delete
AnswersA, D

Correct. The billing.accounts.list permission is the specific IAM permission that allows a principal to enumerate the billing accounts they can access. Including this permission in the custom role is essential and sufficient for the read-only task of listing billing accounts; without it, any API call or console view that attempts to list billing accounts will fail with a permission denied error.

Why this answer

resourcemanager.projects.list and billing.accounts.list allow these actions.

362
MCQmedium

An engineer wants to view the current IAM policy for a project in JSON format. Which command should they use?

A.gcloud resource-manager folders get-iam-policy my-project --format json
B.gcloud projects describe my-project --format json
C.gcloud projects get-iam-policy my-project --format json
D.gcloud iam policies get my-project --format json
AnswerC

This is the exact, valid CLI command for retrieving a project's IAM policy. The subcommand get-iam-policy reads the IAM policy bound to the specified project resource, and --format json renders it as a JSON array of bindings, including roles, members, and conditions. It is the correct tool for this task.

Why this answer

The gcloud projects get-iam-policy command with --format json outputs the IAM policy in JSON format.

363
MCQmedium

An engineer needs to grant an external auditor read-only access to view IAM policies on a GCP project. The auditor should not have access to any other resources. Which IAM role should be assigned?

A.roles/iam.roleAdmin
B.roles/iam.serviceAccountAdmin
C.roles/viewer
D.roles/iam.securityReviewer
AnswerD

roles/iam.securityReviewer is the correct choice because it grants permission to view IAM policies (for example, 'getIamPolicy') across all resources without allowing any modifications. It also includes permissions to list and get roles, which is exactly what an external auditor needs to review access configuration. This role aligns with least privilege for a read-only audit.

Why this answer

The `roles/iam.securityReviewer` role grants permission to view IAM policies without granting access to other resources. It is specifically designed for security auditors.

364
MCQmedium

You need to export all Cloud Logging logs from your project to BigQuery for long-term analysis. What should you create?

A.A Cloud Monitoring dashboard
B.A VPC flow log
C.A log-based alert
D.A log sink with destination BigQuery
AnswerD

A log sink in Cloud Logging's Router exports matching log entries to a destination such as BigQuery, Cloud Storage, or Pub/Sub. By configuring a sink with BigQuery as the destination and a filter that matches all logs (or empty filter), you continuously export your project's logs to a BigQuery dataset for analysis and long-term retention. This is the standard and only fully supported mechanism for exporting Cloud Logging logs to external services.

Why this answer

Log sinks route logs to supported destinations including BigQuery.

365
MCQeasy

A company wants to migrate a monolithic application to Google Cloud with minimal changes to the application code. Which compute option is most suitable?

A.Google Kubernetes Engine
B.App Engine (Flexible Environment)
C.Compute Engine
D.Cloud Functions
AnswerC

Compute Engine offers Infrastructure-as-a-Service virtual machines in which you select the OS, disk, and networking settings, allowing you to upload a disk image or reinstall the application directly. This 'lift-and-shift' approach preserves the existing architecture, libraries, and configuration with minimal or no code changes, making it the fastest and lowest-effort migration path for a monolithic application. It also provides full administrative control over the environment, letting you manage updates, security, and scaling in a familiar way.

Why this answer

Compute Engine (C) is the most suitable option because it provides Infrastructure as a Service (IaaS) virtual machines that can run the monolithic application with minimal code changes. The application can be migrated by simply lifting and shifting the existing VM or container image to a Compute Engine instance, preserving the OS, runtime, and dependencies without refactoring.

Exam trap

Google Cloud often tests the misconception that 'containerization always means minimal changes,' but the trap here is that GKE and App Engine Flexible Environment still require containerization and potential code adjustments, while Compute Engine allows a true lift-and-shift with zero code changes.

How to eliminate wrong answers

Option A is wrong because Google Kubernetes Engine (GKE) requires containerizing the application and often involves refactoring to fit a microservices architecture, which contradicts the 'minimal changes' requirement. Option B is wrong because App Engine Flexible Environment requires the application to be packaged as a container and adhere to specific runtime constraints, such as handling scaling and health checks, which may necessitate code modifications. Option D is wrong because Cloud Functions is a serverless, event-driven compute service that enforces a stateless, short-lived execution model, which is incompatible with a monolithic application's long-running processes and stateful behavior.

366
MCQmedium

Your company runs a data processing pipeline on Cloud Dataproc. The pipeline reads data from Cloud Storage, processes it with Spark, and writes results to BigQuery. Recently, the pipeline has been failing with errors indicating insufficient disk space on the worker nodes. The cluster is configured with standard worker nodes with 100 GB of standard persistent disk. The data size being processed has grown from 50 GB to 150 GB. What is the most cost-effective way to resolve the disk space issue?

A.Increase the size of the persistent disks on the worker nodes to 200 GB.
B.Use local SSDs instead of persistent disks for temporary storage.
C.Enable automatic disk resizing for the cluster.
D.Increase the number of worker nodes in the cluster.
AnswerC

Enabling automatic disk resizing on the node pool lets GKE monitor persistent-disk usage and grow the disk capacity in real time when utilization crosses a threshold, up to a configurable maximum. This keeps worker nodes operational during data spikes without human intervention, and because the disk only grows when needed, you avoid paying for unused space. It is the correct balance of resilience and cost management for a pipeline with variable data volume.

Why this answer

Cloud Dataproc's automatic disk resizing feature dynamically increases the size of persistent disks on worker nodes when disk usage exceeds a threshold (default 90%). This resolves the insufficient disk space issue without manual intervention or additional cost for unused capacity, making it the most cost-effective solution for handling the increased data volume from 50 GB to 150 GB.

Exam trap

Google Cloud often tests the misconception that adding more nodes (scaling out) is the default solution for storage issues, but the trap here is that the problem is disk space per node, not cluster capacity, making automatic disk resizing the most cost-effective and operationally efficient fix.

How to eliminate wrong answers

Option A is wrong because increasing persistent disks to 200 GB incurs ongoing costs for the full provisioned size, even if only a portion is used, and is less cost-effective than automatic resizing which only grows disks as needed. Option B is wrong because local SSDs provide temporary, non-persistent storage that is lost on VM termination and cannot be used for the pipeline's intermediate data if it must survive restarts or failures; additionally, local SSDs are more expensive per GB than persistent disks and require manual configuration. Option D is wrong because adding more worker nodes increases the total disk capacity but also increases compute costs unnecessarily; the issue is disk space per node, not insufficient nodes, and scaling out does not address the root cause of insufficient local storage on existing nodes.

367
MCQmedium

You are investigating high latency in your application deployed on Compute Engine. You suspect a specific API call is taking longer than expected. Which Google Cloud tool should you use to analyze the latency of individual requests?

A.Cloud Debugger
B.Cloud Trace
C.Cloud Monitoring dashboards
D.Cloud Logging log explorer
AnswerB

Cloud Trace is a distributed tracing service designed to collect latency data from Google Cloud and measure time spent in each service and API call during a request. It provides detailed per-request traces with spans that show the timing of each operation, making it the correct tool to investigate high application latency. By analyzing the waterfall view of spans, you can identify the exact component responsible for the delay across distributed services.

Why this answer

Cloud Trace provides distributed tracing, allowing you to see the latency of individual requests and identify bottlenecks. It captures trace spans from supported frameworks and services.

368
MCQhard

A compliance requirement mandates that all VM-to-VM traffic within a GCP project must be encrypted in transit, even for internal VPC traffic. Which feature enforces this for Compute Engine?

A.Shielded VMs with Secure Boot enabled
B.VPC firewall rules denying all non-encrypted traffic
C.Mutual TLS (mTLS) enforced at the application layer between VMs
D.Enabling VPC Flow Logs on all subnets
AnswerC

GCP's VPC doesn't automatically encrypt VM-to-VM traffic. mTLS at the application layer (using certificate-based authentication) is the standard method to enforce encrypted communication between services.

Why this answer

Mutual TLS (mTLS) enforced at the application layer is the correct answer. mTLS requires both client and server to present certificates and establishes a TLS-encrypted session between applications, ensuring encryption in transit for VM-to-VM traffic. In GCP, mTLS must be implemented within the application code or via a service mesh, not as a VPC-level feature. The other options are incorrect: Shielded VMs with Secure Boot protect boot integrity but do not encrypt traffic; VPC firewall rules filter traffic based on IP/port but cannot enforce encryption of the payload; VPC Flow Logs provide network monitoring but no encryption.

Exam trap

Candidates often assume GCP offers a built-in VPC-level feature for automatic encryption of internal VM-to-VM traffic, but no such option exists. Instead, encryption must be implemented at the application layer using mTLS, IPsec tunnels, or similar methods. Firewall rules cannot enforce encryption, only permit or deny traffic.

How to eliminate wrong answers

Option A is wrong because Shielded VMs with Secure Boot protect against boot-level malware and ensure firmware integrity, but they do not encrypt VM-to-VM traffic in transit. Option B is wrong because VPC firewall rules control which traffic is allowed or denied based on IP addresses, ports, and protocols, but they cannot inspect or enforce encryption of the traffic payload; they only filter packets at the network layer. Option D is wrong because VPC Flow Logs capture metadata about network flows (e.g., source/destination IP, ports, packet count) for monitoring and troubleshooting, but they do not encrypt traffic or enforce encryption in transit.

369
MCQmedium

An organization wants to deploy a containerized web application on GKE. They need the application to be accessible from the internet via a stable IP address. Which service type should they use when exposing the deployment?

A.ClusterIP
B.LoadBalancer
C.NodePort
D.ExternalName
AnswerB

A LoadBalancer Service is the appropriate choice for a containerized web application that needs a stable external IP. When you create this Service on Google Kubernetes Engine, the cloud-controller-manager automatically provisions a Google Cloud (TCP/UDP) load balancer and assigns a regional static external IP address. This gives clients a stable, publicly reachable endpoint, which precisely matches the requirement for an internet-facing web application.

Why this answer

A LoadBalancer service type provisions a Google Cloud TCP/UDP Load Balancer and assigns a stable external IP address. NodePort exposes on a high port but requires manual setup; ClusterIP is internal only.

370
MCQhard

A security team discovers that a service account key was accidentally committed to a public GitHub repository 48 hours ago. What should be the immediate steps to remediate this incident?

A.Rotate the service account key to generate a new one, keeping the old key active briefly for transition
B.Delete the leaked key immediately, audit Cloud Audit Logs for unauthorized activity using the key, then create a new key or switch to keyless authentication
C.Change the service account's display name and email to invalidate the leaked key
D.Remove all IAM roles from the service account to deny all actions until the investigation completes
AnswerB

Deleting the compromised service account key immediately revokes the attacker's primary authentication credential, effectively cutting off their direct API access through that key. After deletion, audit Cloud Audit Logs—specifically the Data Access and Admin Activity logs—to determine whether the key was used to call any GCP APIs, identify the scope of exposure, and check for unusual patterns such as token creation or IAM changes. Then issue a new key if the workload still requires a long-lived credential, or better, eliminate static keys entirely by adopting keyless authentication such as Workload Identity Federation, which binds short-lived credentials to the workload's identity.

Why this answer

The immediate priority is to revoke the compromised key's access by deleting it, which invalidates it instantly. Auditing Cloud Audit Logs is essential to detect any unauthorized usage that occurred during the 48-hour exposure window. Finally, creating a new key or switching to keyless authentication (e.g., workload identity federation) restores secure access without relying on long-lived static credentials.

Exam trap

Google Cloud often tests the misconception that rotating a key (generating a new one while keeping the old active) is sufficient, but the trap is that the old key remains valid and must be explicitly deleted to fully remediate a public leak.

How to eliminate wrong answers

Option A is wrong because rotating the key while keeping the old key active briefly violates the principle of least privilege and leaves a window for attackers to continue using the leaked credential. Option C is wrong because changing the service account's display name or email does not invalidate the existing key; keys are tied to the service account's unique ID and remain valid until explicitly deleted or disabled. Option D is wrong because removing all IAM roles from the service account is an overly broad action that could break legitimate services, and it does not immediately revoke the leaked key's ability to authenticate; the key itself remains valid until deleted.

371
MCQeasy

A company has a Compute Engine instance that needs to read files from a Cloud Storage bucket. The instance is running a custom application. What is the recommended way to grant the instance access to the bucket?

A.Generate a signed URL for the bucket and embed it in the application.
B.Create a service account with Storage Object Viewer role and associate it with the instance.
C.Use the default Compute Engine service account with Storage Admin role.
D.Store the bucket credentials in the instance metadata.
AnswerB

Associating a purpose-built service account with the instance is the Google-recommended pattern for granting cloud resources to a VM. Granting the Storage Object Viewer role (roles/storage.objectViewer) provides read-only access to objects without allowing writes or deletions, aligning with least privilege. The Compute Engine metadata server automatically supplies short-lived OAuth tokens for the service account, so no credentials are ever hard-coded or stored on disk. This integration works with the instance's default credentials and is fully auditable in Cloud Audit Logs.

Why this answer

Associating a service account with a Compute Engine instance and granting it the Storage Object Viewer role is the recommended IAM-based approach for granting least-privilege access to Cloud Storage. The instance retrieves short-lived OAuth 2.0 access tokens from the metadata server, which the application can use to authenticate API calls without embedding long-lived credentials.

Exam trap

Google Cloud often tests the misconception that the default Compute Engine service account is appropriate for custom applications, when in fact it should be replaced with a dedicated service account with minimal roles to avoid over-permissioning and cross-instance credential sharing.

How to eliminate wrong answers

Option A is wrong because signed URLs provide time-limited access to specific objects, not ongoing read access to a bucket, and embedding them in an application requires manual rotation and exposes the URL in code. Option C is wrong because the default Compute Engine service account with Storage Admin role grants excessive permissions (including delete and update) and violates the principle of least privilege; the default account is also shared across instances in the project. Option D is wrong because storing bucket credentials in instance metadata is insecure—metadata is accessible to any process on the instance and can be exposed via the metadata server without authentication.

372
MCQeasy

A company wants to deploy a new version of their application with zero downtime. They are using a managed instance group (MIG) behind a load balancer. Which deployment method should they use?

A.Create a new MIG, then update the load balancer's backend service
B.Delete the current MIG and create a new one with the updated template
C.Update the instance template and restart all instances
D.Perform a rolling update using a new instance template, with a health check
AnswerD

A rolling update with a new instance template and a health check is the correct way to deploy a new application version without downtime: the MIG progressively creates new instances from the updated template, waits for each to pass the configured health check, and then terminates the old instances. You can control the rollout speed with parameters like maxSurge and maxUnavailable, which ensure that a certain number of old instances remain serving at all times. The health check acts as the gate — if the new version fails health checks, the rollout pauses and old instances stay in service, allowing you to roll back without a full outage. This method directly targets the application version on existing instances, unlike a full MIG replacement, because it updates the instance group in place through the MIG's native update mechanism.

Why this answer

A rolling update using a new instance template allows the managed instance group (MIG) to gradually replace instances with the new version while health checks ensure each new instance is healthy before proceeding. This maintains the desired capacity and avoids downtime, as the load balancer automatically directs traffic only to healthy instances throughout the process.

Exam trap

Google Cloud often tests the misconception that updating the instance template and restarting all instances (Option C) is acceptable for zero downtime, but this ignores the fact that simultaneous restarts cause a full outage unless the MIG is configured for a rolling update with health checks.

How to eliminate wrong answers

Option A is wrong because creating a new MIG and updating the load balancer's backend service introduces a manual cutover step that risks traffic disruption or misconfiguration, and does not leverage the MIG's built-in rolling update mechanism for zero downtime. Option B is wrong because deleting the current MIG before creating a new one causes a period with zero instances, resulting in downtime until the new MIG is fully operational. Option C is wrong because updating the instance template and restarting all instances simultaneously would cause all instances to be unavailable at once, leading to downtime; a rolling update is required to replace instances incrementally.

373
MCQmedium

An administrator wants to set up a budget alert that triggers at 50%, 90%, and 100% of the monthly spending limit. What is the correct way to configure this?

A.Create a budget with a single threshold of 100% and rely on Cloud Monitoring
B.Use Cloud Billing reports to manually track
C.Create three separate budgets, each with a single threshold
D.Create one budget with three threshold rules: 50%, 90%, 100%
AnswerD

Creating one budget with three threshold rules is the recommended and most efficient approach because Cloud Billing budgets natively support multiple thresholds—each can be a percentage of the budget amount and trigger an alert independently. For example, you can set actual-cost thresholds at 50%, 90%, and 100%, and optionally add forecasted-cost thresholds as well. This gives you the desired notification at each stage without duplicating budget resources.

Why this answer

Budget alerts can have multiple threshold rules with different percentages. You can create a single budget with three threshold rules.

374
MCQhard

You are deploying a new revision of a Cloud Run service. You want to gradually shift traffic from the old revision to the new one, starting with 10% traffic to the new revision. Which command should you use?

A.gcloud run services update-traffic my-service --to-revision new-revision --percent 10
B.gcloud run revisions traffic my-service --to-revision new-revision --percent 10
C.gcloud run services update my-service --image gcr.io/my-project/my-image:new
D.gcloud run deploy my-service --image gcr.io/my-project/my-image:new --traffic new-revision=10
AnswerA

The `gcloud run services update-traffic` command is the correct tool for modifying an existing Cloud Run service's traffic routing. By specifying `--to-revision new-revision` and `--percent 10`, you instruct the service to send 10% of incoming requests to that revision while the remaining 90% continues to the current default revision. This enables incremental canary rollouts and rollbacks without redeploying code.

Why this answer

Cloud Run allows traffic splitting between revisions. The gcloud run services update-traffic command can specify the percentage of traffic for each revision.

375
MCQmedium

A managed instance group (MIG) is running 4 VMs with a CPU autoscaling target of 60%. A traffic spike drives average CPU to 90%. How does the autoscaler respond?

A.The MIG terminates the 2 least-used VMs to trigger a restart with higher performance settings
B.The autoscaler adds VMs until average CPU across the group drops to approximately 60%
C.The MIG live-migrates instances to larger machine types automatically
D.The MIG restarts all existing VMs to clear cached load
AnswerB

The autoscaler uses the target CPU utilization (e.g., 60%) to compute desired capacity: if the group's average CPU is above target, it calculates how many VMs are needed so that average utilization drops back to that level and provisions additional instances. For example, if 5 VMs run at 80%, it targets 7 VMs (5*0.8/0.6 ≈ 6.67) to bring average CPU to ~57%. This scale-out distributes load across new instances, reducing per-VM CPU demand. The autoscaler keeps adding until the measured average falls to approximately the target.

Why this answer

The autoscaler for a managed instance group (MIG) uses a target utilization metric—here, CPU at 60%. When average CPU exceeds that target (90%), the autoscaler calculates the desired number of VMs to bring utilization back to 60% (e.g., 4 VMs * 90% / 60% = 6 VMs) and adds instances accordingly. It does not terminate, migrate, or restart VMs; it scales out horizontally.

Exam trap

Google Cloud often tests the misconception that autoscaling involves modifying existing instances (e.g., restarting, migrating, or resizing) rather than simply adding or removing instances based on a target metric.

How to eliminate wrong answers

Option A is wrong because the autoscaler does not terminate VMs to trigger restarts; it adds VMs to reduce load, and termination would increase load on remaining instances. Option C is wrong because MIGs do not support live migration to larger machine types; autoscaling only adds or removes instances of the same template, and changing machine type requires a new instance template or a different MIG. Option D is wrong because restarting VMs does not reduce CPU utilization; it temporarily disrupts service and does not address sustained high load.

Page 4

Page 5 of 11

Page 6

All pages