Courseiva

Google Associate Cloud Engineer (ACE) — Questions 526600

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

Page 7

Page 8 of 11

Page 9
526
MCQeasy

A startup wants to grant developers the ability to create and manage Compute Engine instances, but prevent them from deleting instances or changing firewall rules. Which IAM approach should they use?

A.Create a custom role with permissions for instance management but without compute.instances.delete.
B.Assign the roles/compute.instanceAdmin.v1 role.
C.Assign the roles/compute.instanceOperator role.
D.Assign the roles/compute.admin role.
AnswerA

A custom role lets you assemble an exact allowlist of permissions, such as compute.instances.create, start, and stop, while deliberately omitting compute.instances.delete. This satisfies the developer requirement to create and manage instances without granting the destructive capability to terminate them, enforcing least privilege. Because permissions map directly to specific API methods, you can precisely exclude deletion without losing any other management functionality.

Why this answer

Creating a custom role allows the startup to grant fine-grained permissions for instance management (e.g., compute.instances.create, compute.instances.start, compute.instances.stop) while explicitly omitting compute.instances.delete and any firewall-related permissions like compute.firewalls.update or compute.firewalls.delete. This ensures developers can manage instances but cannot delete them or alter firewall rules, meeting the exact requirement.

Exam trap

Google Cloud often tests the distinction between predefined roles that sound similar (like instanceAdmin.v1 vs. a non-existent instanceOperator) and the need for custom roles when predefined roles do not match the exact permission set required.

How to eliminate wrong answers

Option B is wrong because roles/compute.instanceAdmin.v1 includes compute.instances.delete and compute.firewalls.update, which would allow developers to delete instances and change firewall rules, violating the requirement. Option C is wrong because roles/compute.instanceOperator does not exist as a predefined role in Google Cloud IAM; this is a distractor that misleads candidates into thinking there is a role with limited permissions. Option D is wrong because roles/compute.admin grants full administrative access to all Compute Engine resources, including deleting instances and modifying firewall rules, which is far too permissive.

527
Multi-Selecteasy

Which TWO practices help ensure the reliability of a Cloud Functions deployment? (Choose two.)

Select 2 answers
A.Deploy functions in a single region to minimize latency.
B.Configure a VPC connector for all functions.
C.Set maximum instances to 1 to avoid resource contention.
D.Use Cloud Tasks to decouple function invocations.
E.Implement retry policies for background functions.
AnswersD, E

Cloud Tasks decouples the direct invocation path by enqueuing messages that are asynchronously delivered to your function, providing built-in retries with configurable deadlines, exponential backoff, and rate limiting that prevent overload and handle transient failures. This decoupling means the caller's success is not dependent on the function being immediately available, and tasks are queued persistently so no request is lost if the function is temporarily unavailable. It also smooths burst traffic, which is a core reliability practice.

Why this answer

Cloud Tasks decouples function invocations by queuing requests and delivering them asynchronously, which improves reliability by handling spikes in traffic without dropping requests and providing automatic retries on failure. Option E is correct because implementing retry policies for background functions (e.g., Cloud Functions triggered by Pub/Sub or Cloud Storage) ensures that transient failures are automatically retried, increasing the overall reliability of the deployment.

Exam trap

Google Cloud often tests the misconception that limiting concurrency (e.g., max instances = 1) improves reliability, when in fact it reduces fault tolerance and increases latency under load.

528
MCQmedium

A team uses Cloud Build to build Docker images and push them to Artifact Registry. The cloudbuild.yaml has a step that requires a secret API key to call an external service during build. How should the secret be provided securely?

A.Pass the API key as a build substitution variable in the gcloud builds submit command
B.Reference the API key from Secret Manager using the availableSecrets field in cloudbuild.yaml
C.Store the API key in a Cloud Storage bucket and download it in a build step
D.Hardcode the API key in the cloudbuild.yaml and store it in the source repository
AnswerB

Cloud Build's availableSecrets.secretManager field is the recommended way to reference a Secret Manager secret at build time. The secret value is fetched by Cloud Build using the build service account's IAM permissions and injected as an environment variable only into the specific build step that declares it, so it never appears in the source repository. Because the value is not written to the build config or log, this approach protects the API key while keeping the build reproducible and auditable.

Why this answer

Cloud Build's `availableSecrets` field allows you to securely inject secrets from Secret Manager into build steps as environment variables or files, without exposing them in the build configuration or logs. This approach ensures the API key is encrypted at rest and in transit, and access can be controlled via IAM permissions, making it the only secure method among the options.

Exam trap

Google Cloud often tests the misconception that substitution variables are secure because they are 'variables,' but they are actually passed as plain text and can be logged, whereas `availableSecrets` is the only method that guarantees the secret is never exposed in the build configuration or logs.

How to eliminate wrong answers

Option A is wrong because substitution variables are passed as plain text in the `gcloud builds submit` command and can be visible in build logs or command history, violating security best practices. Option C is wrong because storing the API key in a Cloud Storage bucket and downloading it in a build step exposes the key to potential unauthorized access if the bucket is misconfigured, and the key is still visible in the build step's command or logs. Option D is wrong because hardcoding the API key in `cloudbuild.yaml` and storing it in the source repository makes the key accessible to anyone with repository access, and it can be exposed in version control history or build logs.

529
MCQhard

A Cloud SQL for MySQL instance needs to be created with the following requirements: MySQL 8.0, db-n1-standard-2 tier, in us-central1, with root password 'secret'. Which command meets these requirements?

A.gcloud compute instances create my-instance --database-version MYSQL_8_0 --tier db-n1-standard-2 --region us-central1 --root-password secret
B.gcloud sql instances create my-instance --database-version MYSQL8 --tier n1-standard-2 --region us-central1 --password secret
C.gcloud sql instances create my-instance --database-version MYSQL_8_0 --tier db-n1-standard-2 --region us-central1 --root-password secret
D.gcloud sql instances create my-instance --database-version MYSQL_8_0 --machine-type db-n1-standard-2 --region us-central1 --root-password secret
AnswerC

This command correctly uses gcloud sql instances create with the supported database version MYSQL_8_0, the properly prefixed tier db-n1-standard-2, the target region us-central1, and the --root-password flag to set the initial root password. These are all valid and required parameters for provisioning a Cloud SQL for MySQL 8.0 instance from the command line.

Why this answer

The 'gcloud sql instances create' command with --database-version, --tier, --region, and --root-password correctly creates the instance.

530
MCQhard

A regulated financial company must ensure that all GCP API calls made by employees are logged with full request and response payloads for audit purposes. Which combination of Cloud Audit Log types captures this?

A.Admin Activity logs only
B.Admin Activity logs + Data Access logs (DATA_READ and DATA_WRITE)
C.VPC Flow Logs + Cloud Monitoring metrics
D.System event logs + Data Access logs
AnswerB

Admin Activity logs record every API call that creates, modifies, or deletes a resource, including governance changes such as IAM bindings, while Data Access logs capture DATA_READ and DATA_WRITE calls that read or change data, and include the request payload. Together they cover both the control-plane and data-plane aspects of all employee API calls, which is exactly what the scenario requires for complete audit coverage.

Why this answer

Admin Activity logs capture administrative actions like creating or modifying resources, but not the data within API calls. Data Access logs (DATA_READ and DATA_WRITE) capture the request and response payloads for API calls that read or write data, which is required for full audit logging. Together, they cover both the administrative context and the data-level payloads mandated for regulated financial companies.

Exam trap

Google Cloud often tests the misconception that Admin Activity logs alone are sufficient for audit compliance, when in fact they omit the data-level payloads that regulated audits require, and candidates may overlook the need to explicitly enable Data Access logs with full payload inclusion.

How to eliminate wrong answers

Option A is wrong because Admin Activity logs only record metadata about resource configuration changes (e.g., who created a VM), not the full request/response payloads of API calls that access or modify data. Option C is wrong because VPC Flow Logs capture network metadata (source/destination IP, ports, protocol) but not the application-layer payloads of API calls, and Cloud Monitoring metrics provide aggregated performance data, not audit logs. Option D is wrong because System event logs capture Google Cloud system events (e.g., instance preemption) and do not include API request/response payloads; Data Access logs alone would miss the administrative actions that are also required for a complete audit trail.

531
MCQmedium

A BigQuery table in a data pipeline receives daily data loads. To control storage costs, the team wants table data older than 180 days to be automatically deleted at the table level, not the dataset level. How should this be configured?

A.Set a dataset-level default table expiration of 180 days in the dataset properties
B.Use a Cloud Scheduler job to run a DELETE statement on rows older than 180 days nightly
C.Configure partition expiration on a date-partitioned table to expire partitions after 180 days
D.Set a table-level TTL using BigQuery's TTL API with a 180-day value
AnswerC

Configuring partition expiration directly on a date-partitioned table is correct because BigQuery automatically deletes entire partitions whose partition boundary is older than the configured number of days, without any user-initiated queries or jobs. For example, setting partition expiration to 180 days makes BigQuery drop any daily partition whose date is more than 180 days in the past, effectively retaining the most recent 180 days of rolling data. This is the most efficient, low-cost, and fully managed approach, as it uses no query slots and requires no scheduler, making it ideal for time-series and log data.

Why this answer

BigQuery's partition expiration feature allows you to automatically delete entire partitions from a date-partitioned table after a specified number of days. By setting the partition expiration to 180 days, all data in partitions older than 180 days is dropped at the table level, meeting the requirement without affecting other tables in the dataset.

Exam trap

Google Cloud often tests the distinction between dataset-level defaults and table-level partition expiration, and the trap here is that candidates confuse dataset-level table expiration (which deletes entire tables) with the requirement to delete only old rows within a single table.

How to eliminate wrong answers

Option A is wrong because dataset-level default table expiration applies to all tables in the dataset, not just the specific table, and it deletes entire tables, not rows or partitions. Option B is wrong because using a Cloud Scheduler job to run a DELETE statement incurs query costs and does not automatically delete data at the table level; it also requires ongoing maintenance and does not leverage BigQuery's native storage management. Option D is wrong because BigQuery does not have a 'TTL API' for tables; the correct mechanism for automatic deletion of old data is partition expiration on partitioned tables.

532
MCQhard

A team builds a GKE application that processes healthcare data. Regulatory requirements mandate that data in transit between GKE nodes must be encrypted. GKE is running on GCP. What provides encrypted node-to-node traffic within the cluster?

A.GCP automatically encrypts all VM-to-VM traffic in transit within its network
B.GKE node traffic is unencrypted by default — mTLS must be manually configured on every Pod
C.Enable VPC Flow Logs — they activate encryption for logged traffic
D.Install a TLS termination proxy on each GKE node — it encrypts intranode traffic
AnswerA

Google automatically applies encryption to all VM-to-VM traffic in transit within its network using the cryptographic capabilities built into Google's physical network infrastructure. This includes traffic between GKE nodes in the same cluster or across clusters, whether they are in the same zone or different regions. No configuration or key management is required from the customer, and this protection is independent of application-level protocols like TLS.

Why this answer

GCP automatically encrypts all VM-to-VM traffic in transit at the network layer, including traffic between GKE nodes, using a combination of MACsec (IEEE 802.1AE) and IPsec. This encryption is enabled by default for all traffic within a VPC and between VPCs, without any configuration required. Therefore, node-to-node traffic within a GKE cluster is already encrypted, satisfying the regulatory requirement.

Exam trap

The trap here is that candidates assume Kubernetes traffic is unencrypted by default and that they must manually configure mTLS or a proxy, overlooking that GCP's underlying network infrastructure already provides encryption for all VM-to-VM traffic in transit.

How to eliminate wrong answers

Option B is wrong because GKE node traffic is not unencrypted by default; GCP encrypts all VM-to-VM traffic at the network layer, so no manual mTLS configuration is needed for node-to-node encryption. Option C is wrong because VPC Flow Logs are used for network monitoring and logging, not for enabling encryption; they capture metadata about traffic but do not activate encryption. Option D is wrong because installing a TLS termination proxy on each GKE node is unnecessary and would only encrypt traffic at the application layer, not the underlying node-to-node traffic, which is already encrypted by GCP's infrastructure.

533
MCQeasy

You need to grant a user the ability to view audit logs for a project but not modify any resources. Which predefined IAM role should you assign?

A.roles/iam.securityReviewer
B.roles/owner
C.roles/viewer
D.roles/logging.viewer
AnswerD

roles/logging.viewer is the predefined role for read-only access to Cloud Logging data. It includes permissions such as logging.logEntries.list, logging.logEntries.get, and logging.logs.list, which are required to view audit logs in the Logs Explorer. This role cannot modify log sinks or delete logs, providing the least-privileged access to view audit logs.

Why this answer

The roles/logging.viewer role provides read-only access to logs, including audit logs. roles/iam.securityReviewer provides read access to IAM policies but not logs. roles/viewer is too broad. roles/owner is administrative.

534
MCQmedium

A batch processing job runs on preemptible VMs in a managed instance group. The job frequently fails due to preemption. Which design change would most effectively improve the job's resilience?

A.Use committed use discounts (1-year or 3-year).
B.Add GPUs to the instances.
C.Use sole-tenant nodes.
D.Use a managed instance group with distribution across multiple zones and enable autoscaling.
AnswerD

A managed instance group (MIG) with instances distributed across multiple zones directly mitigates preemption by ensuring that a single zone's preemption event doesn't wipe out the entire batch capacity; MIGs also provide automatic instance replacement via health checks and instance re-creation. Enabling autoscaling lets the group scale the number of preemptible VMs based on job demand or queue depth, and you can even configure the MIG to use preemptible VMs as the default while maintaining a buffer of on-demand instances if needed. This combination creates a resilient, self-healing architecture that tolerates preemption events and keeps the batch job making progress, which is exactly what the question requires.

Why this answer

Distributing the managed instance group across multiple zones and enabling autoscaling ensures that when preemptible VMs are terminated in one zone, the autoscaler can provision replacement VMs in another zone that still has capacity. This architecture leverages the fact that preemption events are often zone-specific, so multi-zone distribution combined with autoscaling provides resilience without requiring persistent resources.

