Courseiva

Google Associate Cloud Engineer (ACE) — Questions 676–750

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

Page 9

Page 10 of 11

Page 11
676
MCQeasy

Which command is used to view the current IAM policy for a Google Cloud project in JSON format?

A.gcloud compute instances get-iam-policy [INSTANCE]
B.gcloud organizations get-iam-policy [ORG_ID]
C.gcloud projects get-iam-policy [PROJECT_ID] --format json
D.gcloud iam service-accounts get-iam-policy [SERVICE_ACCOUNT]
AnswerC

This command correctly retrieves the IAM policy for the specified GCP project, including all role bindings for members at the project level. The --format json flag ensures the output is machine-readable JSON, which is useful for automation or programmatic inspection. It is the standard gcloud command for viewing project-level IAM policies.

Why this answer

The 'gcloud projects get-iam-policy' command retrieves the IAM policy for a project. The '--format json' flag outputs it in JSON. The other options are for other resources or wrong scope.

677
MCQhard

A company uses Cloud SQL with Customer-Managed Encryption Keys (CMEK). The security team wants to rotate the encryption key. What is the impact on the Cloud SQL instance?

A.The instance becomes unavailable until the key rotation is complete.
B.All data in the instance is re-encrypted immediately.
C.The instance must be stopped and restarted after the key rotation.
D.There is no impact; the instance automatically uses the new key version.
AnswerC

This is the correct operational behavior. After rotating the key version in Cloud KMS, you must restart the Cloud SQL instance using the console, gcloud command, or API so that it recognizes the new key version as the encryption key for upcoming writes. The restart is required because the instance caches the old key version in memory, and the new version is only picked up during instance startup. This allows existing data to still be decrypted with the prior version while new encrypted data uses the updated version.

Why this answer

When rotating a CMEK for Cloud SQL, the instance must be restarted to use the new key version. Data remains encrypted at all times.

678
MCQmedium

Your application writes structured JSON logs to stdout from a Cloud Run service. You want to query logs in Cloud Logging to find all requests where the `user_id` field equals `12345`. Which log query syntax finds these entries?

A.`textPayload:"user_id:12345"`
B.`jsonPayload.user_id="12345"`
C.`resource.labels.user_id="12345"`
D.`labels.user_id="12345"`
AnswerB

This is the correct filter because Cloud Run automatically converts JSON-formatted lines written to stdout/stderr into structured LogEntry objects whose contents populate jsonPayload. Using jsonPayload.user_id="12345" directly compares the value of the user_id field inside that JSON object, giving a precise, indexed lookup. It follows Cloud Logging's filter syntax and avoids text scanning or guessing at metadata.

Why this answer

Cloud Logging uses the `jsonPayload` field to access structured JSON fields in log entries. When your application writes structured JSON logs to stdout, Cloud Run automatically parses them and stores the fields under `jsonPayload`. The query `jsonPayload.user_id="12345"` directly matches the `user_id` field within that JSON payload.

Exam trap

Google Cloud often tests the distinction between `jsonPayload` for structured logs and `textPayload` for unstructured logs, and candidates mistakenly use `textPayload` or confuse `resource.labels` with application-level JSON fields.

How to eliminate wrong answers

Option A is wrong because `textPayload` is used for unstructured text logs, not structured JSON; the syntax `textPayload:"user_id:12345"` would search for that literal string in the text payload, not the JSON field. Option C is wrong because `resource.labels` refers to labels on the monitored resource (e.g., Cloud Run service name, revision), not the application's JSON payload fields. Option D is wrong because `labels` in Cloud Logging refer to user-defined metadata labels on the log entry itself, not the structured JSON fields from the application output.

679
MCQmedium

A financial application requires a relational database with automatic failover to a standby in a different zone, with minimal configuration overhead. Which Cloud SQL configuration provides this?

A.Cloud SQL with a read replica in a different zone
B.Cloud SQL with High Availability (HA) configuration
C.Cloud Spanner multi-region instance
D.Two separate Cloud SQL instances with application-level failover logic
AnswerB

Cloud SQL with High Availability (HA) configuration is the correct choice because it automatically provisions a standby instance in a different zone within the same region and uses synchronous replication to keep it current. When the primary fails, Cloud SQL detects the outage and automatically promotes the standby, typically within seconds, and the public IP address remains the same so existing applications can reconnect without code changes. This gives you a simple, managed, zone-redundant solution that meets the requirement for automatic failover with no application-level logic.

Why this answer

Cloud SQL's High Availability (HA) configuration provides automatic failover to a standby instance in a different zone using synchronous replication and a regional persistent disk. This meets the requirement for minimal configuration overhead because it is a built-in feature that requires no application-level logic or manual intervention.

Exam trap

Google Cloud often tests the misconception that a read replica can serve as a failover target, but read replicas use asynchronous replication and require manual promotion, making them unsuitable for automatic failover with minimal configuration.

How to eliminate wrong answers

Option A is wrong because a read replica is designed for read scaling, not automatic failover; it requires manual promotion and does not provide synchronous replication for zero data loss. Option C is wrong because Cloud Spanner is a globally distributed, horizontally scalable database that introduces significant configuration overhead and cost, not a minimal-configuration relational database for a single-region failover requirement. Option D is wrong because managing two separate Cloud SQL instances with application-level failover logic adds significant configuration overhead and defeats the purpose of minimal configuration, as it requires custom code for health checks, replication, and failover coordination.

680
MCQeasy

A small business has a single Google Cloud project with a few Compute Engine instances running a web application. The instances are all in the same VPC and subnet. The security team wants to ensure that only HTTP (port 80) and HTTPS (port 443) traffic from the public internet is allowed to the instances, and that all other inbound traffic is blocked. They have already configured Cloud Armor for the load balancer. However, they notice that SSH traffic (port 22) is still reaching the instances from the internet, even though they do not have any explicit firewall rules allowing SSH. The project was just created and uses the default VPC network. What should they do to resolve this?

A.Create a VPC firewall rule with priority 1000 to deny ingress on port 22 from 0.0.0.0/0.
B.Configure a route to drop traffic destined to the instances on port 22.
C.Remove the SSH public key from the instance metadata.
D.Disable or delete the default-allow-ssh firewall rule in the VPC.
AnswerD

The default VPC network ships with the `default-allow-ssh` ingress rule, which permits TCP port 22 from 0.0.0.0/0 and overrides the absence of custom rules. Deleting it removes the only path allowing SSH, satisfying the requirement that inbound traffic be limited to ports 80 and 443.

Why this answer

The default VPC network in Google Cloud includes a default-allow-ssh firewall rule that permits SSH (port 22) from 0.0.0.0/0. To block SSH from the internet, they must disable or delete this rule. This is the direct cause of SSH traffic reaching the instances despite no explicit allow rule.

Exam trap

ACE often tests the misconception that no explicit allow rule means no traffic, forgetting that default VPC networks include permissive default firewall rules like default-allow-ssh.

How to eliminate wrong answers

Option A is wrong because creating a deny rule with priority 1000 may not override the default-allow-ssh rule if that rule has a lower priority number (higher precedence). In GCP, lower priority numbers take precedence; default-allow-ssh has priority 65534, so a deny with 1000 would actually take precedence, but the question states they have no explicit allow, yet SSH is reaching, indicating the default rule exists. However, the correct action is to remove the default rule, not add a deny, because the default rule is the root cause.

Option B is wrong because routes do not filter traffic based on ports; firewall rules do. Option C is wrong because removing SSH keys does not block network traffic; it only prevents authentication, but the traffic still reaches the instance.

681
MCQhard

A team is deploying a microservice to Cloud Run that needs to process messages from Pub/Sub. The service should only be invocable by Pub/Sub push deliveries, not by unauthenticated HTTP requests. What should the team do?

A.Deploy with --allow-unauthenticated and set up a Pub/Sub subscription with OIDC token audience
B.Deploy with --no-allow-unauthenticated and create a VPC connector to allow Pub/Sub internal traffic
C.Deploy with --no-allow-unauthenticated and configure the Pub/Sub subscription to use a service account that has the roles/run.invoker role on the Cloud Run service
D.Use Cloud Functions instead, which is more secure for Pub/Sub triggers
AnswerC

Deploying with `--no-allow-unauthenticated` enforces that only authenticated requests carrying a valid OIDC token are accepted by the Cloud Run service. When the Pub/Sub subscription is configured with a service account that has the `roles/run.invoker` role on the service, Pub/Sub uses that identity to mint an OIDC token with the correct audience, and Cloud Run recognizes the token as authorized. This is the recommended secure pattern for triggering Cloud Run from Pub/Sub.

Why this answer

Deploying Cloud Run with `--no-allow-unauthenticated` enforces IAM authentication on the service, and configuring the Pub/Sub push subscription to use a service account with `roles/run.invoker` on that service lets Pub/Sub present a valid OIDC token that Cloud Run accepts. This ensures only Pub/Sub push deliveries can invoke the service.

Exam trap

ACE often tests the misconception that network-level controls (VPC connectors, private networking) provide authentication — candidates pick VPC connector options, but Cloud Run ingress auth is enforced via IAM and OIDC tokens, not network topology.

How to eliminate wrong answers

Option A is wrong because `--allow-unauthenticated` makes the service publicly invokable, defeating the requirement — anyone with the URL could call it. Option B is wrong because a VPC connector controls egress/private networking, not ingress authentication; Pub/Sub push still needs an OIDC token to pass Cloud Run's IAM check. Option D is wrong because switching to Cloud Functions is unnecessary and doesn't inherently solve the authentication requirement — Cloud Run with proper IAM is the correct, supported pattern.

682
MCQmedium

Refer to the exhibit. The Terraform plan above returns the error: Error: "member" is required. What is the issue?

A.The Terraform provider version is outdated.
B.The project ID is incorrect.
C.The member argument must be a service account, not a user.
D.The member argument should be 'member' (singular) not 'members'.
AnswerD

The resource google_project_iam_member defines its IAM principal using a singular 'member' argument, whereas the plural 'members' argument is only valid on google_project_iam_binding (which manages a full set of members for a specific role). Terraform's schema validation for the google_project_iam_member resource does not recognize 'members' and therefore raises an 'unexpected argument' error during the plan. To fix this, change the argument key from 'members' to 'member', ensuring the configuration matches the resource's expected singular attribute for assigning one principal to a project role.

Why this answer

The Terraform error 'Error: "member" is required' indicates that the resource block is using the plural argument 'members' instead of the singular 'member'. In the Google Cloud Terraform provider, the google_project_iam_member resource expects a single 'member' argument (e.g., 'user:email@example.com'), not a list. The correct syntax is 'member = "user:email@example.com"', not 'members = ["user:email@example.com"]'.

This is a common syntax error when transitioning from other IAM resources that accept lists.

Exam trap

Google Cloud often tests the subtle difference between singular and plural argument names in Terraform resources (e.g., 'member' vs 'members'), tricking candidates who assume both forms are interchangeable or who confuse IAM member with IAM binding syntax.

How to eliminate wrong answers

Option A is wrong because an outdated provider version would typically cause deprecation warnings or missing features, not a specific error about a required argument name. Option B is wrong because an incorrect project ID would result in an error like 'project not found' or 'permission denied', not a missing 'member' argument. Option C is wrong because the 'member' argument can accept users, service accounts, groups, or domains (e.g., 'user:email', 'serviceAccount:sa@project.iam.gserviceaccount.com'); the error is about the argument name, not the value type.

683
MCQhard

You are setting up a new organization in Google Cloud. You want to restrict the regions where resources can be created to comply with data residency requirements. What should you do?

A.Set an organization policy with a constraint on allowed resource locations
B.Create a service account with limited permissions
C.Set a budget alert that notifies when resources are created outside allowed regions
D.Use IAM roles to restrict which users can create resources in specific regions
AnswerA

An organization policy with the constraints/gcp-resource-locations constraint defines an explicit allowlist of regions where resources can be created. When set at the organization, folder, or project level, it is enforced synchronously at resource creation time, and any API request targeting a location outside the allowlist is rejected with an error. This is the intended, preventative control for enforcing data residency or regulatory location requirements across Google Cloud.

Why this answer

Organization policies in Google Cloud are the native mechanism for enforcing constraints across all projects in an organization, including resource location restrictions. The `constraints/gcp.resourceLocations` constraint (part of the Location Restriction constraint family) lets you define an allowlist of regions/zones where resources can be created, and it is enforced at the org, folder, or project level regardless of a user's IAM permissions. This directly satisfies data residency requirements because it blocks resource creation outside approved locations even for project owners.

Exam trap

ACE often tests the misconception that IAM roles can restrict where resources are created, when in fact only Organization Policies provide location-based enforcement.

How to eliminate wrong answers

Option B is wrong because a service account with limited permissions controls what identities can do, not where resources can be created — it cannot enforce geographic restrictions. Option C is wrong because a budget alert is a monitoring/notification tool for spend, not a preventive control; it would only tell you after a resource was already created outside the allowed region. Option D is wrong because IAM roles grant or deny actions (like compute.instances.create) but have no concept of region-level granularity for most services, so they cannot enforce data residency.

684
MCQmedium

A team is setting up a new project and wants to estimate the monthly cost of running a Compute Engine VM with 4 vCPUs, 16 GB memory, and a 100 GB persistent disk, using the Google Cloud Pricing Calculator. The VM will run for 12 hours every day for a month. Which discount type will automatically apply to reduce the cost based on usage?

A.Preemptible VM discount
B.Sustained use discount
C.Committed use discount
D.Free tier discount
AnswerB

Sustained use discounts are applied automatically when a VM runs for more than 25% of a billing month (approximately 186 hours), without requiring any upfront commitment or configuration. For a VM running 12 hours daily, monthly usage is roughly 360 hours, so the discount kicks in automatically after the threshold is crossed, reducing the bill by up to 20-30% based on the on-demand price — exactly the kind of predictable, usage-based discount this team can estimate.

Why this answer

Sustained use discounts (SUDs) are automatic discounts that Google Cloud applies to Compute Engine instances that run for a significant portion of the billing month. Because the VM runs 12 hours per day every day, it accumulates enough usage to qualify for SUDs without any commitment or action from the team. The discount is applied automatically to the invoice.

Exam trap

ACE often tests the confusion between automatic discounts (sustained use) and opt-in discounts (committed use, preemptible), catching candidates who assume any discount requires a commitment.

How to eliminate wrong answers