Exam trap

Google Cloud often tests the misconception that committed use discounts or sole-tenant nodes provide preemption protection, when in fact they only affect pricing or hardware isolation, not the preemptible VM lifecycle.

How to eliminate wrong answers

Option A is wrong because committed use discounts (1-year or 3-year) reduce cost for sustained usage but do not prevent or mitigate preemption; preemptible VMs can still be terminated at any time regardless of commitments. Option B is wrong because adding GPUs to instances increases cost and does not address the root cause of preemption; GPUs do not make VMs less likely to be preempted. Option C is wrong because sole-tenant nodes dedicate physical servers to a single project, but preemptible VMs on those nodes are still subject to preemption; sole-tenant nodes do not provide any preemption protection.

535
MCQmedium

A security team wants to audit all Data Access attempts in a project for a specific Cloud Storage bucket, including who accessed which object and when. Which configuration is required?

A.Configure VPC Flow Logs on the VPC network
B.Set up Cloud Monitoring alerts on the bucket
C.Enable Admin Activity audit logs for Cloud Storage in the project
D.Enable Data Access audit logs for Cloud Storage in the project's IAM audit config
AnswerD

Data Access audit logs for Cloud Storage capture object-level read (e.g., object.get) and write (e.g., object.create) API calls, including the principal, source IP, timestamp, and the specific resource accessed. Because Data Access audit logs are disabled by default, they must be explicitly enabled in the project's IAM audit config to satisfy security auditing requirements.

Why this answer

Data Access audit logs must be enabled for Cloud Storage at the project level via IAM audit config. Admin Activity logs are always enabled but only record configuration changes, not data access. VPC Flow Logs record network metadata, not object-level access.

Cloud Monitoring does not provide audit logs.

536
MCQhard

An organization uses Organization Policies to restrict the use of certain IAM roles. The security team wants to audit all modifications to IAM policies across the organization, including at the project level. Which log type should be enabled and analyzed?

A.Admin Activity audit logs
B.System Event audit logs
C.Data Access audit logs (READ)
D.Data Access audit logs (WRITE)
AnswerA

Admin Activity audit logs record all API calls that modify configuration or metadata of resources, including IAM policy changes. In Cloud Logging, they are enabled by default and retained for 400 days. Since setting an IAM policy (e.g., projects.setIamPolicy) is a configuration-modifying operation, it's captured here. That's why this is the correct choice.

Why this answer

Admin Activity audit logs record all modifications to IAM policies. Data Access logs record reads of data, not policy changes. To audit IAM policy changes, Admin Activity logs must be enabled and analyzed.

537
MCQhard

A company has multiple projects under an organization. They want to enforce that all service accounts created in any project must use the naming prefix 'sa-'. Which policy should be used?

A.VPC Service Controls
B.Organization policy using a custom constraint
C.Project-level IAM condition
D.Cloud Audit Logs
AnswerB

An organization policy with a custom constraint is the correct answer because it can enforce resource naming patterns at the resource creation step. By defining a custom constraint with a CEL condition that checks the resource name against a regex (for example, `resource.name.matches('^[a-z]+[-][0-9]+$')`), the policy rejects any project that does not conform. This policy applies hierarchically across all projects under the organization, making it a proactive, centralized, and enforceable naming governance control.

Why this answer

An organization policy with a custom constraint is the correct approach because it allows you to define a specific rule (e.g., all service accounts must start with 'sa-') that is enforced across all projects in the organization. Custom constraints use the Resource Manager API's `constraints/*` format and are evaluated at resource creation time, making them ideal for naming conventions that must be applied universally.

Exam trap

Google Cloud often tests the distinction between 'enforcement' (organization policies) and 'monitoring' (audit logs) or 'access control' (IAM conditions), leading candidates to confuse a naming convention policy with a logging or access control mechanism.

How to eliminate wrong answers

Option A is wrong because VPC Service Controls are designed to protect data within VPCs by controlling exfiltration, not to enforce naming conventions on service accounts. Option C is wrong because project-level IAM conditions control access based on attributes like resource name or timestamp, but they cannot enforce a naming prefix at creation time—they only restrict access to existing resources. Option D is wrong because Cloud Audit Logs record actions for auditing and monitoring, but they do not enforce any policies or prevent non-compliant resources from being created.

538
MCQeasy

A data analyst needs to run complex analytical queries on a large dataset (10 TB) stored in Cloud Storage. They want to use a serverless query engine that charges based on the amount of data processed. Which Google Cloud service should they use?

A.Cloud SQL
B.BigQuery
C.Bigtable
D.Dataproc
AnswerB

BigQuery is Google Cloud's serverless, highly scalable data warehouse optimized for analytical queries on massive datasets. It separates storage from compute, uses columnar storage and a distributed query engine, and offers pay-per-query pricing, so you only pay for the data scanned. With features like partitioning, clustering, and BI Engine, it is the ideal choice for complex analytical workloads without managing infrastructure.

Why this answer

BigQuery is a serverless data warehouse that charges based on queries processed (on-demand) or flat-rate. It can query external data in Cloud Storage via federated queries.

539
MCQmedium

A team stores sensitive configuration files in Cloud Storage that internal services download at startup. External partners occasionally need time-limited access to specific files without creating GCP accounts. Which feature grants temporary access without modifying bucket permissions?

A.Make the specific files publicly readable and share the direct URL
B.Generate a Signed URL for the specific files with the required expiration time
C.Create a temporary GCP service account for the partner and share its JSON key
D.Enable uniform bucket-level access and create a public IAM binding for 24 hours
AnswerB

A signed URL is a URL that includes an expiration timestamp, a signature, and a signature algorithm, generated using your service account's private key; when accessed, Cloud Storage verifies the signature and grants access only to the specific object path embedded in the URL. This is the correct choice because it gives the partner temporary, revocable access to exactly the identified files without modifying IAM policies or making data public. The signature is cryptographically tied to the object name, bucket, and expiration, so the URL cannot be altered to access other objects.

Why this answer

Signed URLs provide time-limited, granular access to specific Cloud Storage objects without altering the underlying bucket permissions. The partner receives a URL that embeds authentication information and an expiration time, enabling secure, temporary downloads without requiring a GCP account or IAM role.

Exam trap

Google Cloud often tests the distinction between Signed URLs (object-level, temporary, no IAM changes) and Signed Policy Documents (form uploads) or public access, trapping candidates who confuse 'temporary access' with 'making objects public' or 'creating temporary credentials.'

How to eliminate wrong answers

Option A is wrong because making files publicly readable grants unrestricted access to anyone with the URL, violating the requirement for time-limited access and potentially exposing sensitive data indefinitely. Option C is wrong because creating a temporary service account and sharing its JSON key violates security best practices (key exposure risk) and requires the partner to manage GCP credentials, which contradicts the 'without creating GCP accounts' requirement. Option D is wrong because enabling uniform bucket-level access and creating a public IAM binding grants broad, time-limited access to the entire bucket, not specific files, and still requires modifying bucket-level permissions, which the question explicitly forbids.

540
MCQhard

A team is using Cloud Shell to manage resources. They notice that their home directory is persistent across sessions, but they want to ensure that configuration files and scripts are also available after they stop and restart Cloud Shell. What should they do?

A.Use gcloud config configurations and save scripts in a Cloud Storage bucket
B.Create a startup script that runs every time Cloud Shell starts
C.Store files in /tmp
D.Store files in the home directory (~)
AnswerD

Cloud Shell automatically mounts a persistent home directory at ~ on a small but durable disk that is attached to your user profile across sessions. Any files, Bash scripts, or gcloud configuration files you place in ~ remain available even when the underlying VM is replaced. This is the intended and simplest way to preserve your work in Cloud Shell, and it also houses the .config directories used by gcloud.

Why this answer

Cloud Shell's home directory persists 5 GB of data. As long as files are stored in the home directory ($HOME), they will persist across sessions.

541
MCQmedium

You are deploying a stateful application to GKE that requires each pod to have its own dedicated persistent disk, and each disk must persist data even if the pod is rescheduled to a different node. Which Kubernetes object type should you use?

A.Deployment with a shared PersistentVolumeClaim mounted by all pods.
B.StatefulSet with volumeClaimTemplates to provision individual PVCs per pod.
C.DaemonSet with a hostPath volume on each node.
D.Deployment with an emptyDir volume for each pod.
AnswerB

StatefulSets are designed for applications that need stable network identities and dedicated persistent storage for each replica. The volumeClaimTemplates field causes Kubernetes to generate a unique PVC for every pod, which binds to a persistent disk that remains even after the pod is terminated. When a StatefulSet pod is rescheduled, it reattaches to the same PVC, ensuring data persists and remains exclusively associated with that pod.

Why this answer

A StatefulSet with volumeClaimTemplates is the correct choice because it automatically provisions a unique PersistentVolumeClaim (PVC) for each pod replica, ensuring each pod gets its own dedicated persistent disk. When a pod is rescheduled to a different node, the PVC remains bound to its original PersistentVolume (PV), allowing the new pod to mount the same disk and retain the data. This meets the requirement for both per-pod dedicated storage and data persistence across rescheduling events.

Exam trap

The trap here is that candidates often choose a Deployment with a shared PVC (Option A) because they think 'shared storage' is simpler, but they overlook the requirement for each pod to have its own dedicated disk, which a shared volume cannot provide.

How to eliminate wrong answers

Option A is wrong because a Deployment with a shared PersistentVolumeClaim mounted by all pods would cause all replicas to write to the same disk, leading to data corruption and failing the requirement for each pod to have its own dedicated persistent disk. Option C is wrong because a DaemonSet with a hostPath volume on each node ties the data to a specific node's filesystem, so if a pod is rescheduled to a different node, the data is lost or inaccessible, violating the persistence requirement. Option D is wrong because a Deployment with an emptyDir volume for each pod creates ephemeral storage that is deleted when the pod terminates, so data does not persist across rescheduling events.

542
Multi-Selectmedium

A company is deploying a microservice on Cloud Run. They want to ensure that the service can handle high traffic spikes by allowing multiple concurrent requests per container instance. They also want to minimize cold starts. Which two settings should they configure? (Choose two.)

Select 2 answers
A.Set the timeout to 900 seconds
B.Set CPU always on to true
C.Set min-instances to a value greater than 0 (e.g., 1)
D.Set max-instances to a high value
E.Set concurrency to a value higher than 1 (e.g., 80)
AnswersC, E

Setting min-instances to a value greater than 0, such as 1, instructs Cloud Run to keep at least one instance always running and fully initialized, so baseline traffic never experiences the latency penalty of a cold start. This pre-warmed instance is ready to serve immediately, eliminating the delay caused by pulling a container image and booting the runtime. Note that this approach incurs billing even when there is no traffic, and it only removes cold starts for the first instance; a sudden burst beyond that instance's concurrency can still trigger new cold starts.

Why this answer

Setting concurrency to a higher value (e.g., 80) allows each container instance to handle multiple requests simultaneously, improving throughput. Setting min-instances to a value greater than 0 keeps instances warm to reduce cold starts. Max-instances limits scaling but does not help with cold starts.

CPU always on keeps CPU allocated but does not directly affect cold starts. Timeout affects request duration, not concurrency or cold starts.

543
Multi-Selecthard

A DevOps engineer is creating a GKE cluster for a production workload that requires high availability and resilience to zone failures. They also need to deploy a stateless application that can scale based on CPU usage. Which two actions should they take? (Choose two.)

Select 2 answers
A.Enable node auto-repair on the node pool
B.Create a zonal cluster in a single zone
C.Set the deployment replicas to 1
D.Enable horizontal pod autoscaling on the deployment with CPU target utilization
E.Create a regional cluster with nodes in multiple zones
AnswersD, E

Horizontal Pod Autoscaler (HPA) continuously observes the average CPU utilization of the pods in a Deployment (via metrics-server) and automatically adjusts the `replicas` field to keep utilization near the configured target, e.g., 70%. This directly fulfills the stated need to scale the application based on load — when CPU usage rises, HPA adds pods; when it drops, HPA removes excess pods. Note that HPA is about pod-level elasticity and does not by itself provide zone resilience; to meet the production requirement fully, you would combine HPA with a regional multi-zone cluster so that scaled-out pods can be scheduled across failure domains.

Why this answer

A regional cluster spans multiple zones, providing high availability. An HPA scales pods based on CPU. A zonal cluster is not highly available.

Node auto-repair is for node health, not resilience to zone failure. Using a deployment with replicas is good, but the question asks for actions related to cluster creation and scaling.

544
MCQmedium

A payment service publishes an event to a message queue every time a transaction completes. Multiple downstream services (inventory, analytics, email) must each process every event independently. Which messaging pattern and GCP service best supports this?

A.Cloud Tasks with one queue per downstream service
B.Cloud Pub/Sub with one subscription per downstream service on a shared topic
C.Cloud Storage event notifications with three separate buckets
D.Directly calling each downstream service's API synchronously from the payment service
AnswerB

Cloud Pub/Sub's fan-out model is exactly this scenario: the payment service publishes each business event once to a single topic, and then each downstream service creates its own subscription to that same topic. Pub/Sub delivers every message to every subscription independently, with each subscription maintaining its own acknowledgment state, so consumers can process different views of the same event without coordinating with one another or with the publisher. This provides at-least-once delivery, independent retries, and horizontal scaling per service, which is why it's the correct decoupled pattern.

Why this answer

Cloud Pub/Sub with a single topic and one subscription per downstream service is the correct pattern because it implements a fan-out messaging model where each subscriber receives an independent copy of every published message. This ensures that inventory, analytics, and email services each process every transaction event without interference, while Pub/Sub handles at-least-once delivery and automatic scaling.

Exam trap

Google Cloud often tests the distinction between Cloud Tasks (point-to-point task execution) and Cloud Pub/Sub (fan-out messaging), and the trap here is that candidates confuse 'multiple queues' with 'multiple subscriptions,' failing to recognize that Pub/Sub’s topic-subscription model is the native GCP solution for independent event processing.

How to eliminate wrong answers