Option A is wrong because preemptible VMs are a separate, cheaper VM type that can be terminated at any time — they are not a discount that automatically applies to a standard VM. Option C is wrong because committed use discounts require an explicit 1- or 3-year commitment in exchange for a discount; they are not applied automatically based on usage. Option D is wrong because the free tier applies only to specific always-free resource limits (e.g., one e2-micro instance in select regions), not to a 4-vCPU/16 GB VM.

685
Multi-Selecthard

Which THREE options are valid methods to authenticate a service account when making calls to Google Cloud APIs from a Compute Engine instance?

Select 3 answers
A.Using a JSON key file downloaded for the service account.
B.Using a user account's OAuth2 tokens obtained via a web browser.
C.Using an API key generated from the Cloud Console.
D.Using the Compute Engine metadata server to obtain an access token for a custom service account.
E.Using the default service account's automatically provided credentials.
AnswersA, D, E

A JSON key file downloaded for the service account is a valid authentication method because it contains the private key associated with the service account's identity. Applications can load this file via the GOOGLE_APPLICATION_CREDENTIALS environment variable or directly in client libraries (e.g., service_account.Credentials.from_service_account_file). This enables the application to sign requests and obtain OAuth2 access tokens that prove it is acting as that service account, making it suitable for server-to-server authentication.

Why this answer

A JSON key file downloaded for a service account contains the private key necessary to create a signed JWT assertion, which is exchanged for an OAuth 2.0 access token via the Google OAuth 2.0 token endpoint (https://oauth2.googleapis.com/token). This is a standard authentication method for service accounts outside of Google Cloud, but it is also valid from a Compute Engine instance, though less secure than using the metadata server.

Exam trap

Google Cloud often tests the distinction between authentication (proving identity) and authorization (granting permissions), and the trap here is that candidates mistakenly think API keys (Option C) can authenticate a service account, when in fact API keys only identify the project and are not tied to a specific identity.

686
Multi-Selecthard

A company requires that all service account keys be automatically rotated every 90 days. Which two steps should the administrator take to enforce this? (Choose two.)

Select 2 answers
A.Enable the Service Account Key Rotator in the Google Cloud Console.
B.Use IAM to set a condition that keys must have an expiration date.
C.Use the Service Account API to create keys with a custom expiration time.
D.Use an Organization Policy to disable service account key creation.
E.Use a Cloud Function to monitor key age and delete keys older than 90 days.
AnswersC, E

The Service Account API's keys.create method supports user-managed keys with a validBeforeTime (expiration) field, allowing you to set an exact expiration timestamp at creation time. When a key reaches that time, it becomes invalid, effectively forcing a controlled lifespan and enforcing rotation via a key refresh process. This is a native Google Cloud mechanism for key rotation that does not require external automation, making it a correct approach.

Why this answer

The Service Account API allows creating keys with a custom expiration time, which enforces automatic rotation by ensuring keys are invalid after 90 days. Option E is correct because a Cloud Function can monitor key age and delete keys older than 90 days, providing a programmatic enforcement mechanism. Both approaches ensure keys are rotated automatically without manual intervention.

Exam trap

Google Cloud often tests the misconception that there is a built-in 'auto-rotate' toggle in the console, but in reality, you must use API-level expiration or custom automation like Cloud Functions to enforce rotation.

687
MCQmedium

A Cloud Run service named 'my-service' is currently serving 100% traffic to revision 'rev1'. You deploy a new revision 'rev2' and want to gradually shift traffic so that rev2 receives 10% of requests. Which command should you use?

A.gcloud run services update-traffic my-service --to-revisions=rev2=10,rev1=90
B.gcloud run services update my-service --traffic=rev2=10%
C.gcloud run deploy my-service --image=... --traffic=rev2=10
D.gcloud run revisions update rev2 --traffic=10
AnswerA

This is the correct service-level command for a precise traffic split between two existing revisions. It specifies both revisions explicitly, so Cloud Run routes exactly 10% of requests to rev2 and 90% to rev1; percentages must sum to 100 and should be entered as bare integers (no '%' sign). Because it uses `--to-revisions` on `update-traffic`, it works for rollbacks and gradual shifts without creating a new revision.

Why this answer

`gcloud run services update-traffic` is the dedicated command for changing traffic allocation between revisions, and the `--to-revisions=rev2=10,rev1=90` syntax assigns 10% to rev2 and 90% to rev1. This performs a gradual traffic shift without redeploying the service. It is the correct way to implement a canary or gradual rollout on Cloud Run.

Exam trap

ACE often tests the specific subcommand for traffic management, so candidates who use the generic `gcloud run services update` or `deploy` with a `--traffic` flag pick an invalid syntax.

How to eliminate wrong answers

Option B is wrong because `gcloud run services update` does not accept a `--traffic` flag with percentage syntax; traffic changes require `update-traffic`. Option C is wrong because `gcloud run deploy` with `--traffic` is not the documented way to split traffic between existing revisions and would redeploy rather than adjust routing. Option D is wrong because `gcloud run revisions update` is not a valid command for setting traffic percentages on a service.

688
MCQeasy

A developer needs to run an interactive shell inside a running GKE Pod named 'api-pod-7d4f9' in the 'production' namespace to investigate a runtime issue. Which kubectl command opens an interactive shell?

A.kubectl ssh api-pod-7d4f9 -n production
B.kubectl exec -it api-pod-7d4f9 -n production -- /bin/bash
C.kubectl run debug --image=busybox --attach=api-pod-7d4f9
D.gcloud container exec api-pod-7d4f9 --namespace=production -- bash
AnswerB

This is the correct way to open an interactive shell inside the `api-pod-7d4f9` Pod. `-i` keeps STDIN open so you can type commands, `-t` allocates a pseudo-TTY for a proper terminal session, and `-n production` selects the namespace where the Pod lives. The `-- /bin/bash` specifies the command to run inside the first container of the Pod, and because most application images include bash, this gives you an interactive bash shell. If bash were not installed, you could substitute `/bin/sh` or another available shell.

Why this answer

`kubectl exec -it` attaches an interactive terminal to a running container in a Pod, with `-i` for stdin and `-t` for a TTY. The `-- /bin/bash` launches a Bash shell inside the container, allowing the developer to investigate runtime issues. This is the standard Kubernetes method for interactive shell access.

Exam trap

Google Cloud often tests the distinction between `kubectl exec` (for existing containers) and `kubectl run` (for creating new Pods), and candidates mistakenly choose options that use non-existent commands like `kubectl ssh` or `gcloud container exec`.

How to eliminate wrong answers

Option A is wrong because `kubectl ssh` is not a valid kubectl command; Kubernetes does not use SSH for container access, and this would fail. Option C is wrong because `kubectl run debug --image=busybox --attach=api-pod-7d4f9` creates a new Pod named 'debug' rather than attaching to the existing 'api-pod-7d4f9', and the `--attach` flag is misused (it attaches to the new Pod's logs, not the target Pod). Option D is wrong because `gcloud container exec` is not a valid gcloud command; the correct gcloud command for exec access is `gcloud container clusters get-credentials` followed by `kubectl exec`, and the syntax shown is incorrect.

689
MCQeasy

What is the purpose of the gcloud init command?

A.To create a billing account.
B.To initialize a new project in Google Cloud.
C.To enable APIs for a project.
D.To set up a new gcloud configuration and authenticate.
AnswerD

The primary purpose of gcloud init is to bootstrap the gcloud command-line tool by creating a new configuration, authenticating with your Google account or service account, and setting properties like the default project, region, and zone. It is the standard first step when installing or reinstalling the gcloud SDK on a new machine or for setting up an isolated environment.

Why this answer

The gcloud init command is the primary setup utility for the Google Cloud CLI. It performs two core tasks: it creates a new named configuration (or reinitializes an existing one) and then walks the user through authentication via gcloud auth login, followed by selecting a default project and optionally a default Compute Engine zone/region. This ensures the CLI is ready for use with the correct credentials and project context.

Exam trap

ACE often tests the confusion between gcloud init and other gcloud commands like gcloud projects create or gcloud services enable, tricking candidates into thinking gcloud init performs project creation or API enablement rather than just setting up CLI configuration and authentication.

How to eliminate wrong answers

Option A is wrong because billing accounts are created and managed via the Cloud Console or the Cloud Billing API, not through gcloud init; gcloud init does not handle billing account creation. Option B is wrong because initializing a new project means creating a project resource, which is done with gcloud projects create, not gcloud init; gcloud init only sets a default project for the configuration. Option C is wrong because enabling APIs is performed with gcloud services enable, not gcloud init; gcloud init does not enable any APIs by default.

690
MCQeasy

You want to switch between multiple GCP projects frequently using the gcloud CLI. What is the recommended approach?

A.Open separate terminal windows for each project.
B.Run gcloud init every time you switch projects.
C.Use gcloud config set project each time you switch.
D.Create multiple configuration profiles and activate them as needed.
AnswerD

Creating multiple named configurations with gcloud config configurations create and activating them via gcloud config configurations activate is the officially recommended pattern for frequent context switching. Each configuration stores its own project, account, region, and other properties, so you can define a distinct environment for every GCP project or workflow. Activation is instantaneous and deterministic, and you can even use the --configuration flag to run a single command in a non-default configuration without changing your active context, enabling safe automation and parallel work.

Why this answer

gcloud supports named configuration profiles, each holding its own project, account, region, and zone settings. Creating multiple configurations and activating the relevant one with 'gcloud config configurations activate <name>' lets you switch contexts instantly without re-authenticating or re-initializing. This is the officially recommended approach for developers who work across many projects.

Exam trap

ACE often tests whether candidates know that 'gcloud config set project' only changes one property of the current config, whereas named configurations preserve a full context (account, project, region, zone) — the trap is picking the quick-fix command over the scalable profile approach.

How to eliminate wrong answers

Option A is wrong because opening separate terminal windows does not change the underlying gcloud configuration — each shell still uses the same active config unless you manually override it, and it does not scale. Option B is wrong because 'gcloud init' is a full re-initialization that re-runs authentication and setup, which is slow and disruptive for routine project switching. Option C is wrong because 'gcloud config set project' only changes the project property of the current configuration; it does not switch accounts, regions, or zones, and it mutates the active config rather than preserving distinct profiles.

691
MCQmedium

A team is migrating from Google Container Registry (gcr.io) to Artifact Registry. Existing automation scripts use `gcr.io/my-project/myimage`. To avoid updating all scripts immediately, which Artifact Registry feature allows gcr.io-addressed pulls to work with Artifact Registry backends?

A.Artifact Registry has no gcr.io compatibility — all scripts must be updated immediately
B.Enable the gcr.io compatibility redirect in Artifact Registry settings so gcr.io URLs route to Artifact Registry
C.Use a Cloud DNS private zone to redirect gcr.io to Artifact Registry
D.Both Container Registry and Artifact Registry can be active simultaneously with no configuration
AnswerB

Enabling the gcr.io compatibility redirect in the Artifact Registry project settings maps the legacy gcr.io hostname to the corresponding Artifact Registry repository, so existing container commands like docker pull gcr.io/my-project/my-image continue to work without immediate script changes. This is the intended migration path because it lets you incrementally move workloads from Container Registry to Artifact Registry while preserving CI/CD pipeline behavior. Without this setting, gcr.io URLs continue to hit the deprecated Container Registry service instead of the new repository, risking breakage when Container Registry is decommissioned.

Why this answer

Artifact Registry offers a gcr.io compatibility redirect feature that automatically routes requests originally targeting `gcr.io/my-project/myimage` to the corresponding Artifact Registry repository. This allows existing automation scripts to continue using the old `gcr.io` hostname without modification, while the underlying storage and image management are handled by Artifact Registry. The redirect is configured at the project level and works transparently for pull operations, eliminating the need for immediate script updates.

Exam trap

Google Cloud often tests the misconception that DNS manipulation (like Cloud DNS private zones) can solve hostname redirection for external services, but in reality, Google-managed hostnames like `gcr.io` cannot be overridden with private DNS, and the correct solution is the built-in Artifact Registry redirect feature.

How to eliminate wrong answers

Option A is wrong because Artifact Registry does provide gcr.io compatibility via a redirect feature, so scripts do not need to be updated immediately. Option C is wrong because Cloud DNS private zones cannot redirect external hostnames like `gcr.io` to Artifact Registry; DNS resolution for `gcr.io` is managed by Google and cannot be overridden with private zones, and this approach would not handle the authentication or routing required for container pulls. Option D is wrong because while both registries can be active simultaneously, no configuration is needed only if you manually push images to both; the gcr.io compatibility redirect specifically requires enabling the feature to make `gcr.io` pulls work with Artifact Registry backends without script changes.

692
MCQmedium

A company wants to ensure that all IAM users in a project must use two-factor authentication. Which Google Cloud service should be used?

A.Cloud Identity
B.Identity Platform
C.Cloud IAM
D.Cloud Audit Logs
AnswerA

Cloud Identity is the correct choice because it is Google's Identity-as-a-Service (IDaaS) solution that centrally manages user accounts, groups, and security policies for a project. It provides features like two-step verification (2SV), single sign-on (SSO), and session management, which directly enforce authentication security for IAM users. As the identity provider for Cloud Platform, it ensures that only properly authenticated and policy-compliant users can access project resources.

Why this answer

Cloud Identity is the correct service because it provides identity-as-a-service (IDaaS) that allows administrators to enforce security policies, including requiring two-factor authentication (2FA) for all IAM users. By enabling 2FA at the Cloud Identity level, every user authenticating through Google Cloud's identity layer must complete a second factor (e.g., TOTP via Google Authenticator or a security key) before accessing any Google Cloud resources. This policy applies globally across all projects in the organization, ensuring consistent enforcement without needing to configure per-user or per-project settings.

Exam trap

The trap here is that candidates confuse Cloud IAM (which handles authorization) with Cloud Identity (which handles authentication and MFA enforcement), leading them to incorrectly select Cloud IAM because they think 'IAM' covers all identity-related settings.

How to eliminate wrong answers

Option B is wrong because Identity Platform is a customer-facing authentication service for applications (e.g., adding sign-in to a web app), not for enforcing 2FA on internal IAM users accessing Google Cloud resources. Option C is wrong because Cloud IAM manages permissions (who has access to what) but does not handle authentication methods or enforce multi-factor authentication policies. Option D is wrong because Cloud Audit Logs records who did what and when, but it cannot enforce or require two-factor authentication; it is a logging and monitoring service, not an identity or policy enforcement service.

693
MCQmedium

You are troubleshooting a Pub/Sub subscription that is not receiving messages as fast as they are published. You want to check if there is a backlog of unacknowledged messages for the subscription. What should you use?

A.Check the Cloud Logging logs for the subscription
B.Use gcloud pubsub subscriptions describe and check the ackDeadlineSeconds
C.Check the Cloud Console Pub/Sub dashboard for the topic publish rate
D.Use Cloud Monitoring to view the 'oldest_unacked_message_age' metric
AnswerD

The `oldest_unacked_message_age` metric, available in Cloud Monitoring under `pubsub.googleapis.com/subscription/oldest_unacked_message_age`, is a gauge metric that reports, per subscription, the age of the oldest message that has not yet been acknowledged. A high or increasing value directly indicates that the subscriber is not keeping up with the message flow, representing a growing backlog. This is the standard and most direct way to detect consumer lag in Cloud Pub/Sub, making it the correct diagnostic tool for the scenario.

Why this answer

The 'oldest_unacked_message_age' metric in Cloud Monitoring directly measures the age of the oldest unacknowledged message in a subscription, which is the definitive indicator of a backlog. A growing value means messages are accumulating faster than they are being acknowledged. This metric is part of the standard Pub/Sub monitoring metrics and is the recommended way to detect and quantify subscription backlog.

Exam trap

ACE often tests the difference between configuration details (like ackDeadlineSeconds) and operational metrics (like oldest_unacked_message_age), so candidates may mistakenly choose a configuration check when asked to diagnose a backlog.

How to eliminate wrong answers

Option A is wrong because Cloud Logging captures operational logs (e.g., publish/ack events, errors) but does not provide a direct metric for backlog size or message age. Option B is wrong because 'gcloud pubsub subscriptions describe' returns configuration details like ackDeadlineSeconds, not real-time backlog data; ackDeadlineSeconds is a configuration setting, not a measure of unacknowledged messages. Option C is wrong because the Cloud Console Pub/Sub dashboard shows topic publish rate, which indicates incoming message volume but not the subscription's ability to keep up or the backlog of unacknowledged messages.

694
MCQmedium

An application running on a Compute Engine VM needs to read objects from a Cloud Storage bucket in the same project. What is the recommended authentication approach?

A.Embed a developer's user account credentials in the application configuration file
B.Attach a service account with the Storage Object Viewer role to the VM
C.Create an API key and store it as an environment variable on the VM
D.Grant the VM's IP address access to the bucket using a VPC firewall rule
AnswerB

Attaching a service account to the VM and assigning it the Storage Object Viewer role is the correct approach because it gives the instance a dedicated machine identity with least-privilege access to read objects. The application can automatically obtain OAuth tokens from the instance metadata server without needing to store any credentials locally. This works seamlessly with the Cloud Storage client libraries, which automatically pick up the attached service account's credentials. It also ensures rotation and revocation are managed by Google Cloud, not by application code.

Why this answer

Attaching a service account with the Storage Object Viewer role to the Compute Engine VM is the recommended and secure method for authenticating to Cloud Storage. The VM automatically obtains OAuth 2.0 access tokens for the service account via the metadata server, eliminating the need to manage or embed credentials in the application code.

Exam trap

Google Cloud often tests the misconception that API keys or IP-based firewall rules can control access to Cloud Storage, when in fact Cloud Storage relies solely on IAM roles and OAuth 2.0 tokens for authentication and authorization.

How to eliminate wrong answers

Option A is wrong because embedding a developer's user account credentials in a configuration file violates security best practices, exposes long-lived credentials, and ties the application to an individual user's permissions rather than a dedicated identity. Option C is wrong because API keys are not designed for authenticating as a specific identity; they identify the project making the call, not the caller, and lack the granular access control of IAM roles, making them unsuitable for accessing Cloud Storage objects. Option D is wrong because VPC firewall rules control network traffic at the IP/port level, not access to Cloud Storage objects; Cloud Storage uses IAM permissions for object-level access, and IP-based access control is not supported for bucket operations.

695
MCQmedium

A startup processes uploaded videos — each video upload triggers transcoding that takes 5–30 minutes. Users should get an immediate response after upload, not wait for transcoding. The transcoding system must handle burst uploads. Which architecture fits?

A.Upload the video and synchronously wait for transcoding to complete before responding
B.Publish a transcoding job to Cloud Pub/Sub after upload; respond immediately; workers consume and process jobs asynchronously
C.Use Cloud Spanner to store video metadata and transcode synchronously in a Cloud SQL stored procedure
D.Deploy the transcoding directly in the API server and scale the API server horizontally for bursts
AnswerB

Immediately returning an acknowledgment after publishing the job to Cloud Pub/Sub gives the user a fast response while decoupling API availability from transcoding latency. Cloud Pub/Sub durably buffers the messages, so a burst of uploads doesn't cause lost work or API saturation. Autoscaling Compute Engine or Cloud Run workers pull messages at their own pace and perform transcoding independently, making the pipeline elastic and burst-tolerant. This is the canonical asynchronous, event-driven media-processing pattern on Google Cloud.

Why this answer

It decouples the upload from the transcoding process using Cloud Pub/Sub, allowing the API to respond immediately to the user while workers asynchronously process the transcoding jobs. This pattern handles burst uploads by buffering messages in Pub/Sub and scaling workers independently, ensuring no upload is lost even under high load.

Exam trap

Google Cloud often tests the misconception that synchronous processing or scaling the API server alone can handle long-running tasks, but the trap here is that immediate response and burst handling require asynchronous decoupling via a message queue like Pub/Sub, not just horizontal scaling.

How to eliminate wrong answers

Option A is wrong because synchronous waiting for transcoding (5–30 minutes) would block the HTTP response, violating the requirement for an immediate user response and causing timeouts or poor user experience. Option C is wrong because Cloud Spanner is a globally distributed relational database, not a transcoding engine, and running transcoding synchronously in a Cloud SQL stored procedure is impossible—stored procedures cannot perform video processing tasks. Option D is wrong because deploying transcoding directly in the API server would block the request thread for minutes, preventing horizontal scaling from solving the burst issue (each instance would still be tied up per upload), and it couples compute-intensive work with the stateless API layer.

696
MCQmedium

A monitoring alert fires at 3 AM — the team's GKE Pods are being evicted. Investigation shows node memory is at 98%. Pods without resource requests are being evicted first. What is the long-term fix to prevent evictions?

A.Set higher memory limits on the Pods being evicted
B.Add explicit memory requests (and optionally limits) to all Pod specs
C.Disable node-level eviction by modifying kubelet configuration
D.Add more nodes to the cluster to increase available memory
AnswerB

Without memory requests, Pods are classified BestEffort, so the kubelet evicts them first under node memory pressure. Declaring explicit memory requests makes each Pod Burstable or Guaranteed, giving the scheduler accurate placement data and the kubelet a defined eviction ranking.

Why this answer

B is correct because setting explicit memory requests ensures the Kubernetes scheduler can accurately place Pods on nodes with sufficient resources, preventing the node from being overcommitted. Without requests, Pods are treated as burstable or best-effort, making them the first candidates for eviction under the kubelet's Quality of Service (QoS) classes when node memory pressure hits 98%. This is a long-term fix because it enforces proper resource governance at the scheduling level, not just a reactive measure.

Exam trap

Google Cloud often tests the misconception that raising limits or adding capacity is the fix, but the real issue is the absence of requests, which prevents the scheduler from making informed placement decisions and leaves Pods in the lowest QoS class.

How to eliminate wrong answers

Option A is wrong because raising memory limits without adjusting requests does not improve scheduling accuracy; limits only cap usage, but the Pod still lacks a guaranteed reservation, so it remains in a lower QoS class and is still evicted first under pressure. Option C is wrong because disabling kubelet eviction (via --eviction-hard or --eviction-soft flags) would allow the node to run out of memory entirely, leading to system OOM kills or node instability, which is not a valid long-term fix. Option D is wrong because adding nodes only distributes the load temporarily; without requests, new Pods will still be placed without guarantees, and the same eviction pattern will recur on any node under memory pressure.

697
Multi-Selectmedium

A company uses Cloud Armor to protect an HTTP Load Balancer. They want to allow traffic only from specific IP ranges (198.51.100.0/24 and 203.0.113.0/24) and block common web attacks like SQL injection and XSS. Which TWO actions should they take?

Select 2 answers
A.Set up Cloud NAT to provide outbound internet access for the instances.
B.Configure VPC firewall rules on the subnet to allow only the IP ranges.
C.Enable predefined WAF rules (e.g., OWASP Top 10) in the Cloud Armor security policy.
D.Create a Cloud Armor security policy with an allow rule for the IP ranges and a default deny rule for all other traffic.
E.Enable Cloud CDN to cache static content from the backend.
AnswersC, D

Predefined WAF rules at Cloud Armor's layer 7 evaluate request payloads against signatures for SQL injection and cross-site scripting. This satisfies the stem's requirement to block common web attacks, which IP-based allow rules alone cannot inspect or mitigate.

Why this answer

Option D is correct because Cloud Armor security policies are enforced at the HTTP(S) Load Balancer edge, so an allow rule matching source IP ranges 198.51.100.0/24 and 203.0.113.0/24 combined with a default deny rule (priority-based, with the allow rule at a lower priority number) restricts traffic to only those ranges. Option C is correct because Cloud Armor's predefined WAF rules, such as the OWASP Top 10 rule sets (e.g., sqli-v33-stable and xss-v33-stable), detect and block SQL injection and XSS at the load balancer. Option A is incorrect because Cloud NAT only provides outbound internet access for instances without external IPs and does not filter inbound traffic or block web attacks.

Option B is incorrect because VPC firewall rules operate at the network/subnet level on instance traffic, not on HTTP(S) Load Balancer traffic, and cannot inspect for SQL injection or XSS. Option E is incorrect because Cloud CDN only caches static content to improve latency and does not enforce IP allowlisting or WAF protections.

Exam trap

The trap here is confusing VPC firewall rules with Cloud Armor; candidates might think network firewall rules can block SQL injection, but they operate at lower layers and cannot inspect HTTP payloads. Also, some might forget the default deny rule, assuming the allow rule alone is sufficient.

698
MCQmedium

A developer has an App Engine Standard application ready to deploy. The app.yaml file is in the current working directory. Which command deploys the application?

A.gcloud app create --config=app.yaml
B.gcloud app deploy
C.gcloud appengine deploy app.yaml
D.gcloud run deploy --platform=appengine
AnswerB

gcloud app deploy is the correct command to deploy an App Engine Standard application. It reads the app.yaml from the current directory, packages the source code, uploads it, and creates or updates the service version while routing traffic to the new deployment.

Why this answer

The `gcloud app deploy` command is the correct way to deploy an App Engine Standard application when the `app.yaml` file is present in the current working directory. This command automatically detects the configuration file and uploads the application code to the specified App Engine service, handling the deployment process including staging, versioning, and traffic migration.

Exam trap

The trap here is that candidates confuse `gcloud app deploy` with `gcloud app create` or Cloud Run commands, or they misremember the exact subcommand syntax, leading them to choose invalid options like `gcloud appengine deploy`.

How to eliminate wrong answers

Option A is wrong because `gcloud app create` is used to create a new App Engine application (project) in a region, not to deploy code; it does not accept a `--config` flag for deployment. Option C is wrong because `gcloud appengine deploy` is not a valid gcloud command; the correct subcommand is `gcloud app deploy`, and the syntax `app.yaml` as an argument is not required when it is in the current directory. Option D is wrong because `gcloud run deploy` is used for Cloud Run services, not App Engine; the `--platform=appengine` flag is invalid as Cloud Run does not support that platform.

699
MCQhard

A company wants to deploy a globally distributed, multi-tier application with strict low-latency communication between the web and database tiers. The database must be fully managed and able to survive a regional outage with automatic failover. Which combination is most appropriate?

A.Cloud Run (multi-region) and Cloud SQL (cross-region replica with manual failover)
B.Compute Engine regional managed instance group and Cloud SQL (regional with automatic failover)
C.App Engine (standard) and Cloud Datastore (multi-region)
D.Cloud Run (multi-region) and Cloud Spanner (multi-region)
AnswerD

Cloud Run (multi-region) and Cloud Spanner (multi-region) together provide a truly global, automatically failing-over architecture. Spanner uses synchronous replication across multiple regions with the Paxos protocol, providing both strong consistency and automatic failover without manual intervention, unlike Cloud SQL. Cloud Run multi-region services automatically route traffic to the nearest healthy region, and when paired with Spanner's multi-region configuration, the entire application stack becomes resilient to both zonal and regional outages. This combination satisfies the low-latency, global distribution, and relational requirements of the multi-tier application.

Why this answer

Cloud Run (multi-region) provides a serverless compute layer that can automatically route traffic across regions for low-latency access, while Cloud Spanner (multi-region) offers a fully managed, globally distributed relational database with synchronous replication and automatic failover, ensuring strong consistency and regional outage survival without manual intervention. This combination meets the strict low-latency communication and automatic failover requirements for a multi-tier application.

Exam trap

Google Cloud often tests the distinction between zonal and regional resilience, where candidates mistakenly assume that Cloud SQL's regional automatic failover (which covers zonal outages) is sufficient for a regional outage, but the question explicitly requires survival of a regional outage, which demands a multi-region database like Spanner.

How to eliminate wrong answers

Option A is wrong because Cloud SQL cross-region replica requires manual failover, not automatic, and does not provide the synchronous replication needed for strict low-latency communication across regions. Option B is wrong because Cloud SQL regional with automatic failover only survives a zonal outage, not a regional outage, and the compute layer (regional MIG) is also zonal, not multi-region. Option C is wrong because Cloud Datastore (multi-region) is a NoSQL database that does not support the relational database requirements implied by a multi-tier application with a database tier, and App Engine standard has limitations on runtime and scaling that may not suit low-latency inter-tier communication.

700
MCQmedium

A DevOps team needs to grant a CI/CD service account the ability to create secrets in Secret Manager. Which role should be assigned?

A.roles/secretmanager.admin
B.roles/secretmanager.secretCreator
C.roles/secretmanager.secretAccessor
D.roles/secretmanager.viewer
AnswerA

The `roles/secretmanager.admin` role includes the `secretmanager.secrets.create` permission required for adding a new secret via the Cloud Console, gcloud CLI, or Secret Manager API. It also grants full management of versions, IAM policies, and deletion, so it is the predefined role that reliably supports all CI/CD operations that need to provision and rotate secrets.

Why this answer

The roles/secretmanager.admin role grants full control, including creating secrets. roles/secretmanager.secretCreator does not exist; the admin role includes create permission.

701
MCQmedium

A team wants to allow inbound HTTPS traffic (TCP port 443) from the internet to instances tagged 'web-server', while blocking all other inbound traffic. What firewall configuration achieves this?

A.An ingress allow rule for port 443 from 0.0.0.0/0 targeting the 'web-server' tag, relying on the implied deny for other traffic
B.An ingress allow rule for port 443 and a separate egress deny rule for all other ports
C.An ingress deny rule for all ports from 0.0.0.0/0, plus an ingress allow for port 443 with lower priority
D.A Cloud Armor policy allowing only HTTPS requests to port 443
AnswerA

VPC firewall rules are stateful and evaluated in priority order, with an implicit deny-all ingress rule at priority 65535 that blocks any inbound traffic not explicitly allowed. An allow rule for tcp:443 from 0.0.0.0/0 targeting the 'web-server' tag explicitly permits HTTPS while all other ports remain implicitly denied, so no explicit deny rule is necessary. This single rule is sufficient because GCP's firewall model defaults to deny when no match exists.

Why this answer

Google Cloud VPC firewall rules are stateful and have an implicit deny for all traffic that is not explicitly allowed. An ingress allow rule for TCP port 443 from 0.0.0.0/0 applied to instances with the 'web-server' tag permits inbound HTTPS traffic, and the implicit deny blocks all other inbound traffic without needing additional rules.

Exam trap

Google Cloud often tests the misconception that you need explicit deny rules or that egress rules affect inbound traffic, but the key trap here is that candidates may think they need to add a deny rule for other ports, not realizing the implicit deny already blocks everything not allowed.

How to eliminate wrong answers

Option B is wrong because egress deny rules are not needed for inbound traffic control; the implicit deny already blocks all other inbound traffic, and adding an egress deny rule is irrelevant and could interfere with outbound responses. Option C is wrong because an ingress deny rule for all ports from 0.0.0.0/0 would block the HTTPS traffic even if a lower-priority allow rule exists, as deny rules take precedence over allow rules in Google Cloud VPC firewall evaluation. Option D is wrong because Cloud Armor is a web application firewall (WAF) that operates at the HTTP/HTTPS layer, not a VPC firewall rule; it cannot replace the network-level firewall rule required to allow inbound traffic to the instances.

702
MCQeasy

You need to check the CPU and memory utilization of all pods running in the `production` namespace. Which command provides this information?

A.`kubectl describe pods -n production`
B.`kubectl top pods -n production`
C.`kubectl get pods -n production -o wide`
D.`kubectl logs -n production --all-pods`
AnswerB

kubectl top pods -n production is the correct way to inspect actual resource consumption because it directly queries the metrics-server, which aggregates per-pod CPU and memory usage from each node's kubelet and cAdvisor. The command renders a table with columns for CPU (cores) and memory (MiB) along with the container breakdown, filtered to the production namespace. It provides a near-real-time snapshot of utilization, not just configured requests or limits, and is the standard CLI tool for verifying which pods are consuming the most resources.

Why this answer

The `kubectl top pods` command retrieves real-time CPU and memory utilization metrics from the metrics server for pods in a specified namespace. This is the correct tool for monitoring resource usage, as it directly queries the resource metrics API.

Exam trap

Google Cloud often tests the distinction between commands that show pod status/configuration (`describe`, `get`) versus those that show live resource metrics (`top`), leading candidates to confuse descriptive output with performance data.

How to eliminate wrong answers

Option A is wrong because `kubectl describe pods` shows configuration details, events, and status, but not real-time CPU or memory utilization metrics. Option C is wrong because `kubectl get pods -o wide` displays pod IPs and node assignments, not resource utilization data. Option D is wrong because `kubectl logs` retrieves container logs for debugging, not CPU or memory metrics.

703
MCQmedium

A security analyst needs to retrieve all Cloud Logging entries with severity ERROR or higher across all resource types in the current project. Which log query correctly filters these entries?

A.severity >= ERROR AND timestamp > now() - 24h
B.severity="ERROR" AND resource.type="gce_instance"
C.severity >= "ERROR"
D.logName="projects/my-project/logs/stderr" AND severity > "WARNING"
AnswerC

Using `severity >= "ERROR"` correctly matches all log entries with severity level ERROR or higher (CRITICAL, ALERT, EMERGENCY) across all resource types, which is the intended scope. The time range is not part of the filter; you set the range (e.g., last 24 hours) via the time picker in the Cloud Console, which is a best practice. This filter is precise and avoids unnecessary restrictions on log streams or resource types.

Why this answer

Cloud Logging's query language supports comparison operators like `>=` for severity levels, where `ERROR` is a recognized severity level. The query `severity >= "ERROR"` retrieves all entries with severity ERROR, CRITICAL, ALERT, or EMERGENCY, as these are considered higher severity than ERROR. This matches the requirement to filter for severity ERROR or higher across all resource types without restricting the time range or resource type.

Exam trap

Google Cloud often tests the nuance that severity values must be quoted strings and that comparison operators like `>=` work on the underlying numeric severity levels, not on string lexicographic order, leading candidates to mistakenly use unquoted values or incorrect operators like `>`.

How to eliminate wrong answers

Option A is wrong because `severity >= ERROR` uses an unquoted severity value, which is invalid syntax; severity values must be quoted strings (e.g., `"ERROR"`). Option B is wrong because it restricts results to only `gce_instance` resource type, while the requirement is to retrieve entries across all resource types. Option D is wrong because it filters by a specific log name (`stderr`) and uses `severity > "WARNING"`, which excludes ERROR-level entries (since ERROR is not greater than WARNING in the severity hierarchy; ERROR is higher than WARNING, but the operator `>` is not standard for severity comparison in Cloud Logging, and the query also incorrectly limits to a single log stream).

704
MCQmedium

A team wants to enable Compute Engine API in their project using gcloud. Which command should they run?

A.gcloud compute enable api
B.gcloud services list --enabled
C.gcloud api enable compute
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 a project. The gcloud services enable command accepts the fully qualified service name (compute.googleapis.com) and provisions access for the project, making it available for use with gcloud compute commands, API calls, and console operations. This is the standard, documented way to turn on a Google API in a project.

Why this answer

The correct gcloud syntax for enabling an API is 'gcloud services enable <service-name>', and the Compute Engine API's service name is compute.googleapis.com. So 'gcloud services enable compute.googleapis.com' is the only syntactically valid command that enables the Compute Engine API.

Exam trap

The trap is guessing at command syntax — candidates pick plausible-looking commands like 'gcloud compute enable api' instead of remembering that API management lives under 'gcloud services' with the fully qualified service name.

How to eliminate wrong answers

Option A is wrong because 'gcloud compute enable api' is not a valid gcloud command — 'compute' is a command group for managing instances, not for enabling APIs. Option B is wrong because 'gcloud services list --enabled' only lists currently enabled services; it does not enable anything. Option C is wrong because 'gcloud api enable compute' uses the wrong command group ('api' is not a gcloud top-level group) and the wrong service identifier format.

705
MCQeasy

A developer needs to create a Cloud Storage bucket that stores data for only 30 days and then automatically deletes it. Which feature should be used to achieve this?

A.Object versioning
B.Requester pays
C.Object lifecycle management
D.Bucket lock
AnswerC

Object Lifecycle Management is a native Cloud Storage feature that lets you define rules to automatically delete or transition objects based on conditions like age. A rule with action 'Delete' and condition 'Age: 30 days' will remove objects that are at least 30 days old. This directly satisfies the developer's requirement for scheduled deletion, making it the correct choice.

Why this answer

Object Lifecycle Management lets you define rules that automatically transition or delete objects based on age, creation date, or other conditions. Setting a lifecycle rule with an Age condition of 30 days and a Delete action causes Cloud Storage to automatically remove objects after 30 days, exactly matching the requirement.

Exam trap

ACE often tests the confusion between Bucket Lock (prevents deletion for retention) and Object Lifecycle Management (automates deletion), catching candidates who pick the retention feature when deletion is required.

How to eliminate wrong answers

Option A is wrong because Object Versioning keeps multiple versions of an object to protect against accidental deletion or overwrite — it does not delete data and would actually increase storage usage. Option B is wrong because Requester Pays shifts the cost of data access and egress to the requester; it has nothing to do with automatic deletion. Option D is wrong because Bucket Lock enforces a retention policy that prevents deletion for a specified period — it is the opposite of automatic deletion and is used for compliance (e.g., WORM).

706
Drag & Dropmedium

Order the steps to configure a Cloud Load Balancer (HTTP/S) in front of a Compute Engine instance group.

Drag or tap steps into the slots.

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

Why this order

Instance group and health check must exist before backend service; then frontend components.

707
MCQmedium

A security engineer needs to ensure that all VMs in a subnet use Private Google Access to reach Google APIs without external IP addresses. What must be enabled?

A.A firewall rule allowing egress to 0.0.0.0/0.
B.VPC Flow Logs on the subnet.
C.Cloud NAT on the VPC.
D.Private Google Access on the subnet.
AnswerD

Private Google Access on the subnet is the correct configuration to enable VMs without external IPs to reach Google APIs and services. When enabled, the subnet's VMs can send traffic to Google's public API IPs, which are then routed internally through the VPC's default route and into Google's network without ever needing an external IP. This is a subnet-level Boolean flag that must be turned on for each subnet where you want the capability; it applies to the entire subnet and works with the standard default route. Enabling this is the direct, documented mechanism that satisfies the security engineer's requirement.

Why this answer

Private Google Access allows VMs without external IP addresses to reach Google APIs and services using internal IP addresses. Enabling it on the subnet is the correct configuration to meet the requirement.

Exam trap

ACE often tests the confusion between Private Google Access and Cloud NAT; candidates may think Cloud NAT is needed for Google APIs, but Private Google Access is the correct feature for internal access to Google services.

How to eliminate wrong answers

Option A is wrong because a firewall rule allowing egress to 0.0.0.0/0 does not enable Private Google Access; it only permits outbound traffic, but without external IPs, VMs cannot reach Google APIs unless Private Google Access is enabled. Option B is wrong because VPC Flow Logs only capture network traffic for monitoring, not enable access. Option C is wrong because Cloud NAT provides outbound internet access for VMs without external IPs, but it does not specifically enable access to Google APIs via internal addresses; Private Google Access is the dedicated feature for that.

708
MCQhard

A company uses Cloud DNS for internal DNS resolution. They recently added a new VPC and need to ensure that instances in this VPC can resolve private DNS names that are hosted in another project. What must be configured?

A.Use Cloud DNS inbound server policy to forward queries to the other VPC.
B.Export the private zone as a public zone and create a delegation.
C.Set up a DNS peering zone between the new VPC and the VPC that hosts the private zone.
D.Create a Private DNS zone in the new project with forwarding to the on-premises DNS.
AnswerC

Cloud DNS peering is the intended solution: you configure a DNS peering zone in the new VPC that targets the source VPC's private zone, and the new VPC's resolver forwards queries for that zone to the source VPC's Cloud DNS. This creates a unidirectional resolution path, so if you need bidirectional resolution you must create a separate peering zone in the opposite direction. The peering works even without VPC peering because the query is handled by the Cloud DNS infrastructure, not by network routing. It preserves the private zone's visibility scope and requires only the appropriate DNS peering IAM permissions.

Why this answer

Cloud DNS peering allows a VPC in one project to resolve private DNS names hosted in a private zone in another project without requiring the zones to be shared or exported. DNS peering establishes a direct query path between the peered VPCs, enabling the new VPC to resolve names in the private zone as if they were local, while the zone remains private and managed in its original project.

Exam trap

The trap here is that candidates confuse DNS peering with inbound/outbound server policies, mistakenly thinking that forwarding policies are needed for inter-VPC resolution, when in fact peering directly connects DNS namespaces without requiring external forwarding.

How to eliminate wrong answers

Option A is wrong because Cloud DNS inbound server policy is used to forward DNS queries from on-premises networks to Cloud DNS, not to forward queries between VPCs in different projects. Option B is wrong because exporting a private zone as a public zone would expose internal DNS records to the internet, violating security requirements and not providing a secure resolution path for internal instances. Option D is wrong because creating a new Private DNS zone with forwarding to on-premises DNS does not enable resolution of private DNS names hosted in another project; it would only forward queries to an on-premises resolver, not to the target private zone.

709
MCQhard

An organization has a requirement that all Compute Engine instances must be able to access only a specific set of Google Cloud APIs, and no others. The security team wants to enforce this using IAM and access scopes. Which combination should they use?

A.Set the instance's access scopes to the specific APIs needed and grant the service account only the necessary IAM roles.
B.Disable all access scopes and rely solely on IAM roles to control API access.
C.Set the instance's access scopes to cloud-platform and grant the service account the Editor role.
D.Use the default access scopes and grant the service account the Viewer role.
AnswerA

Access scopes define the maximum set of APIs an instance can call, while IAM roles determine the actual permissions. By setting scopes to only the required APIs and granting minimal IAM roles, the instance is restricted to exactly the needed APIs. This enforces defense in depth and meets the requirement of limiting access to a specific set.

Why this answer

Access scopes and IAM roles together control what APIs an instance can access. Scopes set the maximum allowed APIs, while IAM roles grant specific permissions. To restrict an instance to a specific set of APIs, set the scopes to only those APIs and grant the service account only the IAM roles needed for those APIs.

This layered approach ensures least privilege and meets the security requirement.

Exam trap

The trap here is thinking that IAM roles alone control API access, or that broad scopes like cloud-platform are necessary for functionality.

710
MCQhard

A company has multiple firewall rules. Rule A (priority 1000) allows TCP 80 from 0.0.0.0/0. Rule B (priority 500) denies TCP 80 from 10.0.0.0/8. An instance with IP 10.0.0.1 tries to connect to TCP 80. What happens?

A.The result depends on the order of creation.
B.Traffic is allowed because Rule A allows all sources.
C.Both rules are applied and traffic is allowed.
D.Traffic is denied because Rule B has higher priority.
AnswerD

Rule B has a priority of 500, which is numerically lower than Rule A's priority of 1000, so GCP evaluates Rule B first. Because Rule B's action is to deny and the traffic matches its conditions, that denial is the final decision. Rule A is not evaluated, so the traffic is denied as expected.

Why this answer

GCP firewall rules are evaluated by priority, where a lower number means higher priority; Rule B has priority 500, which is lower than Rule A's 1000, so Rule B is evaluated first. Because Rule B denies TCP 80 from 10.0.0.0/8 and the instance's IP 10.0.0.1 falls in that range, the traffic is denied. The matching deny rule wins before the allow rule is ever considered.

Exam trap

ACE often tests the inverted priority semantics of GCP firewall rules, so candidates who assume a higher number means higher priority conclude that Rule A allows the traffic.

How to eliminate wrong answers

Option A is wrong because GCP firewall evaluation is deterministic based on priority, not creation order. Option B is wrong because Rule A's allow is overridden by the higher-priority deny in Rule B for this source IP. Option C is wrong because GCP does not apply both rules and allow; the first matching rule (by priority) determines the outcome, and here it is a deny.

711
Drag & Dropmedium

Order the steps to set up a Cloud IAM policy that grants a user the 'roles/compute.admin' role on a specific project.

Drag or tap steps into the slots.

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

Why this order

The correct sequence is: first identify the user and project, then grant the role using 'gcloud projects add-iam-policy-binding', followed by verification with 'get-iam-policy', and finally test access. This ensures the policy is applied correctly and can be validated.

712
Multi-Selectmedium

A company is using Cloud Identity and wants to grant a group of auditors read-only access to all resources in a project, but they must not be able to modify any IAM policies. Which two roles should be granted to the group? (Choose two.)

Select 2 answers
A.roles/editor
B.roles/viewer
C.roles/iam.organizationRoleAdmin
D.roles/resourcemanager.projectIamAdmin
E.roles/iam.securityReviewer
AnswersB, E

The Viewer role provides read-only access to all resources within a project, excluding sensitive data and IAM policies. It allows auditors to view resources without the ability to modify them. This role is appropriate for granting broad read access while preventing changes, and it does not include permissions to alter IAM policies.

Why this answer

The Viewer role provides read-only access to resources, while the Security Reviewer role allows viewing IAM policies without modification. Together, they enable auditors to inspect all resources and access controls without the ability to make changes. This combination adheres to the principle of least privilege and meets the requirement of read-only access with no IAM policy modifications.

Exam trap

The trap here is assuming that roles with 'viewer' or 'reviewer' in the name might include write permissions, or that broader roles like Editor are needed for comprehensive access.

713
MCQmedium

You need to create a log-based metric that counts the number of errors in your application logs. What must you do first in Cloud Logging?

A.Create an alerting policy with a condition
B.Create a log sink that exports logs to BigQuery
C.Define a filter that matches the error logs
D.Install the Logging agent on your VMs
AnswerC

The correct approach is to define a filter expression in Cloud Logging that matches the error logs (e.g., severity=ERROR or specific text), then use that filter to create a logs-based metric. The metric counter increments for every matching log entry, and the filter becomes the metric's definition, allowing you to alert on the count over time.

Why this answer

In Cloud Logging, a log-based metric is based on a filter. You define the filter using the logging query language to match the logs you want to count, then create the metric from that filter.

714
MCQmedium

A global web application needs HTTPS traffic routed to backend services in multiple regions, directing each user to the nearest healthy endpoint. Which load balancer type should be used?

A.Regional external Network Load Balancer
B.Global external Application Load Balancer
C.Regional internal Application Load Balancer
D.Regional internal TCP/UDP load balancer
AnswerB

The Global external Application Load Load Balancer is built on Google's global anycast infrastructure, using a single global IP address that accepts HTTPS traffic at Google's edge points around the world. It then routes requests over Google's private backbone to the nearest healthy backend, regardless of the backend's region, enabling a true global load-balancing. This makes it the only option that satisfies the dual requirements of HTTP/HTTPS content delivery and multi-region global routing.

Why this answer

The Global external Application Load Balancer (ALB) is the correct choice because it provides cross-regional load balancing for HTTPS traffic, routing each user to the nearest healthy backend based on anycast IP and client location. This is essential for a global web application requiring low latency and high availability across multiple regions.

Exam trap

Google Cloud often tests the distinction between global and regional load balancers, and the trap here is that candidates may confuse a regional external Network Load Balancer (which handles TCP/UDP traffic but not HTTPS) with a global Application Load Balancer, overlooking the requirement for HTTPS termination and cross-regional routing.

How to eliminate wrong answers

Option A is wrong because a Regional external Network Load Balancer operates at Layer 4 (TCP/UDP) and cannot terminate HTTPS or perform content-based routing, and it is confined to a single region, not global. Option C is wrong because a Regional internal Application Load Balancer is designed for internal traffic within a VPC and cannot handle external HTTPS traffic or route globally. Option D is wrong because a Regional internal TCP/UDP load balancer is a Layer 4 internal load balancer that does not support HTTPS termination, content-based routing, or global anycast routing.

715
MCQhard

Your Cloud Run service is receiving a sudden spike in traffic. You want to ensure that the number of concurrent requests per container instance does not exceed 10 to avoid overloading the backend. Which configuration should you set?

A.Set --timeout to 10 seconds
B.Set --concurrency to 10
C.Set --max-instances to 10
D.Set --cpu-throttling to true
AnswerB

Correct: --concurrency controls the maximum number of simultaneous requests that each container instance can process at the same time. With a spike, setting it to 10 means an instance will accept only 10 in-flight requests and Cloud Run will automatically spin up additional instances to handle the remaining traffic, preventing any single instance from being overwhelmed. It directly manages per-instance load rather than total capacity or request duration.

Why this answer

In Google Cloud Run, the --concurrency flag controls the maximum number of simultaneous requests that a single container instance can handle. Setting --concurrency to 10 ensures that no container instance processes more than 10 concurrent requests, which directly addresses the requirement to prevent backend overload. This is the precise configuration parameter designed for this purpose.

Exam trap

ACE often tests the confusion between concurrency (requests per instance) and max-instances (total instances), and candidates frequently pick --max-instances when the question asks about per-instance request limits.

How to eliminate wrong answers

Option A is wrong because --timeout controls how long a request can run before being terminated (default 300 seconds), not how many concurrent requests a container handles. Option C is wrong because --max-instances limits the total number of container instances that Cloud Run can scale to, which controls horizontal scaling, not per-instance concurrency. Option D is wrong because --cpu-throttling is not a valid Cloud Run configuration flag; CPU allocation in Cloud Run is managed through --cpu and --memory settings, and throttling behavior is controlled by whether CPU is always allocated or only during request processing.

716
MCQmedium

Your team manages a Compute Engine instance group that runs a stateless web application. You need to ensure that instances are automatically repaired if they fail health checks, and that the group scales based on CPU utilization. Which type of instance group should you use?

A.Regional managed instance group
B.Instance group with autoscaling only
C.Unmanaged instance group
D.Managed instance group
AnswerD

A managed instance group (MIG) automatically creates and manages instances based on an instance template. It supports autohealing by recreating instances that fail health checks, and it can autoscale based on CPU utilization or other metrics. This directly meets the requirement for automatic repair and scaling, making it the correct choice for the stateless web application.

Why this answer

A managed instance group (MIG) is designed to automate the lifecycle of identical instances. It uses an instance template to create instances and can be configured with autohealing based on health checks, as well as autoscaling based on metrics like CPU utilization. This makes it the ideal choice for a stateless web application that requires automatic repair and scaling.

Exam trap

The trap here is assuming that any instance group can autoheal, when in fact only managed instance groups provide that capability.

717
MCQhard

A company runs a global web application with a Cloud SQL (MySQL) database in the us-east1 region. To improve read performance for users in Europe, they want to offload read traffic to a replica in europe-west1. The replica must be kept in sync with the primary within seconds. Which Cloud SQL configuration should be used?

A.Enable automatic failover to a replica in europe-west1
B.Create a cross-region read replica in europe-west1
C.Configure Cloud SQL for multi-region deployment
D.Create an external replica in europe-west1
AnswerB

Creating a cross-region read replica in europe-west1 is correct because Cloud SQL supports read-only replicas in a different region, using asynchronous replication to serve queries close to the users. This reduces read latency for European users while keeping writes on the primary instance. The replica can also be manually promoted to a standalone primary for disaster recovery, but it does not require an HA configuration or additional on-premises infrastructure.

Why this answer

A cross-region read replica in europe-west1 is the correct configuration because it creates a replica of the primary Cloud SQL instance in a different region, allowing read traffic to be served locally in Europe. Cloud SQL supports cross-region read replicas for MySQL, which are kept in sync with the primary via asynchronous replication, typically within seconds. This improves read performance for European users by reducing latency.

Exam trap

The trap is confusing high-availability failover replicas with read replicas for performance; failover replicas are for redundancy and do not serve read traffic, while read replicas are specifically for scaling reads.

How to eliminate wrong answers

Option A is wrong because automatic failover to a replica in europe-west1 is for high availability, not for offloading read traffic; failover replicas are typically in the same region or configured for disaster recovery, and they do not serve reads unless promoted. Option C is wrong because Cloud SQL does not support multi-region deployment in the sense of a single instance spanning multiple regions; it offers regional instances with optional cross-region replicas. Option D is wrong because an external replica is for replicating from an external MySQL server, not for creating a replica of a Cloud SQL instance in another region.

718
MCQeasy

What is the purpose of creating a Cloud NAT gateway?

A.To enable private instances to reach the internet for updates and patches.
B.To allow VPN connections to on-premises networks.
C.To provide a static IP address for inbound traffic.
D.To provide DNS resolution for VPC networks.
AnswerA

Cloud NAT lets instances without external IP addresses initiate outbound connections to the internet for updates and patches, while remaining unreachable from inbound internet traffic. This satisfies the requirement for private instances to obtain updates without exposing them publicly.

Why this answer

Cloud NAT allows instances without external IP addresses to access the internet for outbound connections, while preventing inbound connections from the internet.

719
MCQmedium

An engineer needs to enable autoscaling on an existing node pool in a GKE cluster. Which command should they use?

A.gcloud compute instance-groups set-autoscaling
B.kubectl autoscale node-pool
C.gcloud container clusters update
D.gcloud container node-pools update --enable-autoscaling
AnswerD

This is the correct command because GKE exposes node-pool-level autoscaling through the container API. Running `gcloud container node-pools update NODE_POOL --cluster=CLUSTER --enable-autoscaling --min-nodes=MIN --max-nodes=MAX` turns on the cluster autoscaler for that specific node pool, allowing GKE to add or remove nodes within the configured limits based on resource demand. The command can also be used later to adjust min/max limits or disable autoscaling on existing node pools.

Why this answer

'gcloud container node-pools update' with '--enable-autoscaling' enables autoscaling. 'gcloud container clusters update' updates cluster-level settings, not node pools. 'kubectl autoscale' is for workloads, not node pools. 'gcloud compute instance-groups' is not used for GKE node pools.

720
MCQmedium

You want to enable the Kubernetes Engine API for your project using the command line. Which gcloud command should you use?

A.gcloud services enable container.googleapis.com
B.gcloud container clusters create my-cluster
C.gcloud config set project my-project
D.gcloud auth login
AnswerA

The correct command to enable the Kubernetes Engine API is `gcloud services enable container.googleapis.com`. This calls the Service Usage API to activate the service in the current Google Cloud project, making it possible to later create and manage GKE clusters. Enabling the API is a prerequisite that also links the service to the project's billing account; until this is done, any GKE resource creation will fail with an error indicating the API is disabled.

Why this answer

The `gcloud services enable container.googleapis.com` command enables the Kubernetes Engine API for the active project. Service enablement is done through the Service Usage API, and `gcloud services enable` is the correct CLI wrapper. Creating a cluster or setting a project does not enable the API.

Exam trap

ACE often tests whether candidates know that creating a resource does not implicitly enable its API; the trap is picking the cluster creation command when the question explicitly asks to enable the API.

How to eliminate wrong answers

Option B is wrong because `gcloud container clusters create my-cluster` attempts to create a GKE cluster and will fail if the API is not already enabled; it does not enable the API. Option C is wrong because `gcloud config set project my-project` only changes the active project property and does not enable any API. Option D is wrong because `gcloud auth login` only authenticates the user and has no effect on API enablement.

721
Multi-Selectmedium

A company runs a web application on Compute Engine instances behind a load balancer. They want to automatically scale the number of instances based on CPU utilization. Which two resources must they create? (Choose TWO.)

Select 2 answers
A.Cloud Storage bucket
B.Cloud SQL instance
C.Managed instance group (MIG) with autoscaling policy
D.Cloud Function
E.Instance template
AnswersC, E

A managed instance group with an autoscaling policy satisfies the CPU-based scaling requirement: the MIG maintains identical Compute Engine instances, while the autoscaling policy adds or removes instances when average CPU utilisation crosses the configured target. The load balancer then distributes traffic across the group's instances.

Why this answer

Option C is correct because a managed instance group (MIG) is the Compute Engine resource that actually performs autoscaling; you attach an autoscaling policy based on CPU utilization to the MIG, and it adds or removes VM instances to match the target utilization. Option E is correct because a MIG requires an instance template to define the machine type, boot disk image, network, and other configuration used when creating each new VM instance. Together, the instance template defines what to create and the MIG with an autoscaling policy defines how many to run and when to scale.

Options A, B, and D are not required: a Cloud Storage bucket, Cloud SQL instance, and Cloud Function are unrelated to Compute Engine horizontal autoscaling and are not prerequisites for scaling instances behind a load balancer based on CPU.

Exam trap

ACE often tests the components required for autoscaling; candidates may forget that both a MIG and an instance template are needed, or confuse them with other services like Cloud Functions.

722
MCQmedium

A team needs to give a third-party vendor read-only access to specific Cloud Storage objects for 48 hours. The vendor uses an AWS account (not a Google account). What is the most secure way to grant this temporary access?

A.Create a GCP service account for the vendor and share the JSON key file with 48-hour expiry
B.Generate a Signed URL for the specific objects with a 48-hour expiration
C.Use Workload Identity Federation with AWS as the identity provider for the vendor
D.Make the objects publicly readable and share the direct Cloud Storage URL
AnswerB

A signed URL is a time-limited, cryptographically authenticated URL that Cloud Storage generates for a specific object and HTTP method (e.g., GET). It is created by signing the object path, a validity window, and an expiration timestamp with a service account's private key. The vendor receives the URL, requires no GCP account or credentials, and access is automatically invalidated after the 48-hour expiry, making it the correct tool for temporary, controlled sharing.

Why this answer

A Signed URL provides time-bound, read-only access to specific Cloud Storage objects without requiring the vendor to have a Google account. The URL embeds authentication information and expires after 48 hours, ensuring temporary access while maintaining security by not exposing broader permissions or credentials.

Exam trap

Google Cloud often tests the misconception that sharing a service account key file is acceptable for temporary access, but the trap here is that Signed URLs are the only option that combines time-bound, object-specific, and credential-free access for external users without a Google account.

How to eliminate wrong answers

Option A is wrong because sharing a GCP service account JSON key file violates the principle of least privilege and creates a long-lived credential that could be leaked or misused; even with a 48-hour expiry, the key file itself is a static secret that must be securely transmitted and stored. Option C is wrong because Workload Identity Federation is designed for workloads running in AWS to impersonate a GCP service account, but it requires the vendor to configure an AWS IAM role and trust relationship, which is overly complex for simple read-only object access and does not inherently limit access to 48 hours without additional token expiration controls. Option D is wrong because making objects publicly readable exposes them to anyone on the internet, not just the vendor, and provides no time-bound access control, violating security best practices.

723
Drag & Dropmedium

Arrange the steps to set up a Cloud Function triggered by a Cloud Storage bucket event.

Drag or tap steps into the slots.

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

Why this order

The correct order ensures that the required infrastructure (bucket) and code are in place before deployment. The bucket must be created first so the trigger can reference it, then the function code is written, then the function is deployed with the bucket trigger, and finally a test upload verifies the function executes. Common mistakes include deploying before the bucket or code exist, or writing code after deployment.

724
MCQhard

An engineer created a VPC with a subnet in us-central1 and enabled Private Google Access on that subnet. Compute Engine instances in that subnet can reach Google APIs and services using internal IPs. However, the instances cannot reach external IP addresses on the internet. What should the engineer configure to allow internet access while minimizing cost and management overhead?

A.Create a Cloud NAT gateway using a Cloud Router
B.Disable Private Google Access and assign external IPs to the instances
C.Add a NAT instance (a Compute Engine VM configured as a NAT gateway)
D.Create a Cloud VPN tunnel to a third-party NAT service
AnswerA

Cloud NAT, configured through a Cloud Router, provides managed outbound internet connectivity to private Compute Engine instances without assigning them external IP addresses. It uses the Cloud Router to dynamically exchange routing information with the VPC network, allowing instances with internal IPs to initiate connections to the internet while remaining unreachable from outside. This is the recommended, highly available, and serverless solution because Cloud NAT automatically scales to handle thousands of instances and does not require manual patching or failover configuration.

Why this answer

Cloud NAT on a Cloud Router provides managed, outbound-only internet access for instances with internal IPs, without assigning external IPs or running a NAT VM. It integrates with the VPC and scales automatically, minimizing cost and operational overhead. Private Google Access can remain enabled alongside Cloud NAT.

Exam trap

The trap here is assuming that Private Google Access alone provides full internet access; it only covers Google APIs and services, so a separate NAT solution is required for general internet egress.

How to eliminate wrong answers

Option B is wrong because disabling Private Google Access and assigning external IPs reintroduces public exposure and management overhead, and external IPs are not required for NAT. Option C is wrong because a NAT instance is a self-managed VM that must be patched, scaled, and monitored, increasing cost and overhead. Option D is wrong because a Cloud VPN tunnel to a third-party NAT service adds unnecessary complexity, latency, and cost compared to native Cloud NAT.

725
MCQeasy

A developer wants to see the details of a specific GKE Pod including its events, container status, and resource requests/limits. Which kubectl command provides this?

A.kubectl get pod [POD_NAME] -o wide
B.kubectl describe pod [POD_NAME]
C.kubectl inspect pod [POD_NAME]
D.kubectl get pod [POD_NAME] -o json
AnswerB

kubectl describe pod is the correct diagnostic command because it produces a categorized, human-readable report: Pod conditions, init-container and container states (including last terminated reason and exit code), resource requests and limits, QoS class, probe configuration, tolerations, volumes, and a dedicated Events section. That Events section is usually the fastest way to identify why a Pod cannot start—for example, image pull failures, unschedulable nodes, or liveness probe failures—making it the go-to first step in troubleshooting.

Why this answer

B is correct because `kubectl describe pod` provides a comprehensive view of a pod, including its events (e.g., scheduling, pulling images), container status (e.g., waiting, running, terminated with reasons), and resource requests/limits (CPU and memory). This command aggregates detailed information from the Kubernetes API, making it the standard tool for debugging pod issues.

Exam trap

Google Cloud often tests the distinction between `get` and `describe`, where candidates mistakenly think `-o wide` or `-o json` provides the same event and status detail, but only `describe` automatically includes pod events and presents container status in a human-readable summary.

How to eliminate wrong answers

Option A is wrong because `kubectl get pod -o wide` only shows additional node and IP information, not events, container status details, or resource requests/limits. Option C is wrong because `kubectl inspect` is not a valid kubectl command; the correct verb for detailed inspection is `describe` or `get -o yaml/json`. Option D is wrong because `kubectl get pod -o json` outputs the raw JSON representation of the pod object, which includes resource requests/limits and container status but does not include pod events (which are a separate API resource) and is less human-readable than `describe`.

726
MCQhard

An organization uses Secret Manager to store database credentials. A new application runs on Compute Engine and needs to access a secret. The application uses the default compute engine service account. What is the most secure way to grant access to the secret?

A.Hardcode the secret in the application configuration file
B.Create a new service account with the secretAccessor role, create a key, and store it on the instance
C.Grant the roles/editor role to the default compute engine service account
D.Grant the roles/secretmanager.secretAccessor role to the compute engine default service account
AnswerD

Granting the roles/secretmanager.secretAccessor role to the Compute Engine default service account is the correct approach because it gives the instance's identity the minimum permission needed to access secret versions. The instance authenticates through the metadata server, so no long-lived keys are stored on the instance. This makes it the most secure and operationally simple method, and it aligns with Google's recommended practice of using IAM roles on service accounts rather than embedding credentials.

Why this answer

The most secure way is to grant the roles/secretmanager.secretAccessor role directly to the Compute Engine default service account, leveraging the instance's attached identity. This avoids long-lived credentials, uses IAM for least-privilege access, and lets the application call the Secret Manager API via the metadata server. No keys are stored on disk, and access is auditable.

Exam trap

The trap is choosing an option that creates a service account key or uses a broad role, when the exam-tested best practice is to grant the narrow secretAccessor role to the existing attached service account.

How to eliminate wrong answers

Option A is wrong because hardcoding secrets in configuration files exposes them in source control, logs, and instance images — a critical security anti-pattern. Option B is wrong because creating a service account key and storing it on the instance introduces a long-lived credential that can be exfiltrated; Google recommends avoiding SA keys in favor of attached service accounts. Option C is wrong because roles/editor is a broad basic role granting extensive permissions far beyond secret access, violating least privilege.

727
MCQeasy

An organization with multiple Google Cloud projects wants to centralize network administration by having a single VPC network that hosts shared services and allows project teams to create their own resources in separate projects that can connect to the shared VPC. Which Google Cloud feature should they use?

A.Cloud VPN
B.VPC Service Controls
C.VPC Network Peering
D.Shared VPC
AnswerD

Shared VPC lets a host project export its subnets to service projects, so teams create resources in their own projects while network administration stays centralised. This directly satisfies the stem's requirement for one shared network hosting common services, with per-project resources connecting to it.

Why this answer

Shared VPC allows an organization to centrally manage a host project's VPC network and share its subnets with other service projects. This enables project teams to create resources in their own projects while using the shared network, centralizing network administration. It is specifically designed for this multi-project connectivity scenario.

Exam trap

ACE often tests the distinction between Shared VPC and VPC Network Peering; candidates may confuse peering (which connects VPCs but doesn't centralize administration) with Shared VPC (which does).

How to eliminate wrong answers

Option A is wrong because Cloud VPN provides secure tunnels to on-premises or other clouds, not for sharing a VPC across projects. Option B is wrong because VPC Service Controls are for security perimeters around services, not for network sharing. Option C is wrong because VPC Network Peering connects separate VPC networks, but does not centralize administration; each VPC remains independently managed.

728
Drag & Dropmedium

Arrange the steps to create a Cloud SQL MySQL instance, configure a database, and connect using the Cloud SQL Proxy.

Drag or tap steps into the slots.

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

Why this order

The correct order is to first create the Cloud SQL instance, then configure a database (e.g., create a database and user), and finally connect using the Cloud SQL Proxy for secure access. Common mistakes include attempting to configure the database before instance creation or using the proxy before the database is ready.

729
MCQmedium

A startup's GCP project has a project ID of 'my-startup-prod' and a project number of '123456789012'. An API call requires the project number, not the project ID. How can the project number be retrieved quickly?

A.The project number is always the same as the last 12 digits of the project ID
B.Run `gcloud projects describe my-startup-prod` and look for the projectNumber field
C.Run `gcloud config get-value project-number`
D.The project number appears in the URL bar of the GCP Console — it's the number after /project/
AnswerB

This command, `gcloud projects describe my-startup-prod`, queries the Cloud Resource Manager API and returns the project's metadata, including its `projectNumber` field, which is the unique numeric identifier assigned by Google Cloud. Unlike other methods that may be ambiguous or incorrect, this approach works regardless of the project ID's format and is the documented way to retrieve a project number from the CLI. The output also shows the project ID, name, and lifecycle state for confirmation.

Why this answer

The `gcloud projects describe` command retrieves detailed metadata about a GCP project, including the `projectNumber` field, which is a unique numeric identifier assigned by Google Cloud. This is the standard method to quickly obtain the project number when only the project ID is known, as the project number is not derivable from the project ID.

Exam trap

The trap here is that candidates confuse the project ID with the project number, assuming they are interchangeable or derivable from each other, and may incorrectly think a simple `gcloud config` command or URL inspection is sufficient.

How to eliminate wrong answers

Option A is wrong because the project number is not derived from the project ID; it is a separate, immutable numeric identifier assigned at project creation, and the project ID can be any string of letters, digits, and hyphens. Option C is wrong because `gcloud config get-value project-number` is not a valid command; the correct command to get the current project's number would involve `gcloud projects describe` or `gcloud config get-value project`, which returns the project ID, not the number. Option D is wrong because while the project number may appear in the GCP Console URL (e.g., as a query parameter or path segment), it is not consistently displayed in the URL bar for all pages, and relying on the URL is not a reliable or quick method compared to using the CLI.

730
MCQmedium

A company wants to track costs by department and project. They have multiple GCP projects used by different teams. Which feature should they use to categorize costs?

A.Budgets and alerts
B.Labels
C.Billing export to BigQuery
D.Custom IAM roles
AnswerB

Labels are key-value pairs applied to GCP resources, letting you attribute spend to both department and project dimensions and filter billing reports accordingly. They satisfy the requirement to categorise costs across multiple projects, unlike billing accounts or folders, which cannot carry arbitrary cost-tracking metadata.

Why this answer

Labels are key-value pairs that can be attached to resources to organize and track costs by department or project. Budgets and alerts notify when spending exceeds thresholds but do not categorize costs. Billing export to BigQuery is for exporting billing data for analysis, not for direct categorization.

Custom IAM roles are for managing permissions, not cost tracking.

731
MCQeasy

A company's application currently runs on a single Compute Engine VM with a persistent disk. The application serves read-heavy traffic and the single VM is becoming a bottleneck. The application is stateless. Which change provides the most immediate horizontal scalability improvement?

A.Upgrade the existing VM to a larger machine type (vertical scaling).
B.Create a Managed Instance Group from the VM and configure autoscaling with a load balancer.
C.Add more persistent disks to the existing VM to handle more I/O.
D.Enable live migration on the existing VM so it can move between hosts.
AnswerB

A Managed Instance Group (MIG) built from the VM, combined with an HTTP(S) load balancer, delivers horizontal scaling by launching additional identical VM instances on demand. The autoscaler monitors metrics like CPU utilization or request rate and adjusts instance count, while the load balancer distributes traffic evenly and performs health checks. This approach is elastic, fault-tolerant, and the standard pattern for stateless, scalable web workloads.

Why this answer

Creating a Managed Instance Group (MIG) from the existing VM and configuring autoscaling with a load balancer directly addresses the read-heavy, stateless bottleneck by distributing traffic across multiple VM instances. This provides immediate horizontal scalability, as new instances are automatically provisioned or terminated based on load, without requiring any application changes.

Exam trap

The trap here is that candidates confuse vertical scaling (Option A) with horizontal scaling, or think that adding more disks (Option C) or enabling live migration (Option D) can solve a compute bottleneck, when only distributing the load across multiple instances (Option B) provides true horizontal scalability.

How to eliminate wrong answers

Option A is wrong because upgrading to a larger machine type (vertical scaling) increases the capacity of a single VM but does not eliminate the single point of failure or the bottleneck from a single instance; it also has an upper limit and does not provide horizontal scalability. Option C is wrong because adding more persistent disks to the existing VM increases I/O capacity but does not distribute the read traffic across multiple VMs, leaving the single VM as the bottleneck for CPU and network resources. Option D is wrong because enabling live migration allows the VM to move between hosts for maintenance without downtime, but it does not increase compute capacity or distribute traffic, so it offers no scalability improvement.

732
MCQhard

An engineer needs to give a data analyst access to run BigQuery queries but prevent them from viewing or modifying data in Cloud Storage. The analyst should be able to create new datasets. Which IAM role should the engineer assign at the project level?

A.roles/storage.objectViewer
B.roles/bigquery.dataEditor
C.roles/bigquery.dataOwner
D.roles/bigquery.user
AnswerB

roles/bigquery.dataEditor is the correct choice because it provides the necessary permissions for a data analyst to run queries, including bigquery.jobs.create to execute query jobs and bigquery.tables.getData to read table contents. It also allows creating and updating tables within datasets, striking the right balance between access and control. Unlike broader roles, it does not grant dataset-level deletion or permission management, aligning with the principle of least privilege for a typical analyst use case.

Why this answer

The role roles/bigquery.dataEditor allows creating datasets and querying data, but does not grant any Cloud Storage permissions.

733
MCQmedium

Your organization uses Cloud Storage for storing backups. You want to automatically delete backup objects that are older than 30 days to control costs. You also want objects between 7 and 30 days old to use Nearline storage class for lower cost. Which Cloud Storage feature manages both requirements in a single configuration?

A.Write a Cloud Function that runs daily, lists objects, and deletes or moves old ones.
B.Configure Object Lifecycle Management rules on the bucket with `SetStorageClass` and `Delete` actions.
C.Set a bucket-level retention policy of 30 days and manually change storage classes.
D.Use Cloud Scheduler to trigger `gsutil` commands that move and delete old objects.
AnswerB

Object Lifecycle Management (OLM) is the native, serverless solution for this exact scenario. You can define a rule with a `SetStorageClass` action to transition objects to Nearline 7 days after creation, and a separate `Delete` action to permanently remove them after 30 days. Both actions live in the same bucket's lifecycle configuration, so no custom code, scheduler, or manual intervention is needed, and Google Cloud executes the rules automatically.

Why this answer

Object Lifecycle Management rules in Cloud Storage allow you to define conditions (e.g., object age) and actions (e.g., SetStorageClass to Nearline, Delete) in a single configuration. This automates both the transition of objects aged 7–30 days to Nearline storage and the deletion of objects older than 30 days, without custom code or manual intervention.

Exam trap

Google Cloud often tests the misconception that custom code or external schedulers are required for automated object management, when in fact Cloud Storage's built-in lifecycle management can handle both storage class transitions and deletions in a single, cost-effective configuration.

How to eliminate wrong answers

Option A is wrong because writing a Cloud Function that runs daily to list, delete, or move objects introduces unnecessary complexity, potential execution failures, and additional costs; lifecycle rules achieve the same result natively without custom code. Option C is wrong because a bucket-level retention policy prevents object deletion or modification before the retention period ends, which conflicts with the requirement to delete objects older than 30 days, and manually changing storage classes does not automate the process. Option D is wrong because using Cloud Scheduler to trigger gsutil commands is a manual, brittle approach that requires maintaining scripts and handling errors, whereas lifecycle rules are a declarative, serverless feature built into Cloud Storage.

734
MCQeasy

You are designing an application that needs to process exactly once each message published to a topic, even if the consumer fails partway through and restarts. Which GCP service provides built-in exactly-once processing semantics with Pub/Sub?

A.Cloud Functions subscribed to the Pub/Sub topic with idempotent logic.
B.Dataflow with Pub/Sub as the source using the Beam SDK.
C.BigQuery Subscriptions connected directly to the Pub/Sub topic.
D.Cloud Run with a Pub/Sub push subscription and database deduplication table.
AnswerB

Dataflow's Beam runner leverages the Pub/Sub I/O source that checkpoints its read position and assigns each message a unique ID when it is pulled; on replay, the runner deduplicates message IDs so that the pipeline processes each message exactly once even if Pub/Sub redelivers. This is a built-in, distributed, and managed capability of Dataflow, enabling exactly-once semantics without custom application code. It also supports autoscaling and checkpointing with Apache Beam's stateful processing. Therefore, it is the correct choice for a managed exactly-once processing guarantee.

Why this answer

Dataflow with Pub/Sub as the source using the Beam SDK provides built-in exactly-once processing semantics because it leverages the Beam engine's checkpointing and the Pub/Sub source's snapshot-based deduplication. Dataflow tracks each message's unique ID and ensures that even if a worker fails and restarts, the message is not reprocessed, guaranteeing exactly-once delivery within the pipeline.

Exam trap

Google Cloud often tests the misconception that Pub/Sub itself provides exactly-once delivery, but Pub/Sub only guarantees at-least-once; the exactly-once semantics must be implemented by the consumer, and Dataflow is the only GCP service that offers this built-in for Pub/Sub sources.

How to eliminate wrong answers

Option A is wrong because Cloud Functions subscribed to Pub/Sub with idempotent logic relies on the developer to implement idempotency manually; Cloud Functions itself does not provide built-in exactly-once semantics, and Pub/Sub delivery is at-least-once by default. Option C is wrong because BigQuery Subscriptions deliver messages in near-real-time but do not guarantee exactly-once processing; they use at-least-once delivery and deduplication is handled by BigQuery's best-effort mechanisms, not by the subscription itself. Option D is wrong because Cloud Run with a Pub/Sub push subscription and a database deduplication table requires custom application logic to handle deduplication; Pub/Sub push subscriptions deliver messages at-least-once, and Cloud Run does not provide built-in exactly-once processing.

735
MCQeasy

You need to monitor the uptime of an external HTTPS endpoint that is critical to your application. Which Google Cloud service should you use to create an uptime check?

A.Cloud Monitoring
B.Cloud Debugger
C.Cloud Trace
D.Cloud Logging
AnswerA

Cloud Monitoring includes native uptime checks that actively send HTTPS GET requests to the external endpoint from multiple global locations, verifying that the service is reachable and that expected HTTP status codes are returned. You can set response-time thresholds and alerting policies on these checks to trigger notifications when the endpoint fails or becomes slow. This makes it the correct service for monitoring endpoint availability rather than merely analyzing its internal behavior.

Why this answer

Cloud Monitoring provides uptime checks that can monitor HTTP, HTTPS, and TCP endpoints from multiple locations.

736
MCQmedium

A Cloud SQL production instance experiences a spike in connections during business hours, causing 'too many connections' errors. The application uses 50 microservices each maintaining 10 connections. What is the recommended solution to reduce connection count without rewriting the application?

A.Increase the Cloud SQL instance's max_connections database flag to 10,000
B.Deploy a connection pooler (e.g., PgBouncer) between the microservices and Cloud SQL
C.Enable Cloud SQL HA — the standby will handle the connection overflow
D.Add a read replica — microservices can connect to the replica instead of the primary
AnswerB

A connection pooler like PgBouncer sits between the microservices and Cloud SQL, multiplexing many client connections over a small set of persistent database connections using transaction-level pooling. For example, thousands of microservice connections can be served by just tens of actual PostgreSQL connections, keeping the database well under max_connections and reducing per-connection memory overhead. This directly addresses the root cause of connection proliferation and is the correct fix because it lowers the true connection count Cloud SQL must manage.

Why this answer

Deploying a connection pooler like PgBouncer between the microservices and Cloud SQL allows many application connections to be multiplexed over a smaller number of actual database connections. This directly reduces the total connection count on the Cloud SQL instance without requiring any application code changes, as the pooler transparently manages the connection lifecycle and reuses idle connections.

Exam trap

Google Cloud often tests the misconception that increasing a resource limit (like max_connections) is a valid solution to connection overload, when in fact it masks the problem and can cause resource exhaustion, whereas connection pooling is the correct architectural fix.

How to eliminate wrong answers

Option A is wrong because increasing max_connections to 10,000 does not reduce the number of connections; it merely raises the limit, which can lead to memory exhaustion and degraded performance on the Cloud SQL instance, as each connection consumes memory and CPU overhead. Option C is wrong because Cloud SQL HA (high availability) uses a standby instance that does not accept connections for read/write traffic; it only takes over during failover and does not help with connection overflow during normal operations. Option D is wrong because adding a read replica does not reduce the connection count on the primary instance; microservices would still need to connect to the primary for writes, and read replicas have their own connection limits, so the underlying issue of too many connections is not addressed.

737
MCQmedium

You need to create a snapshot of a persistent disk attached to a running Compute Engine instance. The disk is used by a production database; you want minimal impact. What should you do?

A.Detach the disk, create the snapshot, then reattach.
B.Create the snapshot while the instance is running; snapshots are always consistent.
C.Use gcloud compute disks snapshot without stopping; data will be consistent.
D.Stop the instance, create the snapshot using gcloud compute disks snapshot, then restart the instance.
AnswerD

Stopping the instance is the correct approach because it triggers a clean guest OS shutdown, allowing filesystem caches to be flushed and applications to close files gracefully. After the instance is in the `TERMINATED` state, the persistent disk is quiescent, and running `gcloud compute disks snapshot` captures a point-in-time image that is both crash-consistent and application-consistent for most setups. Once the snapshot completes, you can restart the instance with `gcloud compute instances start` and resume operations with confidence that the snapshot reflects a known-good state.

Why this answer

Creating a snapshot of a disk in use is possible, but for data consistency, it's recommended to stop the instance or at least freeze the filesystem. However, the question says 'minimal impact', so the best practice is to stop the instance. But the correct answer reflects that snapshots can be taken from attached disks, but for database consistency, stop is recommended.

Let's choose the safer answer: stop the instance.

738
Multi-Selecteasy

A Cloud Architect needs to understand the GCP resource hierarchy to set up proper access control. Which three resources are part of the GCP resource hierarchy? (Choose THREE.)

Select 3 answers
A.Billing Account
B.Folder
C.Project
D.Organization
E.Cloud Identity
AnswersB, C, D

Folders are correct because they serve as intermediate grouping nodes within the resource hierarchy, sitting directly below an Organization and above Projects. They allow you to group teams, products, or departments and apply IAM policies and organization policies at that group level, which are inherited by all contained projects. Folders can also nest other folders, enabling multi-level administrative boundaries that align with corporate structure.

Why this answer

The GCP resource hierarchy is Organization → Folder → Project → Resources, so the three hierarchy nodes among the options are Organization (D), Folder (B), and Project (C). Organization (D) is the root node of the hierarchy and is tied to a Cloud Identity or Workspace domain, serving as the top-level container where organization-wide IAM policies and org policies are applied. Folder (B) sits between the organization and projects, allowing hierarchical grouping of projects so that IAM and org policies inherit down to everything beneath them.

Project (C) is the fundamental resource container that holds actual GCP services and resources (VMs, buckets, datasets) and is the level at which APIs are enabled and billing is linked. Billing Account (A) is not part of the resource hierarchy; it is a separate billing construct that can be linked to one or more projects but does not participate in IAM policy inheritance. Cloud Identity (E) is an identity management service/domain that underpins the organization node, not a node in the resource hierarchy itself.

Exam trap

ACE often tests the distinction between the resource hierarchy and other GCP constructs like Billing Accounts and Cloud Identity, causing candidates to incorrectly include them as part of the hierarchy.

739
MCQhard

An organization requires that all Compute Engine instances be created with a specific service account that has minimal permissions. They also want to prevent users from creating instances with a different service account. Which IAM policy should they implement?

A.Organization policy with constraint compute.disableUserServiceAccountCreation
B.IAM condition that restricts instances to only use the authorized service account
C.Custom role with permission compute.instances.setServiceAccount only for authorized users
D.Organization policy with constraint compute.setServiceAccount
AnswerD

The compute.setServiceAccount organization policy constraint lets administrators define a list of allowed service account emails that can be used when creating Compute Engine instances or changing an instance's service account. When a user attempts to create an instance with a service account outside this list, the request is denied by the policy enforcement point. This directly enforces the requirement that only the authorized service account is used, making it the correct answer.

Why this answer

The organization policy constraint `compute.setServiceAccount` is the correct choice because it allows administrators to restrict which service accounts can be used when creating Compute Engine instances. By setting this constraint to only permit a specific service account, users are prevented from launching instances with any other service account, ensuring minimal permissions are enforced at the organization level.

Exam trap

The trap here is that candidates confuse the organization policy constraint `compute.setServiceAccount` with the IAM permission `compute.instances.setServiceAccount`, thinking that restricting the permission is sufficient, when in fact the organization policy is required to block creation with unauthorized service accounts at the resource hierarchy level.

How to eliminate wrong answers

Option A is wrong because `compute.disableUserServiceAccountCreation` is not a valid organization policy constraint; the correct constraint name is `compute.setServiceAccount`. Option B is wrong because IAM conditions can restrict actions based on resource attributes but cannot globally enforce which service account is used at instance creation time across all users; they are applied per IAM policy binding, not as an organization-wide block. Option C is wrong because a custom role with `compute.instances.setServiceAccount` permission only controls who can change the service account on an existing instance, not prevent creation with a different service account; it does not enforce a specific service account at creation.

740
MCQmedium

Your GKE cluster nodes are running an older kernel version with a known vulnerability. You need to update all nodes to use the latest node image with the patched kernel without any downtime. The cluster has a Surge Upgrade configuration of `max-surge: 1, max-unavailable: 0`. What happens during the node upgrade?

A.GKE terminates all nodes simultaneously and creates new ones — brief downtime occurs.
B.GKE provisions one new node, drains one old node, deletes it, and repeats — zero downtime.
C.GKE upgrades nodes in-place by applying a kernel patch without rescheduling pods.
D.Two nodes are upgraded simultaneously (one being the surge node and one old node going offline).
AnswerB

This is the expected behavior for a GKE node pool upgrade configured with maxSurge: 1 and maxUnavailable: 0. GKE first provisions an extra node (the surge node) from the new node image, waits until it is Ready, then cordons and drains one old node, rescheduling its pods to the new node. Only after the old node is empty is it deleted, and the process repeats for each node — so no old node is taken offline before a replacement is available, yielding zero downtime.

Why this answer

The surge upgrade configuration `max-surge: 1, max-unavailable: 0` ensures that GKE first provisions one new node (the surge node) before draining and deleting an old node. This rolling update process maintains the desired capacity at all times, resulting in zero downtime for applications.

Exam trap

Google Cloud often tests the misconception that `max-surge` and `max-unavailable` control the number of nodes upgraded simultaneously, when in fact `max-surge` controls the extra nodes provisioned and `max-unavailable` controls how many nodes can be unavailable at any time, and candidates confuse this with parallel upgrades.

How to eliminate wrong answers

Option A is wrong because GKE does not terminate all nodes simultaneously; the surge configuration explicitly prevents that by keeping one extra node available during the upgrade. Option C is wrong because GKE does not perform in-place kernel patching on running nodes; it replaces nodes with new images via node pool upgrades. Option D is wrong because the surge upgrade does not take two nodes offline at once; only one old node is drained at a time while the surge node handles the workload, and `max-unavailable: 0` means no old node goes offline before the new one is ready.

741
Multi-Selecthard

You are troubleshooting a slow application that uses multiple microservices. You suspect a particular service is causing high latency. Which TWO Google Cloud tools should you use to identify the root cause? (Select 2)

Select 2 answers
A.Cloud Profiler
B.Cloud Logging
C.Cloud Monitoring
D.Cloud Trace
E.Cloud Debugger
AnswersC, D

Cloud Monitoring ingests service-level metrics such as request count, latency, and error rate from GKE, Compute Engine, and App Engine, and can display them in dashboards with percentile aggregations. You can create alerting policies and SLOs to detect when one service's latency breaches a threshold. This metric-centric view identifies which service is slow and when, but does not give the end-to-end span journey through each internal call — that is Cloud Trace's role.

Why this answer

Cloud Trace traces requests across services to pinpoint latency, and Cloud Monitoring can show metrics like request latency and error rates.

742
MCQeasy

Which command creates a Google-managed SSL certificate for the domain 'example.com'?

A.gcloud compute ssl-certificates create my-cert --domains example.com
B.gcloud compute addresses create my-cert --global
C.gcloud compute ssl-policies create my-policy
D.gcloud compute target-https-proxies create my-proxy --ssl-certificates my-cert
AnswerA

This command correctly creates a Google-managed SSL certificate for the domain 'example.com'. The --domains flag tells the Cloud API to request a managed certificate, which Google will automatically obtain and renew without requiring you to upload a private key. Note that for a global external load balancer, you should also include --global, but the essential syntax for a managed certificate is exactly this.

Why this answer

Google-managed certificates are created with 'gcloud compute ssl-certificates create' with the '--domains' flag. The other commands are for different purposes.

743
MCQhard

A developer created a service account with the roles/storage.admin role and wants to use it from a Compute Engine instance without downloading a key file. What is the best practice?

A.Download the service account key and store it on the instance's persistent disk.
B.Use gcloud auth activate-service-account on the instance with the service account email.
C.Attach the service account to the instance using the --service-account flag when creating the instance.
D.Store the service account email in an instance metadata and use gcloud commands.
AnswerC

Attaching the service account via the --service-account flag at instance creation is the correct approach because it binds the identity to the VM and makes credentials available through the metadata server. Code running on the instance can fetch OAuth 2.0 tokens from the metadata endpoint (http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token) and act on behalf of the service account. This avoids managing key files and ensures that IAM permissions are automatically applied to the instance.

Why this answer

The best practice is to attach the service account to the Compute Engine instance at creation time using the --service-account flag. This allows the instance to automatically obtain credentials via the metadata server, avoiding the need to download and manage a service account key file. Downloading keys should be avoided due to security risks.

744
MCQhard

A company has an e-commerce application deployed on Compute Engine instances in a managed instance group (MIG) behind an external HTTP load balancer. The application stores session data in an in-memory cache on each instance. Recently, the team noticed that users are being logged out unexpectedly and losing their shopping cart contents. The MIG is configured with autoscaling based on CPU utilization. The team suspects the issue is related to session persistence. They have considered the following options: A) Switch to an internal TCP/UDP load balancer with session affinity; B) Enable sticky sessions (session affinity) on the existing load balancer; C) Move session storage to a centralized service like Memorystore; D) Increase the instance size and disable autoscaling. Which solution permanently resolves the issue while maintaining scalability and fault tolerance?