Option A is wrong because Cloud Tasks is designed for reliable task execution with a single queue per worker, not for fan-out to multiple independent consumers; using one queue per service would require the payment service to publish the same event to multiple queues, duplicating effort and breaking the decoupled pattern. Option C is wrong because Cloud Storage event notifications are triggered by object changes in a bucket and cannot reliably fan out the same event to multiple independent services without complex workarounds; they also lack the at-least-once delivery guarantees and subscription-level acknowledgment that Pub/Sub provides. Option D is wrong because directly calling each downstream service's API synchronously from the payment service creates tight coupling, increases latency (the payment service must wait for all responses), and introduces a single point of failure—if one service is slow or down, the entire transaction processing is blocked.

545
MCQeasy

A company wants to deploy a containerized web application on Google Kubernetes Engine (GKE) with minimal operational overhead. They require automatic scaling based on CPU utilization. Which resource should they configure?

A.Cluster autoscaler
B.VerticalPodAutoscaler
C.HorizontalPodAutoscaler
D.Node auto-provisioning
AnswerC

HorizontalPodAutoscaler continuously monitors a selected metric, typically CPU utilization, and reconciles the 'replicas' field of a Deployment or ReplicaSet to the number needed to meet the target. When average CPU exceeds the configured threshold, HPA increases replica count; when demand drops, it decreases pods to help control cost. This is precisely the behavior required to scale a containerized web application horizontally based on workload pressure.

Why this answer

The HorizontalPodAutoscaler (HPA) is the correct resource because it automatically scales the number of pod replicas in a GKE deployment based on observed CPU utilization (or other custom metrics). This directly meets the requirement for automatic scaling with minimal operational overhead, as HPA is a native Kubernetes controller that adjusts replica counts without manual intervention.

Exam trap

Google Cloud often tests the distinction between horizontal scaling (adding/removing pods) and vertical scaling (adjusting pod resources) or infrastructure scaling (adding/removing nodes), leading candidates to confuse the HorizontalPodAutoscaler with the Cluster autoscaler or VerticalPodAutoscaler.

How to eliminate wrong answers

Option A is wrong because the Cluster autoscaler adjusts the number of nodes in the GKE cluster, not the number of pod replicas; it handles infrastructure-level scaling, not application-level scaling based on CPU utilization. Option B is wrong because the VerticalPodAutoscaler (VPA) adjusts CPU and memory requests/limits of existing pods, not the number of replicas; it is designed for right-sizing resource requests, not horizontal scaling. Option D is wrong because Node auto-provisioning is a feature that automatically creates new node pools when the cluster autoscaler cannot scale up due to insufficient resources; it does not directly scale pods based on CPU utilization.

546
MCQhard

Your company's compliance policy requires that all customer data stored in Cloud Storage must be encrypted using keys stored in a Hardware Security Module (HSM). The encryption keys must be managed by your security team and must not be exportable. Which configuration meets these requirements?

A.Use Cloud KMS software keys (protection level: SOFTWARE) with Cloud Storage CMEK.
B.Use Cloud KMS HSM-backed keys (protection level: HSM) with Cloud Storage CMEK.
C.Use Customer-Supplied Encryption Keys (CSEK) managed by your security team.
D.Enable Google-managed encryption with HSM by selecting it in Cloud Storage settings.
AnswerB

HSM protection level keys are generated and stored inside FIPS 140-2 Level 3 HSMs. They are non-exportable by design. CMEK with Cloud KMS HSM keys gives your team control while meeting HSM and non-exportability requirements.

Why this answer

Cloud KMS HSM-backed keys (protection level: HSM) ensure that encryption keys are stored in a Hardware Security Module, are managed by the security team, and are non-exportable by design. When used with Cloud Storage CMEK, this configuration meets the compliance requirement for HSM-based key storage with full customer control and no key export capability.

Exam trap

Google Cloud often tests the distinction between customer-managed keys (CMEK) and customer-supplied keys (CSEK), where candidates mistakenly think CSEK provides HSM-level protection or that Google-managed encryption can be configured to use an HSM, but neither meets the non-exportable, HSM-backed requirement.

How to eliminate wrong answers

Option A is wrong because Cloud KMS software keys (protection level: SOFTWARE) are stored in software, not in an HSM, and thus do not satisfy the requirement for HSM-based encryption. Option C is wrong because Customer-Supplied Encryption Keys (CSEK) are managed by the customer but are not stored in an HSM; they are supplied by the customer and can be exported, violating the non-exportable requirement. Option D is wrong because Google-managed encryption with HSM is not a selectable setting in Cloud Storage; Google-managed encryption uses Google-owned keys, not customer-managed HSM keys, and does not allow the security team to control or restrict key export.

547
MCQmedium

A developer wants to run a one-time query on a large dataset stored in Cloud Storage using BigQuery without loading the data into a table. Which feature should they use?

A.Use a BigQuery federated query with an external table definition
B.Create a permanent table and load the data using gcloud bq load
C.Use Cloud SQL to query the data via federated query
D.Use gcloud sql import to load data into BigQuery
AnswerA

A BigQuery federated query with an external table definition lets you query data that remains in Cloud Storage without loading it into BigQuery's managed storage. You define an external table pointing at files in GCS (CSV, JSON, Avro, Parquet, etc.) with optional schema auto-detection, and the query engine reads the source natively at query time. This matches a one-time analysis by eliminating the load job, copying no data, and charging only for the bytes scanned during execution.

Why this answer

BigQuery federated queries allow querying external data sources (like Cloud Storage) directly using external tables or the EXTERNAL_QUERY function. This avoids loading data.

548
MCQhard

An organization wants to use Cloud NAT to allow private Compute Engine instances to access the internet for updates. They have a VPC with a custom subnet and a Cloud Router configured. However, instances cannot reach the internet. What is the most likely cause?

A.The Cloud NAT gateway has not been created on the Cloud Router.
B.The instances do not have external IP addresses.
C.The firewall rules block egress traffic.
D.The subnet does not have Private Google Access enabled.
AnswerA

A Cloud Router alone is only a BGP session manager; it does not perform address translation by itself. To enable NAT on a VPC, you must explicitly create a Cloud NAT gateway and attach it to the Cloud Router for a given region and subnetwork, which then maps private IPs to a pool of external IPs. Without that gateway, outbound packets from private instances are dropped when they try to reach the internet, regardless of routing.

Why this answer

Cloud NAT requires a Cloud Router and a NAT gateway configuration on the router. If the NAT gateway is not created, instances cannot use NAT. Other issues like missing routes or firewall rules are possible but less likely when Cloud NAT is set up correctly.

549
MCQeasy

An engineer needs to create a GKE cluster with 3 nodes of machine type e2-medium in the us-central1 region. Which command should they use?

A.gcloud container clusters create my-cluster --num-nodes=3 --machine-type=e2-medium --region=us-central1
B.gcloud container clusters create my-cluster --num-nodes=3 --machine-type=e2-medium
C.gcloud container clusters create my-cluster --num-nodes=3 --machine-type=e2-medium --region=us-central1-a
D.gcloud container clusters create my-cluster --num-nodes=3 --machine-type=e2-medium --zone=us-central1-a
AnswerA

This command creates a regional GKE cluster in the us-central1 region, using --region rather than --zone. The --num-nodes=3 flag sets three e2-medium nodes in the cluster, and the regional scope means the control plane is replicated across the zones in us-central1, providing higher availability. This is the only option that correctly combines the required node specification with a regional location.

Why this answer

The correct command is 'gcloud container clusters create my-cluster --num-nodes=3 --machine-type=e2-medium --region=us-central1'. The --zone flag is for zonal clusters, not regional. The other options either use wrong zone or wrong flags.

550
MCQmedium

An organization has a VPC with subnets in us-central1 and europe-west1. They want to allow traffic from a specific on-premises IP range to reach a Compute Engine instance in europe-west1, but only through a single Cloud VPN tunnel attached to the us-central1 gateway. What configuration is required?

A.Create a route in us-central1 with the on-premises range and next hop set to the VPN tunnel. Add a firewall rule allowing the traffic.
B.Use policy-based routing on the Cloud VPN gateway to route the traffic to europe-west1.
C.Create a static route for the on-premises range in the europe-west1 subnet pointing to the VPN tunnel in us-central1.
D.Configure the VPN tunnel with BGP to advertise the on-premises range to both regions.
AnswerA

Creating a regional route in us-central1 with the on-premises CIDR as the destination and the Cloud VPN tunnel as the next hop is the standard way to direct that traffic through the desired tunnel. Because the VPN tunnel is a regional resource in us-central1, the route must be created in that same region. Additionally, a firewall rule must allow the traffic from the source VPC subnets to the on-premises range, otherwise the packets are dropped even with a valid route.

Why this answer

The VPN tunnel is attached to the us-central1 gateway, and a static route in us-central1 with the on-premises IP range as the destination and the VPN tunnel as the next hop directs traffic from the on-premises network to the VPC. Since the VPC is global, the route applies to all regions, and the Compute Engine instance in europe-west1 is reachable as long as the traffic enters the VPC through the us-central1 tunnel. A firewall rule is required to allow the inbound traffic from the on-premises range to the instance.

Exam trap

The trap here is that candidates assume routes must be created in the same region as the destination instance, but in a global VPC, a route in one region can direct traffic to instances in another region as long as the next hop is valid and the traffic enters through the correct gateway.

How to eliminate wrong answers

Option B is wrong because Cloud VPN does not support policy-based routing; it uses route-based or BGP-based routing, and policy-based routing is not a feature of Cloud VPN gateways. Option C is wrong because a static route in the europe-west1 subnet cannot point to a VPN tunnel in us-central1; routes are global in a VPC, and the next hop must be a resource in the same region as the route's gateway, or the route must be created in the region where the VPN gateway resides. Option D is wrong because BGP advertises routes from the on-premises network to the VPC, not the other way around; advertising the on-premises range via BGP would not control the path through which traffic enters the VPC, and it would not force traffic through the us-central1 tunnel.

551
MCQhard

You are planning a Private Service Connect (PSC) configuration to allow your VPC to access a managed Cloud SQL instance over a private endpoint without exposing traffic to the public internet. What does Private Service Connect provide in this context?

A.PSC creates a VPC peering connection between your VPC and Google's service VPC.
B.PSC provides a private, internal IP endpoint in your VPC that routes to the managed service without traversing the public internet.
C.PSC enables bidirectional private communication between your VPC and the service's VPC, similar to peering.
D.PSC replaces the need for a Serverless VPC Access connector when calling managed services from Cloud Run.
AnswerB

PSC (Private Service Connect) provisions a forwarding rule in your VPC that allocates an internal IP address as an endpoint for the managed service, such as Cloud SQL. All traffic sent to that internal IP is routed over Google's internal network directly to the service's backends, without traversing the public internet, a VPN, or a NAT gateway. This provides private, low-latency connectivity while keeping the resource entirely within your VPC's IP space.

Why this answer

Private Service Connect (PSC) allows you to access Google-managed services (like Cloud SQL) by creating a private, internal IP endpoint within your VPC. This endpoint uses an internal IP address from your VPC's subnet and forwards traffic to the service without ever leaving Google's network, thus avoiding the public internet. Unlike VPC peering, PSC does not require you to manage peering relationships or worry about overlapping IP ranges.

Exam trap

The trap here is that candidates confuse Private Service Connect with VPC peering or assume it provides bidirectional connectivity, when in fact PSC is a unidirectional, endpoint-based model that does not require peering or address space coordination.

How to eliminate wrong answers

Option A is wrong because PSC does not create a VPC peering connection; it uses a Private Service Connect endpoint (a forwarding rule) that maps to a service attachment in the producer's VPC, not a direct peering link. Option C is wrong because PSC provides unidirectional (consumer-to-producer) access, not bidirectional communication; the producer cannot initiate connections back to the consumer's VPC. Option D is wrong because PSC is not a replacement for Serverless VPC Access connector; the connector is used to allow serverless environments (like Cloud Run) to reach resources in a VPC, whereas PSC is for accessing managed services from a VPC.

552
Multi-Selectmedium

A company wants to deploy a new application on Google Cloud that requires a regional managed instance group with automatic scaling based on HTTP load. Which two resources must they create? (Choose TWO.)

Select 2 answers
A.Cloud Run service
B.GKE cluster
C.HTTP(S) Load Balancer
D.Instance template
E.Cloud Function
AnswersC, D

The HTTP(S) Load Balancer is a correct component because it provides a single anycast IP address that distributes incoming traffic across the backend Compute Engine instances in the managed instance group. It also performs health checks on those instances and automatically routes traffic only to healthy VMs, which is essential for a highly available application and is the standard external entry point for a MIG-based deployment.

Why this answer

To deploy a regional managed instance group (MIG) with autoscaling based on HTTP load, you need an instance template to define the VM configuration for the MIG, and an HTTP(S) Load Balancer to distribute traffic and provide the load metrics for autoscaling. Options C (HTTP(S) Load Balancer) and D (Instance template) are correct. Option A (Cloud Run) is for serverless containers, not for MIGs.

Option B (GKE cluster) is for Kubernetes. Option E (Cloud Function) is for serverless functions.

553
MCQmedium

Refer to the exhibit. An application running on this instance is unable to write to a Cloud Storage bucket. What is the most likely cause?

A.The application is using the wrong authentication method
B.The access scopes only allow read access to Cloud Storage
C.The Cloud Storage bucket is in a different project
D.The service account does not have the storage.objectAdmin IAM role
AnswerB

The access scopes configured on the instance determine the OAuth token's capabilities and are enforced in addition to IAM. In the exhibit, the scope is devstorage.read_only, so the token can only perform read operations on Cloud Storage, even if the service account has a write-capable IAM role like storage.objectAdmin. Because GCS writes use the token's scopes, the API call fails with a scope error before IAM is evaluated. To allow writes, you must either update the instance's access scopes or restart with the correct scope.

Why this answer