A.Switch to an internal TCP/UDP load balancer with session affinity
B.Enable sticky sessions (session affinity) on the existing load balancer
C.Move session storage to a centralized service like Memorystore
D.Increase the instance size and disable autoscaling
AnswerC

Enabling sticky sessions (session affinity) on the existing load balancer forces all requests from a given user to be directed to the same backend instance. However, the session data is still stored in that instance's local memory, so the affinity is only as durable as the instance itself. When the instance is restarted for patching, fails a health check, or is removed during a scale-in event, the load balancer reroutes traffic to a different instance that has no copy of the original session, causing the user to lose their cart or login. Sticky sessions merely tie the client to a VM; they do not replicate or persist the session state across the instance lifecycle.

Why this answer

Storing session data in a centralized service like Memorystore (Redis) decouples session state from individual Compute Engine instances. This ensures that any instance in the managed instance group can serve any user request without losing session data, even as the MIG autoscales up or down. This approach permanently resolves the issue while maintaining scalability and fault tolerance, as Memorystore provides a highly available, in-memory data store that persists across instance lifecycle events.

Exam trap

The trap here is that candidates often think sticky sessions (session affinity) alone will fix session persistence, but they overlook that autoscaling and instance failures still cause data loss when sessions are stored locally—only a centralized external store like Memorystore provides true persistence and fault tolerance.

How to eliminate wrong answers

Option A is wrong because switching to an internal TCP/UDP load balancer would make the application inaccessible from the internet (external users), and session affinity alone does not solve the problem when instances are terminated or added by autoscaling—the session data is still lost if the instance goes down. Option B is wrong because increasing instance size and disabling autoscaling removes scalability and fault tolerance, and does not address the root cause: session data stored in local memory is lost on instance restart or termination. Option C is wrong because enabling sticky sessions (session affinity) on the existing load balancer only pins a user to a specific instance, but if that instance is terminated during autoscaling (scale-in) or fails, the session data is still lost; it does not provide a durable, shared session store.

745
MCQmedium

A startup builds a serverless REST API using Cloud Functions (2nd gen). Each function invocation runs for 200ms on average, processes 5 million requests per day, and uses 256 MB memory. Approximately how should they estimate monthly Cloud Functions costs?

A.Approximately $0 — all invocations fall within the free tier
B.Estimate based on invocation count, compute time (memory × duration), and networking costs beyond the free tier
C.Approximately the same as a continuously-running e2-medium VM — Cloud Functions and VMs are priced equivalently
D.Fixed monthly rate based on the number of deployed functions, not invocation count
AnswerB

Cloud Functions billing is consumption-based, charging for three dimensions: the number of invocations, compute time measured in GB-seconds (memory in GB multiplied by execution duration in seconds), and outbound network egress. The monthly free tier (2M invocations, 400K GB-seconds, and 5 GB network egress) is subtracted before per-unit rates apply. With 150M invocations and 7.5M GB-seconds, you would estimate cost by calculating usage above the free tier for each dimension and multiplying by the applicable regional price, making this the only correct approach.