When an instance is created with access scopes, these scopes restrict the API methods that the instance's credentials can use, regardless of the IAM permissions granted to the attached service account. The exhibit shows that the access scopes are set to 'Read Only' for Cloud Storage, which means the application can only call read methods (e.g., storage.objects.get) and cannot perform write operations (e.g., storage.objects.insert). This overrides any IAM role that would otherwise allow write access.

Exam trap

Google Cloud often tests the distinction between IAM permissions and access scopes, trapping candidates who assume that a service account with the correct IAM role can always perform the action, ignoring that access scopes can override those permissions at the instance level.

How to eliminate wrong answers

Option A is wrong because the authentication method (e.g., using a service account key or metadata server) is not the issue; the access scopes are explicitly limiting the API calls. Option C is wrong because Cloud Storage buckets can be accessed from any project as long as the correct IAM permissions and access scopes are in place; cross-project access is not inherently blocked. Option D is wrong because even if the service account had the storage.objectAdmin IAM role, the access scopes would still restrict the API methods to read-only, making the IAM role irrelevant for write operations.

554
MCQeasy

You need to allow SSH access to a Compute Engine instance. Which method is the recommended way to manage SSH keys for multiple users?

A.Add SSH keys to the instance metadata.
B.Use gcloud compute ssh with the --ssh-key-file flag.
C.Enable OS Login and assign IAM roles to users.
D.Create a custom image with preconfigured SSH keys.
AnswerC

Enabling OS Login at the project or instance level, then assigning IAM roles such as roles/compute.osLogin or roles/compute.osAdminLogin to users, is the recommended pattern for SSH access. OS Login links the Linux account on the instance to the user's Google identity, automatically provisions a temporary SSH key when the user runs gcloud compute ssh, and allows instant revocation simply by removing the IAM policy binding.

Why this answer

OS Login is the recommended method for managing SSH access to Compute Engine instances, as it links SSH keys to user accounts and integrates with IAM.

555
MCQhard

An organization has multiple GCP projects and wants to centralize billing analysis across all projects. They need to export detailed billing data (e.g., cost per SKU per project) to a BigQuery dataset. Which billing export option should they configure?

A.Export to CSV to Cloud Storage
B.Export to Cloud Billing report
C.Export to a Pub/Sub topic
D.Export detailed billing data to BigQuery
AnswerD

Exporting detailed billing data to BigQuery is the correct approach because it automatically creates and maintains tables like `gcp_billing_export_v1` within your project's BigQuery dataset. Every project that shares the billing account is included, and you can immediately run SQL queries to analyze costs by project, service, SKU, or label, as well as build dashboards and scheduled queries. This export is the official Google-recommended method for centrally managing and analyzing billing information across an organization.

Why this answer

The standard usage cost export to BigQuery provides detailed billing data for analysis.

556
MCQmedium

A Cloud CDN cache is serving stale content after a website update. New files were deployed to Cloud Storage but CDN is still serving the old versions to some users. What is the fastest way to force CDN to serve the updated content?

A.Wait for the CDN TTL to expire — cached content automatically refreshes
B.Run a CDN cache invalidation for the affected URL paths
C.Delete and recreate the Cloud Storage bucket — CDN will detect the new bucket as a fresh origin
D.Disable Cloud CDN temporarily — all users will hit the origin until CDN is re-enabled
AnswerB

Running a CDN cache invalidation is the correct and intended way to immediately refresh stale content. Use the gcloud command `gcloud compute url-maps invalidate-cdn-cache [URL_MAP] --path=[PATH_PATTERN]` to purge all matching cached objects from Cloud CDN's edge caches. After invalidation, the next request for that path is forwarded to the Cloud Storage origin, which returns the fresh content and repopulates the cache. This approach is non-destructive, immediate, and highly targeted, allowing you to refresh only the URLs that changed while preserving cached responses for all other paths. Keep in mind that invalidation propagates across edge locations in a few seconds, so it is the best choice when time-sensitive content must be updated without origin disruption or unnecessary cost.

Why this answer

Cloud CDN supports cache invalidation, which immediately removes cached objects from edge caches for specified URL paths. This forces the CDN to fetch fresh content from the origin (Cloud Storage) on the next request, providing the fastest way to serve updated content without waiting for TTL expiry.

Exam trap

Google Cloud often tests the misconception that modifying the origin (e.g., deleting/recreating a bucket) automatically clears the CDN cache, when in fact the CDN cache is independent and requires explicit invalidation or TTL expiry to refresh.

How to eliminate wrong answers

Option A is wrong because waiting for TTL expiry is passive and can take minutes to hours depending on the configured cache duration, which is not the fastest solution. Option C is wrong because deleting and recreating the Cloud Storage bucket does not affect CDN cache; the CDN still holds stale content from the old bucket URL, and the new bucket would require a new CDN configuration. Option D is wrong because disabling Cloud CDN temporarily disrupts service for all users and does not clear the cache; re-enabling it would still serve stale content until TTL expires or invalidation is performed.

557
MCQhard

A company runs a stable production workload on 20 n2-standard-8 VMs that run continuously year-round. Which pricing commitment maximizes cost savings on these VMs?

A.Sustained use discounts (automatically applied)
B.1-year committed use discount (CUD)
C.3-year committed use discount (CUD)
D.Switching to Spot VMs
AnswerC

A 3-year committed use discount (CUD) on N2 VMs provides up to a 57% discount off on-demand pricing, the highest discount Google Cloud offers for this machine family. Since the workload is stable and must run continuously, the long-term commitment carries little risk and maximizes cost savings. This makes the 3-year CUD the most cost-effective choice among the options presented.

Why this answer

The 3-year committed use discount (CUD) offers the highest discount rate (up to 57% for compute-optimized machine types) compared to 1-year CUDs (up to 20%) or sustained use discounts (up to 30% for running a VM the entire month). Since the workload runs 20 n2-standard-8 VMs continuously year-round, a 3-year CUD locks in the maximum savings for this predictable, steady-state usage.

Exam trap

Google Cloud often tests the misconception that sustained use discounts are always the best option for long-running workloads, but candidates must recognize that committed use discounts provide significantly higher savings for predictable, continuous usage, especially with a 3-year term.

How to eliminate wrong answers

Option A is wrong because sustained use discounts are automatically applied for running VMs more than 25% of a month, but they max out at 30% discount, which is lower than the 3-year CUD's up to 57% discount. Option B is wrong because a 1-year CUD offers a lower discount (up to 20%) compared to a 3-year CUD, and since the workload runs continuously for multiple years, the longer commitment yields greater savings. Option D is wrong because Spot VMs can be preempted at any time, making them unsuitable for a stable production workload that requires continuous availability and cannot tolerate interruptions.

558
MCQhard

A team is using BigQuery for analytics. They have a constant query workload and want to reduce costs by switching from on-demand pricing to a flat-rate reservation. They have purchased a BigQuery flat-rate reservation. What additional step is required to use the reservation?

A.Enable flat-rate billing in the BigQuery settings
B.Assign the reservation to the desired projects using an assignment
C.No additional steps; flat-rate is automatically applied to all queries
D.Create a new dataset and move all tables into it
AnswerB

After purchasing a capacity commitment, you must create a reservation and then create an assignment that associates that reservation with specific projects (or folders/organizations). Once the assignment is in place, query jobs issued from those assigned projects consume the reserved slots, and their usage is billed at the flat-rate, on-demand pricing no longer applies.

Why this answer

The reservation must be assigned to a project, folder, or organization via a reservation assignment. Without assignment, the reservation is not used, and queries continue to be billed on-demand.

559
Matchingmedium

Match each Google Cloud deployment tool to its purpose.

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

Concepts
Matches

Infrastructure-as-code using YAML

Multi-cloud infrastructure provisioning

CI/CD pipeline for building and testing

Command-line tool for managing GCP resources

Web-based UI for managing GCP

Why these pairings

Cloud Deployment Manager and Terraform are infrastructure-as-code tools, with Cloud Deployment Manager being GCP-native and Terraform multi-cloud. The Cloud Console and gcloud CLI provide GUI and command-line interfaces for GCP management.

560
MCQeasy

A site reliability engineer needs to be notified immediately when the error rate of a production microservice exceeds 5% over a 5-minute window. Which type of alerting policy should be used?

A.Uptime check alert
B.Pub/Sub notification hook
C.Metric threshold alert
D.Log-based alert (log metric trigger)
AnswerC

A metric threshold alert continuously evaluates a time-series metric (e.g., error rate, request latency, or CPU utilization) against a user-defined threshold, such as 'error rate > 5% for 5 minutes', and immediately triggers a notification when the condition is met. This is precisely the right tool for an SRE who needs to be notified when application error rates exceed an acceptable level, because it supports real-time aggregation, sliding windows, and alerting policies with multiple notification channels. It is the correct answer.

Why this answer

A metric threshold alert triggers when a metric crosses a threshold. This scenario requires tracking the error rate metric and alerting when it exceeds 5%.

561
MCQeasy

An engineer needs to deploy a containerized web application that receives HTTP requests and should scale to zero when not in use. The application is stateless and has a lightweight container image. Which Google Cloud compute service should be used?

A.Compute Engine with a single VM
B.Cloud Functions
C.Cloud Run
D.Google Kubernetes Engine (GKE) Standard cluster
AnswerC

Cloud Run is a managed serverless container platform that executes your container image on demand, automatically scaling instances from zero to thousands based on incoming HTTP traffic and billing only for resources used during request processing. It is purpose-built for stateless HTTP workloads and supports common features like health checks, environment variables, secrets, and gRPC, all without requiring you to provision or manage any servers. For a containerized web application, this directly satisfies the requirement with minimal operational effort and can scale to zero when idle.

Why this answer

Cloud Run is a fully managed serverless platform that scales to zero when no requests are coming in, and bills per request. It is ideal for stateless HTTP-triggered container workloads.

562
Multi-Selecthard

An engineer needs to create a new project and set up the environment. They are using the gcloud command-line tool. Which two commands are required to create a project and link it to a billing account? (Choose TWO.)

Select 2 answers
A.gcloud billing projects link PROJECT_ID --billing-account=BILLING_ACCOUNT_ID
B.gcloud projects create PROJECT_ID
C.gcloud alpha billing accounts create
D.gcloud services enable cloudbilling.googleapis.com
E.gcloud config set project PROJECT_ID
AnswersA, B

This command explicitly associates a specified project with a specified billing account. It is the standard gcloud operation for setting up the billing relationship after project creation, enabling the project to consume paid services. The command requires both the project ID and the billing account ID as arguments, and it performs an API call to the Cloud Billing API. Once run, the project's billing is active and can be used for resource consumption.

Why this answer

To create a project and link a billing account, you need to create the project (gcloud projects create) and then link the billing account (gcloud billing projects link).

563
MCQmedium

A platform team needs to categorize GCP resources for policy enforcement (e.g., applying IAM conditions only to resources tagged 'environment:production'). Labels exist but don't support IAM conditions. What feature provides policy-tag-based enforcement?

A.Resource labels — set environment=production on each resource and reference in IAM conditions
B.Resource Manager Tags — attach a tag with key 'environment' and value 'production' and reference it in IAM conditions
C.Cloud Asset Inventory metadata fields — query by label and apply policies
D.Pub/Sub event-driven policy application triggered by label changes
AnswerB

Resource Manager Tags are hierarchical key-value pairs that can be attached to projects, folders, and individual resources such as Compute Engine instances. When a tag with key 'environment' and value 'production' is attached, it becomes visible in IAM policy binding conditions through the `resource.getTagKeys()` and `resource.getTagValue()` functions, enabling attribute-based access control. This approach is declarative, preventive, and evaluated at every API request, so it correctly fulfills the requirement to allow access only to production resources.

Why this answer

Resource Manager Tags are the GCP feature specifically designed to support IAM conditions for policy enforcement. Unlike resource labels, which are simple key-value pairs used for metadata and billing, Resource Manager Tags can be referenced in IAM condition expressions using the `resource.matchTag` function, enabling fine-grained access control based on tag values such as 'environment:production'.

Exam trap

Google Cloud often tests the distinction between resource labels and Resource Manager Tags, trapping candidates who assume labels can be used in IAM conditions because they are more commonly used for resource organization.

How to eliminate wrong answers

Option A is wrong because resource labels cannot be used in IAM conditions; they are only for metadata, billing, and filtering, not for policy enforcement. Option C is wrong because Cloud Asset Inventory metadata fields are used for asset discovery and inventory, not for real-time policy enforcement via IAM conditions. Option D is wrong because Pub/Sub event-driven policy application is an architectural pattern, not a native GCP feature for tag-based IAM conditions, and label changes do not trigger IAM condition updates.

564
MCQhard

A CI/CD pipeline running outside GCP (on GitHub Actions) needs to authenticate to GCP to push images to Artifact Registry, without storing any long-lived service account key files. Which authentication mechanism achieves this?

A.Store a service account JSON key as a GitHub Actions secret and use it in the workflow
B.Workload Identity Federation with GitHub Actions as the identity provider
C.OAuth 2.0 user credentials from a developer's Google account
D.API keys created for the Artifact Registry service
AnswerB

Workload Identity Federation lets GitHub Actions present its native OIDC token to a Workload Identity Pool provider; the Security Token Service exchanges it for a short-lived Google-issued access token. The workflow then impersonates a service account via IAM bindings without ever creating or storing a service account key file. Conditional attribute mappings can restrict which repositories, branches, or jobs are allowed to impersonate the identity.

Why this answer

Workload Identity Federation allows a GitHub Actions workflow to exchange a GitHub-issued OIDC token for a GCP access token, enabling authentication to Artifact Registry without storing any long-lived service account keys. This is the recommended approach for non-GCP CI/CD systems because it eliminates the security risk of managing static credentials while still granting fine-grained, short-lived access to GCP resources.

Exam trap

The trap here is that candidates often default to storing a service account key as a secret (Option A) because it's a familiar pattern, failing to recognize that Workload Identity Federation is the modern, keyless alternative specifically designed for external CI/CD providers like GitHub Actions.

How to eliminate wrong answers