Why this answer

Cloud Functions (2nd gen) pricing is based on three components: invocation count, compute time (measured in GB-seconds, which is memory multiplied by duration), and networking egress beyond the free tier. With 5 million requests per day at 200ms each and 256 MB memory, the monthly compute time is approximately 5,000,000 × 0.2 seconds × (256/1024) GB = 250,000 GB-seconds per day, or 7.5 million GB-seconds per month, which far exceeds the free tier of 400,000 GB-seconds per month, so costs will accrue. Additionally, the 150 million invocations per month exceed the free tier of 2 million invocations, and egress traffic will also incur charges beyond the 1 GB free tier.

Exam trap

The trap here is that candidates assume the free tier covers all usage because they underestimate the cumulative effect of high invocation counts and compute time, or they mistakenly think Cloud Functions pricing is similar to VM pricing or a flat per-function fee.

How to eliminate wrong answers

Option A is wrong because the free tier for Cloud Functions (2nd gen) includes only 2 million invocations and 400,000 GB-seconds of compute time per month; 150 million invocations and 7.5 million GB-seconds far exceed these limits, so costs are not approximately $0. Option C is wrong because Cloud Functions and VMs are not priced equivalently; Cloud Functions uses a pay-per-use model based on invocation count, compute time (GB-seconds), and networking, while an e2-medium VM charges for continuous uptime regardless of usage, and the two pricing models are fundamentally different. Option D is wrong because Cloud Functions pricing is based on actual usage metrics (invocations, compute time, networking), not a fixed monthly rate per deployed function; there is no per-function flat fee.

746
MCQmedium

A GKE Deployment must be updated to a new container image version with zero downtime — old Pods should be replaced gradually, not all at once. Which update strategy should be configured?

A.Recreate strategy
B.Blue-green deployment using a separate Deployment and Service selector swap
C.RollingUpdate strategy
D.Canary deployment with a traffic-splitting ingress
AnswerC

RollingUpdate is the default strategy for Kubernetes Deployments, progressively replacing old Pods with new ones while keeping a minimum number of Pods available at all times. It uses configurable parameters such as maxUnavailable and maxSurge to control how many Pods can be taken down or created beyond the desired replica count, allowing zero-downtime updates without any additional manifests. Since the Deployment controller manages the entire rollout automatically, it is the simplest and most direct way to achieve continuous availability.

Why this answer

The RollingUpdate strategy is correct because it gradually replaces old Pods with new ones while keeping the Deployment available, ensuring zero downtime. By default, it uses a `maxSurge` of 25% and `maxUnavailable` of 25%, allowing a controlled, incremental rollout that matches the requirement of replacing Pods gradually rather than all at once.

Exam trap

Google Cloud often tests the distinction between Deployment update strategies (Recreate vs. RollingUpdate) and higher-level deployment patterns (blue-green, canary), leading candidates to choose a pattern that is not a native Deployment strategy.