Option A is wrong because storing a service account JSON key as a GitHub Actions secret still introduces a long-lived, static credential that must be rotated and managed, violating the requirement to avoid storing any long-lived service account key files. Option C is wrong because OAuth 2.0 user credentials from a developer's Google account are tied to a human user, not a CI/CD pipeline, and would require interactive consent flows, making them unsuitable for automated, non-interactive workflows. Option D is wrong because API keys are a simple, static authentication mechanism that do not support fine-grained IAM roles or short-lived tokens, and they are not designed for service-to-service authentication to Artifact Registry; they also cannot be scoped to a specific service account.

565
MCQmedium

You are configuring an uptime check for an HTTPS endpoint that returns a JSON response. The check should validate that the response contains a specific field "status":"ok". Which uptime check option should you use?

A.Enable SSL hostname verification
B.Configure a notification channel
C.Add a content match with a regular expression
D.Create a log-based alert for the endpoint
AnswerC

Adding a content match with a regular expression is the direct way to verify a specific string pattern in the HTTPS response body. Cloud Monitoring uptime checks accept both substring and regex content matches, allowing you to assert that the page contains a particular marker or dynamic token. This confirms the endpoint is serving expected application content, not just a reachable server.

Why this answer

Uptime checks can validate response content using content matching.

566
MCQhard

A company is using Cloud NAT to allow private Compute Engine instances to access the internet. They notice that traffic from some instances is not being NATed. What is the most likely cause?

A.The instances have external IP addresses assigned.
B.The Cloud Router is not configured correctly.
C.The firewall rules block egress traffic.
D.The instances are in a different region than the Cloud NAT gateway.
AnswerA

Cloud NAT is designed to provide source network address translation for private instances that do not have external IP addresses. If an instance is assigned an external IP, even an ephemeral one, its outbound traffic will use that IP as the source address, completely bypassing Cloud NAT. Therefore, the observation that traffic is 'not being NATed' is exactly what would happen when instances have external IPs, not a sign of NAT misconfiguration.

Why this answer

Cloud NAT only applies to instances that do not have external IP addresses. If an instance has an external IP, it will use that IP for outbound traffic and bypass Cloud NAT.

567
MCQhard

Refer to the exhibit. An administrator wants to grant a service account read-only access to all Compute Engine instances in a project, but only those with label 'environment=production'. Which IAM policy configuration should be used?

A.roles/compute.instanceAdmin with condition 'resource.labels.environment == "production"'
B.roles/compute.viewer with condition 'resource.labels.environment == "production"'
C.roles/compute.imageUser with condition 'resource.labels.environment == "production"'
D.roles/compute.viewer with condition 'request.host == "production"'
AnswerB

The compute.viewer role provides read-only permissions for Compute Engine resources, including compute.instances.get, compute.instances.list, and similar operations. The IAM condition resource.labels.environment == "production" restricts the resource's access to only those instances carrying that exact label. This combination precisely meets the administrator's requirement: the service account can view production instances but cannot modify or delete them. The condition is evaluated at access time against the instance's labels, so unlabeled or differently labeled instances are excluded.

Why this answer

Roles/compute.viewer provides read-only access to Compute Engine resources, and the condition 'resource.labels.environment == "production"' restricts that access to only instances with the specified label. This satisfies the requirement of granting read-only access to production-labeled instances without granting broader permissions.

Exam trap

Google Cloud often tests the distinction between roles that grant read-only access (like roles/compute.viewer) versus roles that grant broader permissions (like roles/compute.instanceAdmin), and the use of correct condition attributes (resource.labels vs. request.host) to filter by resource labels.

How to eliminate wrong answers

Option A is wrong because roles/compute.instanceAdmin grants write permissions (e.g., start, stop, modify instances), which exceeds the required read-only access. Option C is wrong because roles/compute.imageUser only allows listing and using images, not reading instance metadata or configurations, so it does not provide the necessary read-only access to instances. Option D is wrong because 'request.host' is not a valid condition attribute for Compute Engine; the correct attribute for filtering by resource labels is 'resource.labels', and 'request.host' refers to the HTTP host header, which is irrelevant here.

568
Multi-Selecthard

Your GKE cluster is running an older version of Kubernetes. You need to upgrade the cluster's control plane and node pools. Which two steps should you perform? (Choose two.)

Select 2 answers
A.Create a new cluster with the desired version and migrate workloads
B.Drain all nodes using kubectl drain before upgrading
C.Manually update the kubelet version on each node
D.Upgrade the cluster's control plane using gcloud container clusters upgrade
E.Upgrade node pools using gcloud container node-pools upgrade
AnswersD, E

Upgrading the cluster's control plane with `gcloud container clusters upgrade` is the correct first step because GKE enforces a maximum version skew between the control plane and node pools—typically one minor version. The control plane must be on the target version before node pools can be upgraded, and this command without a `--node-pool` flag updates only the control plane. This ensures the Kubernetes API server and scheduler are consistent with the target version, reducing the risk of API deprecations or incompatibility. It is the only supported way to perform an in-place control plane upgrade while preserving cluster identity and state.

Why this answer

Upgrading a GKE cluster involves upgrading the cluster (control plane) first using gcloud container clusters upgrade, and then upgrading node pools separately (or they can be auto-upgraded). You cannot upgrade nodes without upgrading the control plane first. Draining nodes is not a step for upgrading, it's for maintenance.

569
MCQeasy

Which gcloud command lists all available roles that can be granted on a GCP project, including both predefined and custom roles?

A.`gcloud iam roles list --project=PROJECT_ID`
B.`gcloud iam list-grantable-roles //cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
C.`gcloud projects get-iam-policy PROJECT_ID`
D.`gcloud iam roles describe roles/editor`
AnswerB

The command `gcloud iam list-grantable-roles //cloudresourcemanager.googleapis.com/projects/PROJECT_ID` takes a canonical resource name and calls the IAM API's listGrantableRoles method, which returns every role—predefined and custom—that can be placed on that resource's IAM policy. For a project, the required canonical form is the Cloud Resource Manager resource name, prefixed with the service name. This is the only option that directly lists the full set of grantable roles for the project, making it the correct answer.

Why this answer

The `gcloud iam list-grantable-roles` command is specifically designed to list all roles (both predefined and custom) that can be granted on a given resource, such as a GCP project. The resource is identified by its canonical name, which for a project is `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`. This command returns roles that are eligible for binding at that resource level, including those inherited from ancestors.

Exam trap

Google Cloud often tests the distinction between listing roles that *can* be granted (grantable roles) versus listing roles that *are* granted (current bindings), and candidates confuse `gcloud iam roles list` (custom roles only) with the correct command for all grantable roles.

How to eliminate wrong answers

Option A is wrong because `gcloud iam roles list --project=PROJECT_ID` lists only custom roles defined in that project, not predefined roles or roles inherited from the organization. Option C is wrong because `gcloud projects get-iam-policy PROJECT_ID` retrieves the current IAM policy bindings (who has what role), not the list of all available roles that can be granted. Option D is wrong because `gcloud iam roles describe roles/editor` shows details of a single predefined role (Editor), not a list of all grantable roles on a project.

570
MCQhard

A company's Google Kubernetes Engine cluster has experienced a sudden increase in latency. The team suspects a misconfigured node pool is causing resource contention. They want to verify the node's resource usage. Which command or tool should they use?

A.Run 'gcloud container clusters describe cluster-name'.
B.Run 'kubectl top nodes'.
C.Use the Cloud Console Monitoring page to view node metrics.
D.Run 'kubectl describe node node-name'.
AnswerB

This is the correct command because it queries the Metrics Server API, which aggregates metrics from kubelets on each node and reports current CPU and memory usage, including percentages of allocatable capacity. It provides a concise per-node summary directly in the terminal, making it the fastest native CLI way to assess live node utilization in the cluster.

Why this answer

B is correct because 'kubectl top nodes' directly displays real-time CPU and memory usage for each node in the cluster, which is the fastest way to identify resource contention causing latency. This command leverages the metrics-server to aggregate resource metrics from kubelets, giving immediate insight into node-level utilization without additional overhead.

Exam trap

The trap here is that candidates confuse 'kubectl describe node' (which shows static capacity and requests) with 'kubectl top nodes' (which shows actual live usage), leading them to choose D when they need real-time utilization data.

How to eliminate wrong answers

Option A is wrong because 'gcloud container clusters describe cluster-name' returns static cluster configuration metadata (e.g., zone, node count, network settings) but does not provide live resource usage metrics. Option C is wrong because the Cloud Console Monitoring page offers historical and aggregated metrics with dashboards, but it is not a direct command-line tool for quick verification; it requires navigating the UI and may have a delay in data ingestion. Option D is wrong because 'kubectl describe node node-name' shows node conditions, capacity, and allocated resources, but it does not show real-time usage; it reports requests and limits, not actual consumption, so it cannot confirm current resource contention.

571
MCQeasy

A security auditor needs read-only access to Compute Engine instance metadata but should not be able to start or stop instances. Which predefined IAM role should be assigned?

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

roles/compute.viewer is the correct predefined IAM role for a read-only security auditor because it grants only list and get permissions for all Compute Engine resources, including instances, disks, snapshots, images, and instance metadata. It does not include any mutating operations such as start, stop, delete, or modify, nor does it allow changes to IAM policy. This role satisfies the auditor's requirement to inspect the environment without risking unintended changes.

Why this answer

The roles/compute.viewer role grants read-only access to Compute Engine resources, including instance metadata, without allowing write operations such as starting or stopping instances. This matches the requirement for read-only metadata access while preventing instance lifecycle changes.

Exam trap

The trap here is that candidates may confuse 'viewer' with broader roles like instanceAdmin.v1, assuming read-only access is sufficient, but fail to recognize that instanceAdmin.v1 includes write permissions for starting/stopping instances.

How to eliminate wrong answers

Option A is wrong because roles/compute.instanceAdmin.v1 includes permissions to start, stop, and modify instances, which exceeds the required read-only access. Option B is wrong because roles/compute.admin provides full administrative control over all Compute Engine resources, including the ability to start and stop instances. Option C is wrong because roles/compute.networkAdmin focuses on network resources (e.g., firewalls, routes) and does not grant access to instance metadata.

572
MCQhard

A team's Cloud SQL for PostgreSQL instance is running out of disk space. Automated storage increase is disabled. A monitoring alert fires at 90% disk usage. What is the fastest safe action to increase storage?

A.Delete old records from the database to free space — no instance changes needed
B.Increase storage capacity using `gcloud sql instances patch --storage-size=[NEW_SIZE]` without downtime
C.Create a new larger Cloud SQL instance and migrate data with Cloud Database Migration Service
D.Enable automatic storage increase and wait — Cloud SQL will expand the disk retroactively
AnswerB

Cloud SQL supports online storage increases without an instance restart or downtime. Running `gcloud sql instances patch [INSTANCE_NAME] --storage-size=[NEW_SIZE]` modifies the persistent disk capacity in place, and the instance continues serving reads and writes during the operation. This directly resolves the immediate capacity alarm for a production database, making it the correct first response among the options.

Why this answer

Cloud SQL for PostgreSQL supports online storage resizing without downtime. Using `gcloud sql instances patch --storage-size=[NEW_SIZE]` allows you to increase the allocated disk capacity while the instance remains fully operational, making it the fastest safe action when automated storage increase is disabled.

Exam trap

Google Cloud often tests the misconception that deleting data frees up provisioned storage in managed database services, when in fact the allocated disk size remains unchanged and must be explicitly increased via a resize operation.

How to eliminate wrong answers

Option A is wrong because deleting old records does not release disk space back to the operating system in Cloud SQL PostgreSQL; the space is retained by the database for future writes and does not reduce the provisioned storage size. Option C is wrong because creating a new larger instance and migrating data with Cloud Database Migration Service introduces significant downtime and operational complexity, which is slower and riskier than a simple online storage resize. Option D is wrong because enabling automatic storage increase does not retroactively expand the disk; it only allows future automatic expansions, and the instance is already at 90% usage with no immediate relief.

573
MCQmedium

An application architect is comparing Cloud SQL (PostgreSQL) and Cloud Spanner for a new global e-commerce platform. The platform must serve customers on three continents with <50ms latency for reads and strong consistency for inventory updates. Which service best fits?

A.Cloud SQL with one primary instance and cross-region read replicas
B.Cloud Spanner multi-region configuration
C.Cloud Firestore in multi-region mode
D.Cloud SQL with Cloud Memorystore caching layer for reads
AnswerB

Cloud Spanner is a fully managed relational database that synchronously replicates data across regions, using TrueTime and Paxos to deliver external consistency for reads and writes. A multi-region configuration can be placed in the three required continents, allowing strongly consistent transactions to commit with lower latency than a single primary and letting local read replicas serve fresh data. It supports ANSI SQL and ACID transactions, so the existing e-commerce application can keep its relational schema.

Why this answer

Cloud Spanner multi-region configuration is the correct choice because it provides strong global consistency with <50ms read latency across continents, which is essential for an e-commerce platform requiring real-time inventory updates. Spanner uses TrueTime and Paxos-based replication to ensure ACID transactions globally, meeting both the latency and consistency requirements simultaneously.

Exam trap

Google Cloud often tests the misconception that read replicas or caching layers can provide strong consistency globally, but only Spanner's synchronous replication and TrueTime guarantee ACID transactions across continents.

How to eliminate wrong answers

Option A is wrong because Cloud SQL cross-region read replicas are asynchronous, meaning they can serve stale data and do not provide strong consistency for inventory updates across continents. Option C is wrong because Cloud Firestore in multi-region mode offers strong consistency but is designed for NoSQL workloads and lacks the relational capabilities (e.g., joins, transactions) typically needed for complex e-commerce inventory systems. Option D is wrong because Cloud Memorystore caching layer for reads does not solve the strong consistency requirement for writes; it only improves read latency but cannot guarantee that inventory updates are immediately consistent across regions.

574
MCQeasy

Your team uses Cloud Logging to store application logs. You want to create a metric that counts the number of ERROR log entries per service. Which type of log-based metric should you create?

A.Distribution metric
B.Boolean metric
C.Counter metric
D.Gauge metric
AnswerC

A counter metric is the correct log-based metric type for this use case, because it increments by one for every log entry that matches the specified filter, such as severity=ERROR. This gives the total number of error logs over the selected time window, which is exactly what the team wants to track. In Cloud Logging, you define a counter-based log metric with a filter and then use it in Monitoring charts or alerts.

Why this answer

Log-based metrics can be counter metrics (count of log entries matching a filter) or distribution metrics. For counting occurrences, a counter metric is appropriate.

575
MCQeasy

A startup runs its application entirely on Cloud Run. They want to use a custom domain (api.mycompany.com) instead of the default Cloud Run URL. Which GCP feature maps a custom domain to a Cloud Run service?

A.Cloud DNS — create a CNAME record pointing to the Cloud Run URL
B.Cloud Run Domain Mappings or a Global Load Balancer with a Serverless NEG
C.Cloud Endpoints with an API gateway configuration
D.Firebase Hosting rewrites to Cloud Run
AnswerB

Cloud Run Domain Mappings and a Global Load Balancer with a Serverless NEG are both valid, production-ready approaches. Domain Mappings offer the simplest path for a single service: you verify the domain, and Cloud Run automatically provisions a Google-managed TLS certificate. The load balancer approach is better when you need advanced routing, multi-region failover, or CDN/WAF features; a Serverless NEG allows the global external Application Load Balancer to direct traffic to your Cloud Run service. Choose based on whether you need basic custom-domain support or full-fledged edge routing.

Why this answer

Cloud Run Domain Mappings provide a native, managed way to map a custom domain to a Cloud Run service without additional infrastructure. Alternatively, a Global Load Balancer with a Serverless NEG (Network Endpoint Group) can also route traffic from a custom domain to Cloud Run, offering advanced features like SSL termination and traffic splitting. Both approaches are officially supported by Google Cloud for custom domain mapping.

Exam trap

The trap here is that candidates often assume a simple DNS CNAME record is sufficient, but Cloud Run requires domain ownership verification and SSL certificate management, which only Domain Mappings or a Load Balancer with Serverless NEG provide.

How to eliminate wrong answers

Option A is wrong because a CNAME record in Cloud DNS alone cannot map a custom domain to Cloud Run; Cloud Run requires verification of domain ownership and SSL certificate provisioning, which a simple CNAME does not handle. Option C is wrong because Cloud Endpoints with an API gateway configuration is designed for managing, securing, and monitoring APIs, not for mapping a custom domain to a Cloud Run service; it operates at a higher layer and does not replace the need for domain mapping. Option D is wrong because Firebase Hosting rewrites to Cloud Run are a feature of Firebase Hosting, not a direct GCP feature for mapping a custom domain to Cloud Run; it introduces an unnecessary intermediary and is not the standard approach for a standalone Cloud Run service.

576
MCQhard

A team runs `gcloud organizations list` and sees no output even though they know their company has a GCP organization. What is the most likely cause, and how should they resolve it?

A.The organization does not exist yet; run `gcloud organizations create` to create it.
B.The user lacks org-level IAM permissions such as Organization Viewer.
C.The gcloud SDK does not support the organizations command; use the Cloud Console instead.
D.The project must be linked to the organization using `gcloud projects move`.
AnswerB

Correct: `gcloud organizations list` calls the `resourcemanager.organizations.list` API, which returns only organizations where the caller has permission such as `resourcemanager.organizations.get`. The Organization Viewer role includes this permission, and without it the command exits successfully but shows no rows. An organization admin must grant the user an appropriate IAM role at the organization node for the organization to become visible.

Why this answer

The `gcloud organizations list` command retrieves organizations from the GCP Resource Manager API. If no output is returned despite the organization existing, the most likely cause is that the authenticated user lacks the `resourcemanager.organizations.get` permission, which is granted by roles like Organization Viewer (`roles/resourcemanager.organizationViewer`) or Organization Administrator (`roles/resourcemanager.organizationAdmin`). Without this IAM permission at the organization level, the API call returns an empty list rather than an error, which is a common source of confusion.

Exam trap

The trap here is that candidates assume a missing organization or a command limitation, when in fact the empty output is a deliberate API behavior designed to hide organizations from users without explicit permission, testing the understanding of IAM scoping and the difference between list and describe commands.

How to eliminate wrong answers

Option A is wrong because `gcloud organizations create` is not a valid command; GCP organizations are created automatically when a Google Workspace or Cloud Identity account is set up, not via the gcloud CLI. Option C is wrong because the `gcloud organizations` command is fully supported in the gcloud SDK and uses the Resource Manager API; the Cloud Console is not required. Option D is wrong because linking a project to an organization is unrelated to listing organizations; the issue is about visibility of the organization itself, not project association.

577
MCQmedium

A security engineer needs to ensure that Compute Engine instances in a VPC can only communicate with each other on port 443 and cannot receive traffic from the internet. The VPC has a default network with default firewall rules. What should the engineer do?

A.Create a firewall rule with priority 2000 denying ingress from 0.0.0.0/0 and a rule allowing ingress from 10.0.0.0/16 on port 443 with priority 1000.
B.Create a firewall rule with priority 1000 allowing ingress from 0.0.0.0/0 on port 443 and deny all other traffic.
C.Delete all default firewall rules and create a rule allowing ingress from the VPC's subnet range (e.g., 10.0.0.0/16) on port 443.
D.Modify the default-allow-internal rule to only allow port 443.
AnswerC

Correct: Deleting default rules removes internet ingress and the default allow-all-internal rule. New rule restricts internal communication to port 443.

Why this answer

The default VPC includes default firewall rules that allow ingress from the internet and allow all internal traffic. To restrict communication, the engineer must first delete the default ingress rule that allows all traffic from the internet (allow-ssh, allow-icmp, allow-rdp, and allow-http/https can be deleted), then create a new rule that allows ingress only from the VPC's IP range on port 443. The default internal rule allows all traffic within the network; to restrict to port 443, a new rule with higher priority can override it, or the default rule can be deleted and a new one created.

578
MCQeasy

A team needs a database backup job to run every day at 2 AM UTC. The job calls an HTTP endpoint to trigger the backup. The endpoint requires no complex orchestration — just a timed HTTP call. Which GCP service handles this most simply?

A.Cloud Tasks with a daily task enqueued by a Cloud Function
B.Cloud Scheduler with an HTTP target pointing to the backup endpoint
C.Cloud Composer DAG running at 2 AM UTC
D.Cloud Run Jobs triggered by a Cloud Monitoring alert at 2 AM
AnswerB

Cloud Scheduler is Google Cloud's fully managed cron service, designed specifically to fire off a single HTTP request on a fixed schedule. With a JSON payload and optional OIDC authentication, it can invoke your backup endpoint at 2 AM UTC daily with zero additional infrastructure to manage. It also offers built-in retries and execution logs, but for a simple scheduled HTTP call, no other service or custom code is required — making it the minimal, correct choice.

Why this answer

Cloud Scheduler is the simplest GCP service for a recurring HTTP call because it is a fully managed cron job service that directly supports HTTP targets. You configure a schedule (e.g., '0 2 * * *' for daily at 2 AM UTC) and point it to the backup endpoint URL. No additional code, queue, or orchestration is needed, making it the most straightforward solution for this use case.

Exam trap

The trap here is that candidates overcomplicate the solution by choosing Cloud Tasks (A) or Cloud Composer (C) because they assume a 'job' requires a queue or orchestration, when Cloud Scheduler's HTTP target is the simplest and most direct fit for a single timed HTTP call.

How to eliminate wrong answers

Option A is wrong because Cloud Tasks is a task queue/distributed execution service, not a scheduler; you would still need Cloud Scheduler or a separate trigger to enqueue the task daily, adding unnecessary complexity. Option C is wrong because Cloud Composer (Apache Airflow) is a full workflow orchestration platform designed for complex, multi-step pipelines with dependencies, not for a simple timed HTTP call — it introduces heavy overhead and cost. Option D is wrong because Cloud Monitoring alerts are for reacting to metric thresholds or system states, not for scheduling recurring actions; using an alert to trigger a job at a fixed time is an incorrect architectural pattern and would require a custom metric or log-based alert, which is convoluted and unreliable for simple cron-like scheduling.

579
MCQeasy

A compliance archive stores legal documents accessed at most once per quarter. Which Cloud Storage class minimizes storage cost while meeting that access pattern?

A.Standard
B.Nearline
C.Coldline
D.Archive
AnswerC

Coldline is designed for data accessed no more than once per quarter, exactly matching the stated requirement. It offers a low storage cost to minimize spend on long-term retention, with a 90-day minimum storage duration that aligns well with quarterly access. Although retrieval fees are higher than Standard or Nearline, the infrequent access makes Coldline the most cost-effective choice here.

Why this answer

Coldline storage is designed for data accessed less than once per quarter, offering lower storage costs than Standard or Nearline while still providing millisecond access when needed. For a compliance archive accessed at most once per quarter, Coldline minimizes storage cost without incurring the higher retrieval fees or minimum storage durations of Archive storage.

Exam trap

Google Cloud often tests the misconception that Archive is always the cheapest option for infrequently accessed data, ignoring the minimum storage duration and retrieval costs that can make Coldline more cost-effective for quarterly access patterns.

How to eliminate wrong answers

Option A is wrong because Standard storage is optimized for frequently accessed data (multiple times per month) and has the highest storage cost, making it unsuitable for quarterly access. Option B is wrong because Nearline is intended for data accessed less than once per month, not once per quarter, and its storage cost is higher than Coldline for this access pattern. Option D is wrong because Archive storage, while having the lowest storage cost, imposes a 365-day minimum storage duration and higher retrieval fees, which is excessive for data accessed quarterly and may increase total cost if data is deleted early.

580
MCQhard

A healthcare company stores patient data in Cloud Storage. Compliance requires that even GCP (Google) cannot decrypt this data. The company manages encryption keys entirely on their own infrastructure. Which encryption option satisfies this?

A.Customer-Managed Encryption Keys (CMEK) stored in Cloud KMS
B.Customer-Supplied Encryption Keys (CSEK) provided with each API request
C.Google-managed encryption keys (default) with restricted IAM policies
D.Shielded VM with confidential computing for the VMs that access the data
AnswerB

CSEK requires the customer to supply the encryption key with every API request. GCP uses the key transiently and never stores it — Google cannot access data without the customer providing the key each time.

Why this answer

Customer-Supplied Encryption Keys (CSEK) allow the customer to provide their own AES-256 encryption key with each API request to Cloud Storage. Google does not store the key; it is used only in memory to encrypt/decrypt the data and then discarded, ensuring that even Google cannot access the plaintext. This meets the compliance requirement that the customer retains exclusive control over the encryption keys.

Exam trap

The trap here is that candidates confuse CMEK with CSEK, assuming that managing keys in Cloud KMS gives the customer exclusive control, but CMEK still allows Google to access the key material via the KMS service, whereas CSEK ensures Google never stores the key.

How to eliminate wrong answers

Option A is wrong because Customer-Managed Encryption Keys (CMEK) are stored in Cloud KMS, which means Google manages the key material in a hardware security module (HSM) and can technically decrypt the data if required by law or internal policy. Option C is wrong because Google-managed encryption keys are fully controlled by Google, and restricting IAM policies does not prevent Google from accessing the keys or decrypting the data. Option D is wrong because Shielded VM with confidential computing protects data in use within VM memory, but does not address encryption at rest in Cloud Storage or key management; the data in Cloud Storage would still be encrypted with keys accessible to Google.

581
MCQmedium

A team is using Terraform to manage Google Cloud infrastructure. They want to store Terraform state files in a remote backend that supports locking to prevent concurrent modifications. Which backend should they use?

A.Cloud Storage
B.Cloud Source Repositories
C.Cloud Shell
D.Cloud Bigtable
AnswerA

Cloud Storage is a fully supported Terraform remote backend for Google Cloud. When you configure a GCS bucket as a backend, Terraform stores the state file in the bucket, which lets multiple team members access the same state. The backend automatically uses an object lock to prevent concurrent writes, and you can enable bucket versioning to keep a history of state changes, which is essential for rollback and recovery. Additionally, the bucket can be secured with IAM policies, encryption at rest, and access logging.

Why this answer

Google Cloud Storage (GCS) is the recommended backend for Terraform on GCP. It supports state locking via object versioning and a lock mechanism (using the state lock table in a GCS bucket). Cloud Shell is not a backend.

Cloud Source Repositories is for source code. Bigtable is for NoSQL workloads.

582
MCQhard

You are managing Terraform state for a GCP infrastructure project shared by a team of 5 engineers. You need to prevent simultaneous `terraform apply` operations from causing state corruption. What is the recommended backend configuration?

A.Store state locally on each engineer's machine and merge state files manually after each apply.
B.Configure the `gcs` backend in Terraform, pointing to a Cloud Storage bucket with versioning enabled.
C.Use Terraform Cloud (HashiCorp) as the backend for state locking.
D.Use a Cloud Source Repository to store state files with branch-based locking.
AnswerB

The gcs backend stores Terraform state in a Cloud Storage bucket, which automatically enables state locking via the bucket's object semantics. While one apply is running, a lock is held so a second 'terraform apply' fails with a lock error, preventing concurrent destructive changes. Enabling versioning on the bucket preserves prior state generations, giving you a rollback path if a state update is corrupted or incorrect.

Why this answer

The `gcs` backend with versioning enabled provides both remote state storage and built-in state locking via Cloud Storage's object-level consistency model. When one engineer runs `terraform apply`, the backend acquires a lock by writing a lock file to the bucket; other concurrent operations are blocked until the lock is released, preventing state corruption. Versioning further protects against accidental state deletion or corruption by allowing rollback to previous state versions.

Exam trap

Google Cloud often tests the distinction between a remote backend that supports locking (like `gcs` or `s3`) versus a remote backend that only stores state (like `consul` without locking or a plain HTTP backend), and the trap here is that candidates may think any remote storage (like Cloud Source Repository) or a third-party service (like Terraform Cloud) is equally valid, when the question specifically requires a GCP-native solution with locking.

How to eliminate wrong answers