How to eliminate wrong answers

Option A is wrong because the Recreate strategy terminates all existing Pods before creating new ones, causing downtime during the transition. Option B is wrong because a blue-green deployment with a Service selector swap is a valid zero-downtime approach, but it requires a separate Deployment and manual or automated traffic switch, not a single Deployment update strategy as specified in the question. Option D is wrong because a Canary deployment with a traffic-splitting ingress is a more advanced pattern that typically uses an Ingress controller (e.g., with weighted routing) to gradually shift traffic, but it is not a native Deployment update strategy in GKE; the question asks for a strategy configured on the Deployment itself.

747
MCQeasy

You need to verify that a Compute Engine VM in `us-central1` can reach an on-premises server at IP `10.1.2.3` over a Cloud VPN connection. The VPN tunnel appears UP but you're unsure if routing is correct. Which GCP tool can test this connectivity?

A.SSH into the VM and run `ping 10.1.2.3` to test connectivity.
B.Use Network Intelligence Center Connectivity Tests to analyze the path from the VM to the on-premises IP.
C.Review Cloud VPN tunnel metrics in Cloud Monitoring for packet loss.
D.Run `gcloud compute routes list` to verify the route to 10.1.2.3 exists.
AnswerB

Connectivity Tests in Network Intelligence Center perform a simulated hop-by-hop analysis of a packet’s path from a VM to an on-premises IP, dynamically evaluating all applicable VPC firewall rules, routes, Cloud VPN tunnels, and Cloud Interconnect VLAN attachments. This allows the test to pinpoint the exact rule or route that is blocking traffic, such as an egress firewall rule denying traffic to the on-premises CIDR or a missing BGP route advertisement. Unlike simple reachability checks, Connectivity Tests do not require actual traffic or agent installations, making them safe and non-invasive for production troubleshooting.

Why this answer

B is correct because Network Intelligence Center Connectivity Tests can analyze the path from a specific source (the Compute Engine VM) to a destination (the on-premises server IP 10.1.2.3) across hybrid connectivity like Cloud VPN. It validates routing, firewall rules, and tunnel health without requiring you to SSH into the VM or run live traffic, making it ideal for diagnosing routing issues when the VPN tunnel is UP but connectivity is uncertain.

Exam trap

The trap here is that candidates assume a live ping from the VM (Option A) is the simplest test, but the question specifically asks for a tool to verify if routing is correct, not just connectivity — and Connectivity Tests provides a detailed path analysis without requiring VM access or generating live traffic.

How to eliminate wrong answers

Option A is wrong because SSH into the VM and running ping tests live connectivity, but if routing is misconfigured, the ping may fail due to asymmetric routing or firewall rules, and it doesn't isolate whether the issue is routing, VPN tunnel, or firewall — plus, you may not have SSH access or the VM may not have ICMP enabled. Option C is wrong because Cloud Monitoring tunnel metrics (e.g., packet loss, throughput) show tunnel health but cannot analyze the specific path from the VM to the on-premises IP or identify routing misconfigurations. Option D is wrong because `gcloud compute routes list` only shows routes in the VPC, not whether the route is actually being used by the VM or if the on-premises network has a return route; it doesn't test end-to-end connectivity or validate firewall rules.

748
MCQmedium

A developer attempts to create a Cloud SQL instance but receives the error: 'API [sqladmin.googleapis.com] not enabled.' What is the correct resolution?

A.Assign the developer the Cloud SQL Admin IAM role
B.Request a quota increase for Cloud SQL in the project
C.Enable the Cloud SQL Admin API via APIs & Services > Library in the Console
D.Create a new project — Cloud SQL is enabled by default in new projects
AnswerC

Enabling the Cloud SQL Admin API via APIs & Services > Library is the correct solution because this error directly indicates that sqladmin.googleapis.com has not been enabled in the project. In the Google Cloud Console, you navigate to APIs & Services > Library, search for 'Cloud SQL Admin API', and click Enable, which turns on the service for that project. The equivalent command-line approach is `gcloud services enable sqladmin.googleapis.com`, and once the API is enabled, the previously failing operation will succeed without any further IAM or quota changes.

Why this answer

The error 'API [sqladmin.googleapis.com] not enabled' indicates that the Cloud SQL Admin API has not been activated for the project. The correct resolution is to enable the API via APIs & Services > Library in the Google Cloud Console, as this is a prerequisite for creating any Cloud SQL instance. Assigning IAM roles or requesting quota increases does not enable the underlying API service.

Exam trap

Google Cloud often tests the distinction between enabling an API and assigning IAM roles, trapping candidates who think granting permissions automatically activates the underlying service.

How to eliminate wrong answers

Option A is wrong because assigning the Cloud SQL Admin IAM role grants permissions to use the API but does not enable the API itself; the API must be enabled at the project level first. Option B is wrong because a quota increase addresses resource limits, not the activation of the API service; the API must be enabled before any quota can be consumed. Option D is wrong because Cloud SQL is not enabled by default in new projects; each project requires explicit API enablement, and creating a new project would still require enabling the Cloud SQL Admin API.

749
Matchingmedium

Match each Cloud Storage storage class to its typical use case.

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

Concepts
Matches

Frequently accessed data

Data accessed less than once a month

Data accessed less than once a quarter

Data accessed less than once a year

Automatically transitions objects to optimal class

Why these pairings

The correct matches are: Standard for frequent access, Nearline for monthly access, Coldline for quarterly access, and Archive for long-term archival storage. Common confusions involve mixing access frequency requirements.

750
Multi-Selectmedium

A company wants to set up a new GCP project and ensure that only approved APIs can be used. Which two steps should they take? (Choose TWO)

Select 2 answers
A.Create a custom role with permissions to enable APIs
B.Use an organization policy to restrict the set of allowed APIs
C.Set a budget to limit API usage costs
D.Assign the Owner role to the project
E.Disable all APIs and enable only the required ones
AnswersB, E

Use an organization policy with the constraints/serviceusage.services constraint on the organization, folder, or project to define an allowlist of Google API service names, such as compute.googleapis.com and storage.googleapis.com. This policy is enforced at access time and inherited hierarchically, so no project-level IAM change can bypass the allowed set. It is the proper guardrail to ensure that only approved APIs can be enabled across a new project, regardless of who holds IAM permissions.

Why this answer

To restrict API usage, you can disable unapproved APIs and use organization policies to enforce restrictions.

Page 9

Page 10 of 11

Page 11

All pages