Option A is wrong because storing state locally on each engineer's machine and manually merging state files is error-prone, does not provide any locking mechanism, and directly contradicts Terraform's recommended practice of using a remote backend for team collaboration. Option C is wrong because Terraform Cloud is a HashiCorp product, not a GCP-native service, and while it does provide state locking, the question specifically asks for a 'recommended backend configuration' within the context of a GCP infrastructure project — the `gcs` backend is the GCP-native solution. Option D is wrong because Cloud Source Repository is a Git repository service, not a Terraform state backend; it does not support state locking or the Terraform state API, and branch-based locking is not a concept Terraform recognizes for state management.

583
MCQhard

A company is deploying a multi-region application on Google Kubernetes Engine (GKE) with clusters in us-central1 and europe-west1. They want to route user traffic to the closest healthy cluster using a global load balancer with SSL termination. Which load balancing service should they use?

A.Internal Load Balancer
B.SSL Proxy Load Balancer
C.External TCP/UDP Network Load Balancer
D.External HTTPS Load Balancer with a global backend service (using NEGs)
AnswerD

This load balancer can route to multiple backends across regions and terminate SSL.

Why this answer

D is correct because the External HTTPS Load Balancer with a global backend service using Network Endpoint Groups (NEGs) provides global anycast IP, SSL termination, and traffic routing to the closest healthy GKE cluster via Google's global network. This meets the requirement for multi-region GKE clusters with automatic failover and low latency.

Exam trap

The trap here is that candidates often confuse regional load balancers (like SSL Proxy or TCP/UDP Network LB) with global ones, mistakenly thinking SSL termination alone is sufficient, but the key requirement for multi-region routing to the closest cluster demands a global load balancer with a global backend service.

How to eliminate wrong answers

Option A is wrong because an Internal Load Balancer is regional and cannot route traffic globally or terminate SSL for external users. Option B is wrong because the SSL Proxy Load Balancer, while supporting SSL termination, is a regional proxy-based load balancer and does not provide global anycast routing to the closest healthy cluster; it is designed for non-HTTP(S) traffic. Option C is wrong because the External TCP/UDP Network Load Balancer is a regional, passthrough load balancer that does not support SSL termination and cannot route traffic to the closest healthy cluster across regions.

584
MCQhard

A SaaS company serves 200 enterprise customers, each requiring complete data isolation in separate databases. The company needs to provision a new customer database within minutes and manage 200 databases with minimal overhead. Which GCP approach scales most efficiently?

A.200 separate Cloud SQL instances, one per customer
B.A single Cloud SQL instance with a separate schema (database) per customer, provisioned via API automation
C.Storing all customer data in a single shared database with customer_id as a discriminator column
D.Using BigQuery with a separate dataset per customer
AnswerB

A single Cloud SQL instance with a separate schema (database) per customer gives each tenant its own isolated set of tables while sharing the underlying compute and storage resources. Because schemas are logical constructs, a customer can be provisioned in sub-minute time via API calls (e.g., using the Cloud SQL Admin API or Terraform) without restarting the instance or creating a new instance. This design strikes a practical balance: tenant data is separated at the query layer, so a cross-schema error is far less likely than with a shared table, while costs and operational effort stay manageable because you run and maintain only one instance and its connection endpoints.

Why this answer

It uses a single Cloud SQL instance with separate schemas (databases) per customer, which allows you to achieve complete data isolation while minimizing overhead. Provisioning a new schema via API automation takes seconds, and managing 200 schemas on one instance is far more efficient than managing 200 separate instances. This approach scales efficiently because Cloud SQL supports up to 10,000 databases per instance, and you can leverage connection pooling and shared resources without sacrificing isolation.

Exam trap

The trap here is that candidates often confuse 'data isolation' with 'physical separation' and assume separate instances are required, but GCP's Cloud SQL supports logical isolation via separate databases on a single instance, which is far more efficient and still meets the isolation requirement.

How to eliminate wrong answers

Option A is wrong because managing 200 separate Cloud SQL instances introduces massive operational overhead, including patching, backups, and monitoring each instance individually, and it does not scale efficiently for provisioning within minutes. Option C is wrong because storing all customer data in a single shared table with a customer_id discriminator violates the requirement for complete data isolation, as a query error or bug could expose data across customers. Option D is wrong because BigQuery is a data warehouse designed for analytics, not for transactional, low-latency database operations required by a SaaS application, and provisioning a new dataset does not provide the same isolation or performance characteristics as a relational database schema.

585
MCQmedium

A team is building a real-time multiplayer game backend requiring low-latency state synchronization between players worldwide. Session data must persist for the duration of a game (up to 2 hours) but doesn't need long-term storage. Which managed service best fits?

A.Cloud SQL for PostgreSQL with connection pooling
B.Cloud Memorystore for Redis
C.Cloud Bigtable
D.Cloud Firestore in Native mode
AnswerB

Cloud Memorystore for Redis is a fully managed in-memory data store that delivers sub-millisecond latency, making it ideal for real-time game session state. Its native key expiration (TTL) automatically clears stale sessions, and the Redis data structure server supports complex session objects such as hashes or sorted sets. Unlike persistent databases, Memorystore is designed for high-throughput, low-latency read/write workloads with occasional data loss tolerated, perfectly matching ephemeral state requirements.

Why this answer

Cloud Memorystore for Redis is the best fit because it provides an in-memory data store with sub-millisecond latency, ideal for real-time state synchronization in a multiplayer game. Redis supports data structures like sets and sorted sets for leaderboards or session state, and its optional persistence (RDB/AOF) can cover the 2-hour game duration without needing long-term storage. This aligns with the requirement for low-latency, ephemeral session data that must survive only the game session.

Exam trap

Google Cloud often tests the distinction between in-memory caches (Redis) and persistent databases (Cloud SQL, Bigtable, Firestore), where candidates mistakenly choose a database with real-time features (like Firestore) without recognizing that its latency and consistency model are insufficient for sub-millisecond state synchronization.

How to eliminate wrong answers

Option A is wrong because Cloud SQL for PostgreSQL is a relational database with disk-based storage, incurring higher latency (typically 5-10 ms) unsuitable for real-time state synchronization, and connection pooling does not address the fundamental latency or in-memory performance need. Option C is wrong because Cloud Bigtable is a wide-column NoSQL database optimized for large-scale analytical workloads (e.g., time-series data) with high throughput but not sub-millisecond latency for frequent read/write operations in a real-time game; it also requires a cluster and is overkill for ephemeral session data. Option D is wrong because Cloud Firestore in Native mode is a document database with real-time listeners but has higher latency (typically 10-100 ms) and is designed for persistent, scalable app data, not for ultra-low-latency, short-lived session state; its eventual consistency model can also cause synchronization issues in a fast-paced game.

586
MCQmedium

You want to use Kustomize to manage environment-specific Kubernetes configurations (dev, staging, prod) from a single base set of manifests. How does Kustomize achieve environment customization without duplicating YAML files?

A.Kustomize duplicates all YAML files per environment, then applies find-and-replace on values.
B.Kustomize uses overlays that patch a shared base: environment-specific differences are expressed as patches without duplicating base manifests.
C.Kustomize uses Helm charts with values files per environment for templating.
D.Kustomize requires a separate Git branch per environment where manifests are committed.
AnswerB

Kustomize organizes Kubernetes manifests as a shared base and environment-specific overlays. The base contains common full resource definitions (Deployment, Service, ConfigMap), while each overlay—for example, dev, staging, or production—contains only the differences to apply, such as the image tag, replica count, or a ConfigMap value. These differences are expressed as patches in the overlay's kustomization.yaml, and running `kubectl apply -k` reads the overlay, fetches the base, and merges them to produce the final, environment-specific manifests.

Why this answer

Kustomize uses a base set of Kubernetes manifests and applies environment-specific overlays that contain patches. These patches modify only the differences (e.g., replicas, image tags, namespaces) without copying or altering the original base YAML files. This approach avoids duplication and keeps the base clean, with each overlay representing a distinct environment.

Exam trap

Google Cloud often tests the distinction between Kustomize's overlay/patch model and Helm's templating approach, so the trap is assuming any configuration management tool uses find-and-replace or requires separate branches.

How to eliminate wrong answers

Option A is wrong because Kustomize does not duplicate YAML files per environment; it uses a layered overlay model with patches, not find-and-replace. Option C is wrong because Helm charts use templating with values files, which is a different tool; Kustomize is template-free and relies on pure YAML patching. Option D is wrong because Kustomize does not require separate Git branches; it manages environments within the same repository using overlay directories.

587
MCQhard

Your GKE cluster has a node pool that you want to enable autoscaling on. The initial node count is 3, and you want the cluster to scale between 1 and 10 nodes. Which command should you use?

A.gcloud container clusters update my-cluster --enable-autoscaling --min-nodes 1 --max-nodes 10 --region us-central1
B.gcloud container clusters update my-cluster --enable-autoscaling --min-size 1 --max-size 10 --region us-central1
C.gcloud container node-pools update my-pool --cluster=my-cluster --enable-autoscaling --min-nodes 1 --max-nodes 10 --region us-central1
D.gcloud container node-pools update my-pool --cluster=my-cluster --autoscaling --min 1 --max 10 --region us-central1
AnswerC

This is the correct command because autoscaling is a node-pool-level feature. It uses `gcloud container node-pools update`, points at the specific pool with `--cluster=my-cluster`, and enables the Cluster Autoscaler with the valid `--enable-autoscaling` flag. The `--min-nodes 1 --max-nodes 10` range constrains the pool size, and `--region us-central1` correctly specifies the regional control plane where the cluster lives.

Why this answer

The correct command is gcloud container node-pools update with --enable-autoscaling and the min and max node flags. The cluster name and region/zone are required.

588
MCQmedium

A production GKE cluster is running low on node resources. Pods are in Pending state because no node has sufficient CPU or memory. Without deleting existing Pods, what is the fastest way to resolve this?

A.Resize the node pool to add more nodes: `gcloud container clusters resize`
B.Delete existing Pods to free resources for the Pending Pods
C.Change the Pending Pods' resource requests to zero
D.Upgrade the Kubernetes control plane version
AnswerA

Resizing the node pool with `gcloud container clusters resize CLUSTER --node-pool=POOL --num-nodes=N` immediately adds worker nodes, increasing the cluster's total allocatable CPU and memory so that Pending Pods can be scheduled. On GKE, if cluster autoscaler is enabled, it already performs this action automatically; manually resizing is the deterministic fallback. Resizing is non-disruptive and does not terminate existing Pods, making it the ideal solution.

Why this answer

Resizing the node pool with `gcloud container clusters resize` immediately adds more nodes to the cluster, providing additional CPU and memory capacity. This allows the scheduler to place pending Pods without modifying or deleting existing workloads, making it the fastest solution that preserves running Pods.

Exam trap

Google Cloud often tests the misconception that upgrading the control plane or modifying Pod specs can resolve resource shortages, when in fact only adding nodes or reducing existing Pod resource usage addresses the capacity issue.

How to eliminate wrong answers

Option B is wrong because deleting existing Pods disrupts running workloads and does not guarantee that freed resources will be sufficient for pending Pods; it also violates the constraint of not deleting existing Pods. Option C is wrong because changing resource requests to zero bypasses Kubernetes resource guarantees, leading to potential resource starvation and unpredictable scheduling behavior, and it requires modifying Pod specs which is not a fast or safe resolution. Option D is wrong because upgrading the control plane version does not add compute resources; it updates the Kubernetes API server and controller manager but does not affect node capacity or scheduling of pending Pods.

589
MCQmedium

Instead of granting IAM roles to 50 individual developer email addresses, a team wants to manage access by team membership. When a developer joins or leaves, access updates automatically. What is the recommended approach?

A.Create a service account shared by all developers on the team
B.Grant IAM roles to a Google Group containing all team members
C.Create a GCP project per developer and use cross-project IAM bindings
D.Use Cloud Identity-Aware Proxy to manage team membership
AnswerB

Google Groups can be used as an IAM principal, and roles granted to the group apply to every member automatically. When team members are added to or removed from the group in the Google Admin console or Cloud Identity, their Google Cloud permissions update without anyone having to edit IAM policies directly. This centralizes membership management and avoids per-user service account key handling. It is the recommended pattern for human teams because it couples IAM role grants to an identity directory that already reflects the organization's structure.

Why this answer

Google Groups act as identity containers that can be granted IAM roles at the project or resource level. When developers are added to or removed from the group, their IAM permissions automatically update without requiring manual role changes for each individual user. This aligns with the principle of least privilege and simplifies access management at scale.

Exam trap

The trap here is that candidates often confuse service accounts with user identities or think that Cloud IAP can manage IAM roles, when in fact IAP only controls access to applications and not to GCP resource-level permissions.

How to eliminate wrong answers

Option A is wrong because sharing a service account among multiple developers violates security best practices — service accounts are intended for application-to-application authentication, not for individual user access, and sharing credentials eliminates audit trails and non-repudiation. Option C is wrong because creating a GCP project per developer introduces unnecessary overhead and complexity; cross-project IAM bindings still require managing individual identities and do not leverage group-based membership for automatic updates. Option D is wrong because Cloud Identity-Aware Proxy (IAP) controls access to applications at the HTTP/S layer, not to GCP IAM roles or resources; it does not replace IAM role management for cloud infrastructure permissions.

590
MCQeasy

What is the primary benefit of using a Google-managed SSL certificate for an HTTPS Load Balancer?

A.It is free of charge.
B.It automatically renews the certificate before expiration.
C.It can be used with any type of load balancer.
D.It provides stronger encryption than self-managed certificates.
AnswerB

Google-managed certificates automatically handle both provisioning and renewal, so you never have to manually track expiration dates or replace certificates. After you configure the certificate on an HTTPS target proxy, Google Cloud's certificate manager regularly checks the certificate's validity and renews it approximately 30 days before expiration, provided the domain's DNS record still points to the load balancer. This automation is the key advantage because it prevents outages caused by expired certificates.

Why this answer

Google-managed certificates automatically provision and renew SSL/TLS certificates, reducing manual effort and preventing expiration issues.

591
MCQmedium

A developer accidentally committed a service account key JSON file to a public GitHub repository. The key was valid for a service account with broad Editor permissions. What should you do FIRST?

A.Remove the committed file from Git history using `git filter-branch` or BFG Repo Cleaner.
B.Immediately delete or disable the service account key in the Cloud Console or via gcloud.
C.Make the GitHub repository private to hide the exposed key.
D.Reduce the service account's permissions to limit the blast radius.
AnswerB

Immediately deleting or disabling the service account key in the Cloud Console or with gcloud revokes the credential at the source, making it invalid for all OAuth token requests regardless of who possesses it. This is the highest-priority action because it stops ongoing unauthorized access in seconds and does not depend on how widely the key was distributed. After this containment step, you can investigate the exposure, rotate remaining keys, and audit usage logs without an active threat.

Why this answer

The immediate priority is to revoke the exposed credential to prevent unauthorized access. Deleting or disabling the service account key in the Cloud Console or via `gcloud iam service-accounts keys delete` ensures the key is invalidated within minutes, stopping any attacker from using it to authenticate with Google Cloud APIs. This aligns with the principle of least privilege and incident response best practices: contain the breach before remediation.

Exam trap

Google Cloud often tests the misconception that removing the file from Git history (Option A) is sufficient, but the key remains valid and usable by anyone who already has it, so revocation must come first.

How to eliminate wrong answers

Option A is wrong because removing the file from Git history does not invalidate the already-exposed key; an attacker who has already cloned the repository or accessed the commit can still use the key until it is revoked. Option C is wrong because making the repository private does not revoke the key or prevent attackers who have already seen the public commit from using it; the key remains valid. Option D is wrong because reducing the service account's permissions does not immediately stop an attacker who already has the key from using its current Editor permissions; the key must be disabled first to cut off access.

592
Multi-Selectmedium

A company wants to manage multiple Google Cloud projects and enforce consistent security policies across all of them. Which TWO resources should they use? (Choose two.)

Select 2 answers
A.Cloud Audit Logs
B.Organization policies
C.Shared VPC
D.Folders
E.Labels
AnswersB, D

Organization policies — The Organization Policy service is the correct mechanism for centrally governing multiple projects. It applies constraints like `compute.vmExternalIpAccess` or `iam.disableServiceAccountKeyCreation` at the organization, folder, or project level, and these constraints are inherited by all descendant resources. This provides a hierarchy-wide, enforceable governance layer that either permits or denies certain API calls before they execute. It directly meets the requirement to manage and enforce rules across all projects in the organization.

Why this answer

Organization policies are used to enforce constraints across projects. Folders allow grouping projects and applying common IAM policies.

593
MCQhard

Your company wants to track costs per department. Each department has its own project. You need to set up a budget alert in the billing account for each project. What is the most efficient approach?

A.Use Billing Export to BigQuery and create custom alerts using Cloud Monitoring.
B.Create one budget per project by selecting the project in the 'Scoped to' field.
C.Create a budget for each project by manually enabling billing for each project.
D.Create a single budget for the entire billing account and rely on labels.
AnswerB

Creating one budget per project and setting the 'Scoped to' field to that project is the correct, efficient approach. In the Google Cloud console, budgets are created at the billing account level but can be scoped to a specific project, which allows the budget amount and alert thresholds to apply exclusively to that project's costs. This directly enables per-department tracking if each department maps to a project, and it provides native budget alert notifications, exactly as required.

Why this answer

You can create budgets at the billing account level with scoped projects. This allows one budget per project. Creating budgets per project individually is manual.

Using labels requires tagging resources. Billing export to BigQuery is for analysis, not alerts.

594
MCQeasy

An engineer is tasked with creating a new VPC network for a production environment. The company requires the VPC to support multiple regions and allow custom IP address ranges for each subnet. Which VPC network mode should the engineer use?

A.Shared VPC
B.Custom mode VPC
C.Auto mode VPC
D.Legacy mode VPC
AnswerB

Custom mode VPC is the correct choice because it begins with no subnets and lets the engineer explicitly define each subnet's IP CIDR range and region. This provides full control over the address space, including private or publicly routable blocks, to avoid conflicts and meet design requirements. For a task that requires setting custom subnet IP ranges per region, this mode is the only way to do so natively.

Why this answer

Custom mode VPC allows full control over subnets, including custom IP ranges per region. Auto mode creates subnets in each region with predefined IP ranges, which may not meet production requirements. Shared VPC is for sharing across projects, not for a single project's network.

595
MCQmedium

An application receives the error 'Permission denied on resource project [PROJECT_ID] (or it may not exist)' when making an API call with a service account. The service account has the correct IAM role. What else might be missing?

A.The service account needs the Project Owner role to make any API calls
B.The relevant GCP API is not enabled in the project
C.The service account needs to be in the same organization as the project
D.The service account email must be explicitly allow-listed in the API's configuration
AnswerB

When the relevant API is disabled in the project, any request using a service account or user credential fails with a message indicating either 'API has not been used' or that the endpoint cannot be reached. Google Cloud requires an API to be enabled per project before its methods are callable, regardless of the caller's IAM roles. Enabling the API via gcloud services enable or the Cloud Console resolves the error and does not require changing IAM roles.

Why this answer

The error 'Permission denied on resource project [PROJECT_ID] (or it may not exist)' typically occurs when the service account has the correct IAM role but the API being called is not enabled for the project. Even with proper IAM permissions, GCP requires that the specific API (e.g., Compute Engine API, Cloud Storage API) be enabled in the project before any API calls can succeed. Enabling the API activates the service and allows the service account to use it.

Exam trap

Google Cloud often tests the misconception that IAM roles alone guarantee API access, but the trap here is that candidates overlook the prerequisite of enabling the API service in the project, which is a separate step from assigning IAM permissions.

How to eliminate wrong answers

Option A is wrong because the Project Owner role is not required for making API calls; a service account only needs the specific IAM role granting the necessary permissions, and Project Owner is overly broad and unnecessary. Option C is wrong because service accounts do not need to be in the same organization as the project; they can be created in one project and used in another project within the same or different organization, as long as IAM permissions are granted. Option D is wrong because there is no concept of 'allow-listing' a service account email in an API's configuration; access is controlled entirely through IAM roles and policies, not through an explicit allow list.

596
MCQeasy

A team's GCP project is approaching its monthly budget. They want to receive an email alert when spending reaches 80% and 100% of the $500 monthly budget. Which GCP feature sends these budget alerts?

A.Cloud Monitoring alerting policy on the billing/cost metric
B.A Cloud Scheduler job that queries the Billing API and sends an email when cost exceeds thresholds
C.Cloud Billing budget with alert thresholds set at 80% and 100%
D.Cloud Logging alert on billing cost log entries
AnswerC

Cloud Billing budgets natively support multiple alert thresholds, so you can set percentage thresholds at 80% and 100% of your budget amount. When actual spending crosses each threshold, Cloud Billing automatically sends email notifications to the configured recipients, and can also publish to Pub/Sub for programmatic handling. This is the simplest and most reliable method because it requires no custom code, no external services, and no additional monitoring setup.

Why this answer

Cloud Billing budgets are the native GCP feature designed to monitor spending against a budget and send email alerts when actual or forecasted costs exceed user-defined thresholds (e.g., 80% and 100% of $500). This feature is configured directly in the Cloud Console or via the Billing API and automatically triggers notifications without requiring custom code or additional services.

Exam trap

Google Cloud often tests the distinction between native GCP services (Cloud Billing budgets) and workarounds (Cloud Scheduler + Billing API) to see if candidates recognize the built-in, no-code solution for budget alerts.

How to eliminate wrong answers

Option A is wrong because Cloud Monitoring alerting policies cannot directly use billing/cost metrics; billing data is not exposed as a Cloud Monitoring metric, and the 'billing/cost metric' does not exist in the Monitoring API. Option B is wrong because while a Cloud Scheduler job could theoretically query the Billing API and send an email, this is not a built-in GCP feature for budget alerts—it requires custom development, cron management, and is not the recommended or simplest solution. Option D is wrong because Cloud Logging alerts on billing cost log entries are not supported; billing data is not written to Cloud Logging as structured log entries that can trigger alerts, and the Billing budget feature already handles threshold-based notifications natively.

597
MCQmedium

A company runs a batch job every night that processes data from a Cloud Storage bucket and writes results to BigQuery. The job runs on a Compute Engine VM. To minimize costs, what is the best practice for the VM?

A.Use a VM with GPUs for faster processing
B.Use a VM with local SSD for temporary storage
C.Use a standard VM and commit to a 1-year commitment
D.Use a preemptible VM
AnswerD

Preemptible VMs cost up to 60–80% less than standard on-demand VMs and are explicitly designed for fault-tolerant, batch workloads that can be interrupted. Compute Engine can terminate a preemptible VM at any time, but it will always run for at least 30 seconds, and the job should be coded to handle early termination by persisting progress to durable storage. Because this nightly batch job is by nature interruptible and short-lived, preemptible VMs are the cost-optimal choice and align with Google's best practices for batch processing.

Why this answer

Preemptible VMs are up to 80% cheaper and can be terminated at any time, which is acceptable for batch jobs that can be checkpointed or restarted from the beginning.

598
MCQeasy

You need to load a CSV file from Cloud Storage into an existing BigQuery table. Which bq command should you use?

A.bq query --source_format=CSV 'SELECT * FROM mydataset.mytable'
B.bq load --source_format=CSV mydataset.mytable gs://mybucket/myfile.csv
C.bq insert mydataset.mytable gs://mybucket/myfile.csv
D.bq import mydataset.mytable gs://mybucket/myfile.csv
AnswerB

bq load is the correct BigQuery CLI command to initiate a batch load job from Cloud Storage. It creates a load job that reads the CSV file at the given URI, parses it according to the specified --source_format, and writes rows into the target table (mydataset.mytable), which can be appended to or replace. This is the standard, idempotent way to bulk-load CSV data into BigQuery.

Why this answer

The bq load command loads data into a BigQuery table. You specify the source format (CSV) and the location of the file in Cloud Storage.

599
MCQmedium

A team stores application log archives in a Cloud Storage bucket. Logs older than 90 days should automatically move to Coldline storage, and logs older than 365 days should be deleted. Which feature automates this?

A.Cloud Scheduler jobs that run gsutil rewrite and gsutil rm commands nightly
B.Cloud Storage Object Lifecycle Management rules on the bucket
C.Cloud Pub/Sub notifications triggering a Cloud Function on each object creation
D.Retention policies that lock objects in Coldline after 90 days
AnswerB

Cloud Storage Object Lifecycle Management lets you define rules at the bucket level, for example an action to set the storage class to Coldline when `age` is 90 days, and a delete action when `age` is 365 days. These rules are evaluated asynchronously by Google Cloud for all current and future objects, so you get automatic, fully managed transition and deletion behavior without any external triggers. This is the intended mechanism for exactly this requirement, and it is both simpler and more reliable than any custom event-driven or scheduler-based solution.

Why this answer

Cloud Storage Object Lifecycle Management rules allow you to automatically transition objects to Coldline storage after 90 days and delete them after 365 days based on object age conditions. This is a native, serverless feature that requires no external compute or scheduling, making it the most efficient and reliable approach for automating tiering and deletion of log archives.

Exam trap

Google Cloud often tests the misconception that custom scheduling or event-driven functions are required for automated data management, when in fact Cloud Storage's native lifecycle management handles age-based transitions and deletions without any additional services.

How to eliminate wrong answers

Option A is wrong because Cloud Scheduler jobs running gsutil rewrite and gsutil rm commands introduce unnecessary complexity, potential for human error, and additional cost for compute resources; lifecycle management handles this natively without custom scripts. Option C is wrong because Cloud Pub/Sub notifications triggering a Cloud Function on each object creation would only fire on new objects, not on existing objects, and would require custom code to implement age-based transitions and deletions, which is less efficient and more error-prone than built-in lifecycle rules. Option D is wrong because retention policies are used to prevent object deletion or modification for a specified period, not to automate transitions or deletions; locking objects in Coldline after 90 days would actually prevent the deletion at 365 days that the requirement specifies.

600
MCQmedium

A team is designing a system where two GCP projects — a shared services project and an application project — need their VMs to communicate using private IPs. Both projects are in the same organization. Which networking option best enables this with centralized network management?

A.VPC Peering between the two projects' VPCs
B.Shared VPC (XPN) with the shared services project as the host
C.Cloud VPN between the two projects' default VPCs
D.Using external IPs with TLS — private IP communication isn't necessary between GCP projects
AnswerB

With Shared VPC (XPN), the shared services project acts as the host, owning the VPC networks and subnets that service projects' VMs consume. The host project's network admin has centralized visibility and control over routing, firewall policies (including hierarchical firewall rules), and subnet allocation, while service project owners can deploy VMs without managing network infrastructure. This is the recommended pattern when multiple projects need to consume common services over private IPs because it enforces consistent governance, simplifies auditing, and scales without adding peering or VPN links per project.

Why this answer

Shared VPC (XPN) allows an organization to centrally manage networking across multiple projects from a single host project, enabling VMs in the shared services project and the application project to communicate via private IPs without needing separate peering or VPN configurations. This is the best option because it provides centralized network administration and policy enforcement, which aligns with the requirement for centralized network management.

Exam trap

The trap here is that candidates often choose VPC Peering (Option A) because it seems simpler for connecting two projects, but they overlook the explicit requirement for centralized network management, which Shared VPC uniquely provides by design.

How to eliminate wrong answers

Option A is wrong because VPC Peering requires manual configuration of each peering connection and does not provide centralized network management; each project retains separate administrative control, and routes must be managed individually. Option C is wrong because Cloud VPN is designed for connecting on-premises networks or different VPCs across regions via encrypted tunnels, but it adds complexity and latency for intra-organization communication that can be achieved more simply with Shared VPC. Option D is wrong because using external IPs with TLS violates the requirement for private IP communication and introduces security risks and egress costs, as well as bypassing the centralized management goal.

Page 7

Page 8 of 11

Page 9

All pages