Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 13511425

1446 questions total · 20pages · All types, answers revealed

Page 18

Page 19 of 20

Page 20
1351
Multi-Selectmedium

An SRE team is implementing a chaos engineering practice on GKE. They want to test the resilience of a microservice by injecting failures. Which TWO tools or services can they use? (Choose 2.)

Select 2 answers
A.Cloud Armor
B.Chaos Mesh
C.Traffic Director
D.GKE Ingress
E.Cloud Endpoints
AnswersB, C

Chaos Mesh is designed for chaos engineering on Kubernetes.

Why this answer

Chaos Mesh is an open-source chaos engineering platform for Kubernetes. Traffic Director supports fault injection via HTTP filters for services using its traffic management. These two are valid.

Cloud Endpoints and Cloud Armor are not for fault injection. GKE itself does not provide built-in fault injection.

1352
Multi-Selectmedium

A database engineer is designing a Cloud SQL for MySQL schema for a multi-tenant SaaS application. Each tenant's data is isolated. Which TWO strategies are appropriate for tenant isolation?

Select 2 answers
A.Create a separate database for each tenant.
B.Use a single table with a tenant_id column and enforce filtering in application queries.
C.Use column-level security to hide tenant data.
D.Use a separate Cloud SQL instance per tenant.
E.Use row-level security policies to restrict access per tenant.
AnswersA, D

Separate databases provide strong isolation and are easy to manage.

Why this answer

Options A and D are correct because they provide strong tenant isolation. Option A: Creating a separate database per tenant leverages MySQL's native database boundaries, preventing cross-tenant data access at the schema level. It also simplifies per-tenant backup/restore operations.

Option D: Using a separate Cloud SQL instance per tenant offers physical isolation at the compute level, which is appropriate when tenants require complete resource isolation or have compliance needs. Options B, C, and E are incorrect: B relies on application filtering which can be error-prone and does not enforce isolation at the database level; C (column-level security) and E (row-level security) are not supported in MySQL and are features of other database engines like PostgreSQL or SQL Server.

Exam trap

Google Cloud often tests the misconception that MySQL supports advanced security features like row-level or column-level security, which are actually available in other database engines like PostgreSQL or SQL Server, leading candidates to incorrectly select options C or E.

1353
MCQeasy

A BigQuery table stores daily sales data. The team commonly queries data for a specific date range. Which schema optimization will reduce query cost and improve performance?

A.Create a view over the table
B.Create a materialized view with a filter on date
C.Cluster the table by date column
D.Partition the table by date column
AnswerD

Partition pruning reduces data scanned.

Why this answer

Partitioning the table by the date column allows BigQuery to prune entire partitions when querying a specific date range, drastically reducing the amount of data scanned. Since BigQuery charges by the bytes processed, this directly lowers query cost and improves performance by reading only the relevant partitions.

Exam trap

In Google Cloud BigQuery, partitioning by date enables partition pruning that reduces data scanned, directly lowering cost. Candidates often confuse this with clustering, which only reorders data within a partition and does not independently reduce scanned bytes.

How to eliminate wrong answers

Option A is wrong because a view is just a saved SQL query; it does not reduce the amount of data scanned or improve performance, as BigQuery still processes the underlying table fully. Option B is wrong because a materialized view with a date filter pre-computes results but still requires scanning the base table for incremental refreshes, and it does not optimize the base table's storage or query pruning for ad-hoc date range queries. Option C is wrong because clustering only sorts data within a table or partition, reducing the data scanned for filter predicates but not eliminating entire storage blocks; without partitioning, BigQuery still must scan all blocks that might contain matching dates, whereas partitioning physically separates data by date.

1354
MCQmedium

A company uses Memorystore for Redis and wants to ensure data is preserved in case of a node failure. They cannot afford any data loss. What should they do?

A.Increase the maxmemory setting to avoid eviction
B.Enable AOF persistence on the Redis instance
C.Use active cross-region replication to a replica instance
D.Schedule periodic backups to Cloud Storage using export
AnswerB

Enabling AOF persistence (or RDB) ensures that writes are written to disk and can survive a node failure. With appropriate fsync settings, data loss is minimal or zero.

Why this answer

To guarantee no data loss during a node failure, Memorystore for Redis should have persistence enabled. Standard Tier instances support both RDB and AOF persistence. AOF persistence, especially with an fsync policy of 'always' or 'everysec', ensures that writes are durably stored, minimizing data loss to at most one second.

Periodic exports to Cloud Storage are backups that occur at scheduled intervals, so any data written between the last export and the failure would be lost, violating the zero-data-loss requirement. Increasing maxmemory only controls eviction, not durability. Cross-region replication provides high availability but does not persist data to disk on its own and can lose recently written data due to replication lag.

1355
Multi-Selectmedium

A company is migrating CI/CD pipelines to Google Cloud. They want to deploy containerized applications to GKE using GitOps principles with Config Sync. Which two components are required? (Choose 2)

Select 2 answers
A.Artifact Registry
B.Cloud Build trigger
C.Config Sync operator (reconciler) installed on the GKE cluster
D.A Git repository containing the desired Kubernetes manifests
E.Binary Authorization
AnswersC, D

The operator is essential; it syncs the cluster state with the repo.

Why this answer

Config Sync requires a Git repository as the source of truth (source of truth) and the Config Sync operator installed on the cluster to sync. Cloud Build is not required for Config Sync itself.

1356
MCQeasy

Which Git branching strategy is recommended for infrastructure as code in a DevOps environment to enable continuous delivery?

A.Forking workflow
B.Feature branch workflow without merging to main often
C.Trunk-based development
D.GitFlow
AnswerC

Trunk-based development encourages short-lived branches and frequent merges to main, aligning with CD.

Why this answer

Trunk-based development is recommended for IaC to avoid long-lived branches and merge conflicts. It involves short-lived feature branches and frequent merges to main. GitFlow is more complex and not ideal for IaC.

GitHub Flow is similar but trunk-based is the standard.

1357
MCQmedium

You are designing a CI/CD pipeline for a microservice application that uses feature flags to decouple deployment from release. The team wants to automatically enable a feature flag after the deployment is verified in production for a subset of users. Which tool or approach should you integrate into the pipeline to manage feature flags?

A.Embed the feature flag logic in the application code and use environment variables to enable it.
B.Use Cloud Build substitution variables to set the feature flag status at build time.
C.Use Config Sync to update a ConfigMap with the flag status.
D.Use Cloud Deploy hooks to call the LaunchDarkly API after the deployment succeeds.
AnswerD

Cloud Deploy hooks can trigger external actions, such as enabling a feature flag via API.

Why this answer

It uses Cloud Deploy hooks to trigger a post-deployment action that calls the LaunchDarkly API, enabling the feature flag for a subset of users after the deployment has been verified in production. This decouples deployment from release, allowing the feature flag to be toggled dynamically without redeploying or modifying the application code.

Exam trap

A common pitfall in Google PCDE exams is confusing build-time, deploy-time, and runtime configuration management. The trap here is assuming that environment variables or build-time substitution variables can handle post-deployment feature flag toggling, when in fact they require a new build or redeployment to take effect.

How to eliminate wrong answers

Option A is wrong because embedding feature flag logic in application code with environment variables requires a redeployment or restart to change the flag, which defeats the purpose of decoupling deployment from release and does not support gradual rollouts to a subset of users. Option B is wrong because Cloud Build substitution variables are evaluated at build time, not after deployment, so they cannot dynamically enable a feature flag based on production verification or target a subset of users. Option C is wrong because Config Sync updates a ConfigMap declaratively, but this approach typically requires a pod restart or controller reconciliation to take effect, and it does not provide the granular, real-time targeting needed for a subset of users in production.

1358
MCQmedium

During a one-time (non-continuous) migration from MySQL to Cloud SQL using mysqldump, the engineer wants to ensure the dump does not lock InnoDB tables. Which flag should be included in the mysqldump command?

A.--skip-lock-tables
B.--flush-logs
C.--single-transaction
D.--lock-all-tables
AnswerC

This flag ensures a consistent read without locking InnoDB tables.

Why this answer

--single-transaction starts a transaction at the time of dump, ensuring a consistent snapshot without locking tables (for InnoDB).

1359
MCQhard

A Cloud SQL for PostgreSQL instance is experiencing high CPU usage due to many short-lived connections. Which configuration change can help without application changes?

A.Use read replicas
B.Increase the max_connections parameter
C.Increase the tier to more vCPUs
D.Enable connection pooling with pgBouncer
AnswerD

pgBouncer reduces the number of concurrent connections to the database, lowering CPU usage.

Why this answer

Enabling connection pooling with pgBouncer reduces the CPU overhead of creating and tearing down many short-lived connections. Option A (read replicas) helps with read load, not CPU from connection churn. Option B (increase max_connections) allows more concurrent connections but does not reduce per-connection overhead and can increase CPU usage.

Option C (increase tier to more vCPUs) adds resources but does not address the root cause of connection churn and may be cost-inefficient.

1360
MCQmedium

A company wants to migrate their on-premises PostgreSQL database to Cloud SQL. The database currently runs mixed workloads: OLTP with heavy writes and occasional complex analytical queries. They want to avoid performance impact on the transactional workload. Which approach should they take?

A.Migrate to Cloud Spanner to handle both workloads using its analytics interface.
B.Use Cloud SQL with the 'analytics' tier enabled.
C.Create a read replica of the Cloud SQL instance and run analytical queries against the replica.
D.Use the same Cloud SQL instance but schedule analytical queries during off-peak hours.
AnswerC

Creating a read replica is the recommended approach to offload analytical queries. The replica handles read-only traffic, including analytics, without impacting the primary instance's OLTP performance.

Why this answer

To avoid performance impact on transactional workloads, a read replica of the Cloud SQL instance should be created and analytical queries directed to it. Read replicas in Cloud SQL are separate instances that replicate data from the primary asynchronously, providing isolation so that heavy analytical queries don't compete for resources with OLTP operations. This is a recommended best practice for workload separation in Cloud SQL for PostgreSQL.

Exam trap

Candidates often mistakenly believe that scheduling analytical queries during off-peak hours suffices, but this still shares resources with the primary. Also, there is no such feature as an 'analytics tier' in Cloud SQL; workload isolation is achieved via read replicas.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner is a globally distributed, strongly consistent database designed for horizontal scalability, not a direct migration target for PostgreSQL; it would require significant application changes and does not natively support PostgreSQL syntax or mixed OLTP/analytical workloads without additional tooling. Option B is wrong because Cloud SQL does not have an 'analytics' tier; this is a fictional feature — Cloud SQL offers tiers based on machine type (e.g., db-custom, db-standard) and does not provide a separate analytics-optimized configuration. Option D is wrong because scheduling analytical queries during off-peak hours does not eliminate resource contention; if the analytical query is complex and resource-intensive, it can still degrade OLTP performance during those hours, and it does not address the need for continuous availability of analytical capabilities.

1361
MCQmedium

Refer to the exhibit. A BI query is performing slowly. The query plan shows a large shuffle in the aggregate stage. The table is not partitioned or clustered. Which optimization would most directly reduce the shuffle size?

A.Converting the query to use a window function.
B.Using a materialized view.
C.Adding a WHERE clause to filter recent data.
D.Clustering the table on the grouping columns.
AnswerD

Clustering by grouping columns pre-orders data, minimizing shuffle during aggregation.

Why this answer

Clustering the table on the grouping columns physically co-locates rows with the same group key values within the same storage units (e.g., files or partitions). This allows the query engine to perform partial aggregation locally before the shuffle, dramatically reducing the amount of data that must be moved across the network during the aggregate stage. In systems like BigQuery or Spark SQL, clustering on grouping columns directly minimizes shuffle size by enabling pre-aggregation at the storage layer.

Exam trap

Google Cloud often tests the distinction between reducing data scanned (filtering) versus reducing data shuffled (clustering/partitioning), and candidates mistakenly choose a WHERE clause because they think less input data equals less shuffle, but shuffle size depends on the grouping key distribution, not the total data volume.

How to eliminate wrong answers

Option A is wrong because converting to a window function does not reduce shuffle size; window functions still require partitioning and ordering, often causing an even larger shuffle. Option B is wrong because a materialized view pre-computes and stores the query result, but it does not reduce the shuffle of the original query; it avoids the query entirely, which is a different optimization strategy. Option C is wrong because adding a WHERE clause to filter recent data reduces the total data scanned but does not directly reduce the shuffle size for the remaining data; the shuffle still occurs on the filtered dataset, and the grouping columns remain unoptimized.

1362
MCQeasy

A company wants to enforce that no Compute Engine instances are created with external IP addresses unless explicitly allowed. Which organization policy constraint should be used?

A.constraints/compute.vmExternalIpAccess
B.constraints/compute.disableSerialPortAccess
C.constraints/compute.setCommonInstanceMetadata
D.constraints/compute.requireOsLogin
AnswerA

Correct. This policy controls external IP addresses on VMs.

Why this answer

The 'constraints/compute.vmExternalIpAccess' policy restricts external IP usage on VMs. It can be set at the organization, folder, or project level.

1363
MCQmedium

A company runs a batch data processing job on Compute Engine that is fault-tolerant. They want to reduce costs without affecting job completion time. The job can handle instance preemption gracefully. Which compute option should they use?

A.Use regular VMs with committed use discounts for 1 year.
B.Use GPU-accelerated instances.
C.Use preemptible VMs.
D.Use sole-tenant nodes.
AnswerC

Preemptible VMs cost about 60-80% less than regular VMs and are ideal for fault-tolerant batch workloads.

Why this answer

Preemptible VMs are significantly cheaper and suitable for fault-tolerant batch jobs because they can be interrupted but the job can resume on new instances.

1364
Multi-Selecthard

A company uses Cloud Spanner and needs to capture real-time changes from a table for downstream processing. They want to avoid writing custom application code to track changes. Which THREE components should they use? (Choose three.)

Select 3 answers
A.Cloud Bigtable
B.Pub/Sub
C.Change Streams
D.Cloud Spanner API
E.Dataflow
AnswersB, C, E

Change Streams can publish to Pub/Sub for downstream consumption.

Why this answer

Cloud Spanner Change Streams (option C) capture real-time changes (inserts, updates, deletes) from a table. These changes are automatically published to a Pub/Sub topic (option B). A subscriber can then use Dataflow (option E) to process the change stream messages for downstream transformations or loading.

Cloud Bigtable (option A) is a different database service not involved in this scenario. The Cloud Spanner API (option D) is not needed because Change Streams already integrate with Pub/Sub.

1365
MCQeasy

Which data type mapping is correct when converting an Oracle NUMBER(10,2) column to PostgreSQL?

A.NUMERIC(10,2)
B.INTEGER
C.DECIMAL(10)
D.REAL
AnswerA

NUMERIC maps directly to NUMBER with same precision and scale.

Why this answer

NUMBER(p,s) maps to NUMERIC(p,s) in PostgreSQL. NUMBER(10,2) becomes NUMERIC(10,2).

1366
MCQmedium

An e-commerce application uses Firestore in Native mode. The team needs to run a query that filters on two fields and orders by a third field. What is the correct approach to ensure this query runs efficiently?

A.Create a composite index on the three fields
B.Rely on automatic single-field indexes
C.Use an index exemption on the fields
D.Use Firestore in Datastore mode instead
AnswerA

Composite indexes must be created manually for queries that filter on multiple fields and order by another.

Why this answer

Firestore requires a composite index for queries that filter on multiple fields and order by a different field, because single-field indexes cannot satisfy the combined filtering and ordering constraints. Creating a composite index on the three fields (the two filter fields and the order field) allows Firestore to efficiently execute the query without scanning all documents.

Exam trap

A common misconception is that single-field indexes are sufficient for multi-field queries, or that index exemptions can optimize queries, when in fact composite indexes are mandatory for such queries in Firestore.

How to eliminate wrong answers

Option B is wrong because automatic single-field indexes only support simple equality filters on one field or range filters on one field with an order on the same field; they cannot handle filtering on two fields and ordering by a third. Option C is wrong because an index exemption is used to exclude fields from automatic indexing, not to enable complex queries; it would prevent the query from running efficiently. Option D is wrong because switching to Datastore mode does not solve the indexing requirement—Datastore mode also requires composite indexes for similar multi-field queries, and the question specifies Firestore in Native mode, so changing modes is unnecessary and introduces other differences.

1367
MCQeasy

An organization needs to run a disaster recovery drill for its Cloud SQL for MySQL instance by promoting a read replica to a standalone instance. The replica is in the same region as the primary. After the drill, they want the original primary to resume serving writes. What should they do?

A.Promote the replica, then delete and recreate the replica from the original primary after the drill.
B.Stop replication, then restart the primary instance to make it the new replica.
C.Use the gcloud command to switch roles between the primary and replica.
D.Promote the replica, then perform a failover on the original primary to make it the new primary.
AnswerA

Promotion is irreversible; to restore replication, you must recreate the replica.

Why this answer

Promoting a read replica in Cloud SQL for MySQL breaks the replication link, making the replica a standalone primary. After the drill, you must delete the promoted replica and create a new read replica from the original primary to re-establish replication. This is the only supported method because Cloud SQL does not allow reversing the promotion or re-attaching a promoted instance as a replica.

Exam trap

The trap here is that candidates assume you can simply re-attach the promoted replica or use a failover command to reverse the roles, but Cloud SQL's architecture treats promotion as an irreversible operation that requires deleting and recreating the replica.

How to eliminate wrong answers

Option B is wrong because stopping replication does not make the original primary a replica; Cloud SQL does not support converting a primary into a replica of another instance. Option C is wrong because there is no gcloud command to switch roles between a primary and a replica; promotion is a one-way operation. Option D is wrong because performing a failover on the original primary would attempt to promote it again, but it is already the primary and failover is designed for high-availability configurations, not for reversing a replica promotion.

1368
Multi-Selecthard

A company stores log files in Cloud Storage buckets. The logs are accessed frequently for the first 30 days, then rarely for the next 6 months, after which they must be archived for 7 years. They want to minimize storage costs. Which two actions should they take? (Choose two.)

Select 2 answers
A.Keep objects in Standard storage class for the entire retention period.
B.Set a lifecycle rule to change storage class to Nearline after 30 days.
C.Set a lifecycle rule to delete the objects after 30 days.
D.Enable Autoclass to automatically transition objects to colder storage classes.
E.Set a lifecycle rule to change storage class to Archive after 6 months.
AnswersB, E

Nearline is cost-effective for data accessed less than once a month.

Why this answer

Nearline storage is optimized for data accessed less than once a month, making it cost-effective for logs that are rarely accessed after 30 days. Option E is correct because Archive storage is the lowest-cost option for data that must be retained for 7 years with infrequent access, meeting the archival requirement while minimizing costs.

Exam trap

A common trap is the belief that Autoclass can replace explicit lifecycle rules for fixed retention schedules. Autoclass is designed for unpredictable access patterns and cannot guarantee transitions at specific time intervals, so it cannot meet the requirement of storing for 30 days in Standard, then transitioning to Nearline after 30 days and to Archive after 6 months.

1369
MCQeasy

A DevOps engineer wants to manage Google Cloud resources as code using a declarative language. Which tool is the current industry standard and recommended by Google?

A.Terraform
B.Cloud Deployment Manager
C.Pulumi
D.Ansible
AnswerA

Terraform is widely adopted and recommended by Google for IaC on GCP.

Why this answer

Terraform is the current industry standard for Infrastructure as Code (IaC) and is recommended by Google for managing Google Cloud resources declaratively. It uses the HashiCorp Configuration Language (HCL) to define cloud resources, supports state management for tracking resource changes, and provides a consistent workflow across multiple cloud providers. Google’s own documentation and professional certification materials explicitly endorse Terraform as the primary IaC tool for GCP.

Exam trap

The trap here is that candidates often confuse Cloud Deployment Manager as the recommended tool because it is Google’s native offering, but the question specifically asks for the 'current industry standard' and 'recommended by Google,' which points to Terraform due to its broader adoption and explicit endorsement in Google’s official IaC guidance.

How to eliminate wrong answers

Option B is wrong because Cloud Deployment Manager is Google’s native IaC tool, but it is not the current industry standard; it uses YAML or Python templates and has limited community support and fewer integrations compared to Terraform. Option C is wrong because Pulumi is a modern IaC tool that uses general-purpose programming languages (e.g., TypeScript, Python) rather than a declarative language like HCL, and while it supports GCP, it is not the recommended standard by Google for declarative IaC. Option D is wrong because Ansible is a configuration management and automation tool that uses imperative playbooks (YAML) and is not primarily designed for declarative resource provisioning; it lacks native state management and is not the industry standard for declarative IaC on GCP.

1370
Multi-Selecteasy

A team is designing a disaster recovery plan for a Cloud Spanner instance. They want an RPO of 10 minutes and RTO of 5 minutes. Which two features should they use?

Select 2 answers
A.Enable point-in-time recovery (PITR) with a 10-minute recovery period
B.Deploy a cross-region read replica
C.Configure automated backups
D.Use database versioning to failover
E.Set up a multi-region configuration
AnswersA, E

PITR allows recovery to any point within window, meeting RPO.

Why this answer

Point-in-time recovery (PITR) with a 10-minute recovery period is correct because it allows restoring Cloud Spanner data to any point within the last 10 minutes, meeting the RPO of 10 minutes. PITR provides versioned data retention without requiring manual backups, enabling recovery within seconds to minutes, which satisfies the RTO of 5 minutes when combined with a multi-region configuration.

Exam trap

Google Cloud often tests the misconception that read replicas or automated backups alone can meet strict RPO/RTO requirements, but in Cloud Spanner, only PITR combined with a multi-region configuration provides the necessary recovery granularity and automatic failover.

1371
MCQmedium

A company uses Bigtable for real-time analytics. They notice that writes to a specific row range are significantly slower. The Key Visualizer shows a hotspot. What is the most likely cause and recommended action?

A.Create a new cluster and replicate data to that cluster.
B.Change the storage type from HDD to SSD.
C.Redesign the row key to avoid sequential writes to the same region.
D.Increase the number of nodes to handle the load.
AnswerC

A well-distributed row key spreads writes across tablet servers, eliminating hotspots.

Why this answer

Hotspots occur when a single tablet server is overloaded due to high write traffic to a contiguous key range. The solution is to redesign the row key to distribute writes.

1372
MCQhard

A company uses Cloud Bigtable with replication across two clusters in us-east1 and us-west1. They have a critical application that requires strong consistency for all reads after writes. What configuration should they implement to meet this requirement?

A.Use cluster-group routing with multi-cluster routing.
B.Use single-cluster routing with single-row transactions.
C.Enable inter-cluster replication with strong consistency.
D.Use multi-cluster routing to automatically route to the nearest cluster.
AnswerB

Single-cluster routing ensures all reads and writes go to the same cluster, providing strong consistency.

Why this answer

Cloud Bigtable does not support strong consistency across clusters in a replicated setup; replication is eventually consistent. To guarantee strong consistency for reads after writes, you must use single-cluster routing with single-row transactions, which ensures that all reads and writes for a given row are processed by the same cluster, providing ACID semantics for that row.

Exam trap

The trap here is that candidates often assume 'replication' implies strong consistency, but Cloud Bigtable's cross-cluster replication is eventually consistent, and the only way to achieve strong consistency is to confine all operations to a single cluster using single-row transactions.

How to eliminate wrong answers

Option A is wrong because cluster-group routing with multi-cluster routing distributes requests across clusters, which can lead to stale reads due to eventual consistency. Option C is wrong because inter-cluster replication in Cloud Bigtable is inherently eventually consistent; there is no configuration to make it strongly consistent across clusters. Option D is wrong because multi-cluster routing routes to the nearest cluster based on latency, but this does not guarantee strong consistency; reads may return stale data if the write has not yet replicated.

1373
MCQmedium

A team uses Terraform to manage infrastructure. They want to ensure that all Terraform code passes policy checks before being applied. They use Terraform Cloud. Which built-in feature allows them to define policies that are checked during the plan phase?

A.`terraform validate`
B.Sentinel
C.Conftest
D.OPA (Open Policy Agent)
AnswerB

Sentinel is Terraform Cloud's native policy framework for plan-time checks.

Why this answer

Sentinel is Terraform Cloud's built-in policy-as-code framework that allows teams to define and enforce policies during the plan phase. It integrates directly with Terraform Cloud's run lifecycle, enabling policy checks to be evaluated against the planned infrastructure changes before they are applied. This ensures compliance and governance without requiring external tools.

Exam trap

The trap here is that candidates may confuse `terraform validate` (a syntax checker) with a policy enforcement tool, or assume that external policy engines like OPA or Conftest are built into Terraform Cloud, when in fact Sentinel is the native policy-as-code solution.

How to eliminate wrong answers

Option A is wrong because `terraform validate` is a CLI command that checks configuration syntax and internal consistency, but it does not support custom policy definitions or integrate with Terraform Cloud's plan-phase checks. Option C is wrong because Conftest is an open-source policy testing tool that works with OPA and can be used with Terraform, but it is not a built-in feature of Terraform Cloud; it requires external setup and integration. Option D is wrong because OPA (Open Policy Agent) is a general-purpose policy engine that can be used with Terraform via external tools like Conftest, but it is not a built-in feature of Terraform Cloud and does not natively integrate into the plan phase without additional configuration.

1374
MCQmedium

A news website uses Cloud SQL for MySQL for content management. They experience slow reads during breaking news events. They have a single primary instance in us-east1. They need to improve read scalability globally. They also want to ensure data is backed up in another region. What should they do?

A.Use Cloud Spanner with multi-region configuration.
B.Enable automatic failover to a standby instance in another region.
C.Add cross-region read replicas in multiple regions and use replica read for queries.
D.Use Bigtable for content storage.
AnswerC

Read replicas provide read scalability and can be used for backups.

Why this answer

Adding cross-region read replicas in multiple regions allows the website to offload read queries to replicas located closer to global users, reducing latency during traffic spikes. Cloud SQL for MySQL supports cross-region replicas, which also provide a backup copy of data in another region for disaster recovery, meeting both scalability and backup requirements without changing the database engine.

Exam trap

Google Cloud often tests the distinction between read scalability and disaster recovery, and the trap here is that candidates confuse cross-region read replicas (which provide both read offloading and a backup copy) with automatic failover (which Cloud SQL for MySQL does not support across regions).

How to eliminate wrong answers

Option A is wrong because Cloud Spanner is a globally distributed, horizontally scalable database that requires significant application changes and does not use MySQL, making it an over-engineered migration for a MySQL-based content management system. Option B is wrong because automatic failover to a standby instance in another region is not supported by Cloud SQL for MySQL; Cloud SQL only supports regional high availability with a zonal standby, not cross-region failover. Option D is wrong because Bigtable is a NoSQL wide-column database optimized for analytical workloads and time-series data, not for content management with complex queries and joins, and it would require a complete schema redesign.

1375
MCQmedium

A company notices that their Cloud SQL for PostgreSQL instance, as shown in the exhibit, frequently runs out of storage, causing downtime. They have set up automated backups with point-in-time recovery. What is the most likely cause of the storage issue?

A.Transaction logs for point-in-time recovery are consuming disk space.
B.The activation policy is set to ALWAYS, causing continuous writes.
C.The instance tier (db-custom-4-15360) is too low for the workload.
D.The data disk type (PD_SSD) is not suitable for PostgreSQL.
AnswerA

Transaction logs are stored on the same disk and can grow large.

Why this answer

Cloud SQL for PostgreSQL uses transaction logs (WAL files) to enable point-in-time recovery (PITR). These logs accumulate on the disk until they are automatically removed, but if the rate of log generation exceeds the cleanup rate or if the backup retention period is long, the logs can fill the disk, causing storage exhaustion and downtime.

Exam trap

Google Cloud often tests the misconception that storage issues are caused by instance tier or disk type, when in fact the hidden culprit is transaction log accumulation from point-in-time recovery settings.

How to eliminate wrong answers

Option B is wrong because the activation policy (ALWAYS vs ON_DEMAND) controls whether the instance is billed continuously, not the frequency of writes; it does not directly cause storage to run out. Option C is wrong because the instance tier (db-custom-4-15360) refers to vCPU and memory, not storage capacity; a low tier might cause performance issues but not storage exhaustion. Option D is wrong because PD_SSD is a fully suitable disk type for PostgreSQL; the storage issue is about capacity, not disk type suitability.

1376
MCQmedium

You need to design a Bigtable row key for a time-series application that records temperature readings from thousands of sensors. The most common query is 'get all readings for a specific sensor in the last hour'. Which row key design is optimal?

A.timestamp#sensorID
B.sensorID#timestamp
C.sensorID#reverse_timestamp
D.hash(sensorID)#timestamp
AnswerC

Groups by sensor and puts recent data first.

Why this answer

Optimal because it groups all readings for a sensor together (via sensorID as the row key prefix) while using reverse timestamps to ensure the most recent data appears first within each row. This design allows Bigtable to efficiently scan a single row for the last hour's readings using a prefix scan on sensorID with a timestamp range filter, minimizing the number of rows accessed.

Exam trap

The trap here is that candidates often choose sensorID#timestamp (Option B) thinking it groups data correctly, but they overlook that Bigtable's lexicographic ordering places older data first, making 'last hour' queries require scanning the entire row or using a reverse scan, which is less efficient than reverse timestamps.

How to eliminate wrong answers

Option A is wrong because timestamp#sensorID scatters data for the same sensor across many rows, requiring a full table scan to collect all readings for a sensor in the last hour. Option B is wrong because sensorID#timestamp places the most recent data at the end of the row, making it inefficient to retrieve the last hour's readings without scanning the entire row or using a reverse scan. Option D is wrong because hash(sensorID)#timestamp distributes data for the same sensor across multiple rows, breaking locality and requiring multiple scans to gather all readings for a sensor.

1377
Multi-Selectmedium

A company needs to migrate a 5 TB Oracle database to Cloud SQL for PostgreSQL. They need to convert schemas and data, and also set up ongoing replication with minimal downtime. Which TWO services/tools should they use? (Choose TWO.)

Select 2 answers
A.Database Migration Service
B.Cloud SQL for MySQL
C.BigQuery Data Transfer Service
D.gcloud bigquery load
E.Ora2Pg
AnswersA, E

DMS supports Oracle to Cloud SQL for PostgreSQL migration with continuous CDC.

Why this answer

Ora2Pg converts schemas; DMS can handle data migration with continuous replication from Oracle (using logical replication) to Cloud SQL.

1378
Multi-Selectmedium

A company wants to implement security controls for Compute Engine VMs across their organization. Which THREE organization policies can enforce VM security? (Choose 3)

Select 3 answers
A.`compute.requireShieldedVm`
B.`storage.uniformBucketLevelAccess`
C.`compute.vmExternalIpAccess`
D.`compute.trustedImageProjects`
E.`iam.disableServiceAccountKeyCreation`
AnswersA, C, D

Requires all VMs to use Shielded VM features.

Why this answer

These three policies enforce VM security: external IP restriction, shielded VM requirement, and trusted image projects.

1379
MCQmedium

You have a Cloud SQL for MySQL table that stores user logins with columns: user_id, login_time, ip_address. You frequently run queries to count logins by user for a specific date range. Which index would be most efficient?

A.No index; rely on full table scan
B.Separate indexes on user_id and login_time
C.A composite index on (login_time, user_id)
D.A composite index on (user_id, login_time)
AnswerC

Allows efficient range scan on login_time and provides user_id for grouping.

Why this answer

A composite index on (login_time, user_id) because the query filters by login_time range and then groups by user_id. The index can be used for both the WHERE clause (range scan on login_time) and then user_id is available for grouping without accessing the table. Option A (no index) would require a full table scan, which is inefficient.

Option B (separate indexes) may allow index merge but is less efficient than a single composite index. Option D puts user_id first, which is less efficient for range filtering on login_time because the index would need to scan all user_id values within the range.

1380
MCQhard

A team wants to implement Chaos Engineering on GKE to test the resilience of their microservices by randomly killing pods and injecting network latency. Which tool is specifically designed for this purpose on GKE?

A.Cloud Armor
B.Chaos Mesh
C.Cloud Shell
D.Traffic Director
AnswerB

Chaos Mesh is designed for Kubernetes chaos experiments, including pod killing and network latency.

Why this answer

Chaos Mesh is an open-source chaos engineering platform for Kubernetes. It provides fault injection (pod kill, network latency, etc.) and integrates with GKE.

1381
MCQmedium

During an incident, the incident commander identifies a need to scale up a managed instance group. Which IAM role should be granted to the on-call engineer to allow them to modify the instance group?

A.roles/compute.admin
B.roles/compute.securityAdmin
C.roles/compute.instanceAdmin (basic)
D.roles/compute.instanceAdmin.v1
AnswerD

Correctly grants control over instance groups.

Why this answer

Compute Instance Admin (roles/compute.instanceAdmin.v1) allows full control over instances and instance groups, including modifying MIGs. Instance Admin (basic) is restricted. Compute Admin is broader but includes other resources.

Security Admin does not have compute permissions.

1382
Multi-Selecthard

An SRE team is conducting a blameless postmortem after an outage. Which THREE elements should be included in the postmortem document? (Choose 3 answers)

Select 3 answers
A.Contributing factors (e.g., why the failure happened).
B.Identification of the person responsible.
C.Single root cause.
D.Action items with owners and due dates.
E.Timeline of events.
AnswersA, D, E

Focus on systemic causes.

Why this answer

A good postmortem includes a timeline, contributing factors, and action items with owners. Blaming individuals is counterproductive, and root cause is often too simplistic; the focus should be on contributing factors.

1383
MCQhard

In Cloud Bigtable, a table has a high ratio of garbage collection (GC) that causes performance degradation during compaction. What is the best practice to monitor and optimize this?

A.Use the bigtableadmin API to view table stats
B.Compact the table manually
C.Use Cloud Monitoring to track garbage collection count and adjust GC settings
D.Increase node count
AnswerC

Monitoring GC count and tuning GC settings can reduce compaction overhead.

Why this answer

Cloud Monitoring provides the metrics (e.g., 'bigtable.googleapis.com/table/garbage_collection_count') needed to track GC activity, and adjusting GC settings (e.g., column family max versions or TTL) directly reduces the compaction overhead caused by excessive stale data. This aligns with best practices for proactive performance optimization in Cloud Bigtable.

Exam trap

The trap here is that candidates confuse operational scaling (adding nodes) with tuning data retention policies, failing to recognize that GC-related compaction degradation is a schema design issue, not a capacity issue.

How to eliminate wrong answers

Option A is wrong because the bigtableadmin API is used for administrative operations like creating or modifying tables, not for real-time monitoring of garbage collection metrics; it does not expose GC counts or compaction performance data. Option B is wrong because manual compaction is a reactive, disruptive operation that does not address the root cause (high GC ratio) and can temporarily degrade performance further. Option D is wrong because increasing node count only scales throughput and storage capacity, not the compaction efficiency; it does not reduce the GC ratio or the compaction workload caused by excessive garbage.

1384
Multi-Selecthard

An organization wants to enforce that no Compute Engine instances have external IP addresses except for a specific project. Which TWO steps should they take? (Choose 2)

Select 2 answers
A.In the exception project, override the policy to allow.
B.Add a firewall rule to block traffic to external IPs.
C.Remove the external IP from all instances manually.
D.Create an organization policy with constraint `compute.vmExternalIpAccess` set to deny.
E.Use VPC Service Controls to restrict external access.
AnswersA, D

Use policy inheritance with an allow at the project folder.

Why this answer

Set an organization policy to disable external IP at the organization level, then create a policy exception for the allowed project. Alternatively, use a constraint with an exception.

1385
MCQeasy

A company needs to track costs across different teams and projects. They want to see detailed breakdowns by team, environment, and application. Which GCP feature should they use to tag resources for cost analysis?

A.Billing budgets
B.Network tags
C.Resource labels
D.Billing export to BigQuery
AnswerC

Labels allow you to organize resources and are used in billing reports to break down costs.

Why this answer

Labels are key-value pairs that can be attached to resources for cost allocation and reporting. Tags are also available but are used for networking and IAM, not primarily for cost tracking. Billing budgets and export are complementary but not for tagging.

1386
MCQhard

During a DMS continuous migration from MySQL to Cloud SQL, the full dump phase completed successfully, but the CDC phase is failing with 'Error: binary log not found' after a few minutes. The source MySQL has binary logs enabled. What is the most likely cause?

A.The binary logs were purged due to a short binlog_expire_logs_seconds setting.
B.The DMS connection profile has incorrect SSL settings.
C.The source database was restarted and binary logs were reset.
D.The source MySQL server has run out of disk space.
AnswerA

If logs expire before DMS consumes them, DMS cannot continue CDC.

Why this answer

DMS requires that binary logs are retained until the CDC phase has consumed them. If logs expire due to a short binlog retention period (e.g., default 1 day), the migration fails. The source should have binlog retention set to 7 days or more.

1387
MCQmedium

You need to ensure that read operations on a Cloud Spanner database return the most recent committed data. Which read type should you use?

A.Read-only transaction
B.Stale read
C.Partitioned read
D.Strong read
AnswerD

Strong reads return the most recent committed data at read time.

Why this answer

Strong read is the correct choice because it guarantees that read operations return the most recent committed data from Cloud Spanner. Unlike other read types, strong reads access the current state of the database at the time of the read, ensuring external consistency and linearizability, which is critical for applications requiring up-to-date data.

Exam trap

The trap here is that candidates often confuse read-only transactions with strong reads, assuming that any read-only operation automatically returns the latest data, whereas in Spanner, read-only transactions can be configured for stale reads unless explicitly set to strong.

How to eliminate wrong answers

Option A is wrong because a read-only transaction can use stale reads or strong reads depending on the timestamp bound, but by default it does not guarantee the most recent committed data unless explicitly configured with a strong read. Option B is wrong because a stale read intentionally returns data that is older than the current time, trading consistency for lower latency, which does not meet the requirement for the most recent committed data. Option C is wrong because a partitioned read is designed for large-scale, high-throughput reads across partitions and does not inherently provide strong consistency; it typically uses stale reads for performance.

1388
Multi-Selecteasy

A Bigtable instance is running out of storage and performance is degraded. The schema design is known to be efficient. Which THREE actions can help?

Select 3 answers
A.Delete unused column families.
B.Reduce the number of tablets.
C.Add SSDs.
D.Increase node count.
E.Enable compression.
AnswersA, D, E

Deleting column families triggers garbage collection, freeing up storage used by that data.

Why this answer

Deleting unused column families is correct because each column family in Bigtable stores data in separate SSTable files, and unused families consume storage and memory resources without providing value. Removing them frees up space and reduces the amount of data that must be scanned during reads and compactions, directly improving performance.

Exam trap

Google Cloud often tests the misconception that adding SSDs is a valid optimization for Bigtable, but Bigtable abstracts storage via Colossus and does not allow direct SSD configuration, so candidates must recognize that only node count, compression, and column family management are actionable.

1389
Multi-Selecthard

A company runs a Memorystore for Redis cluster with standard tier (for replication). They need to ensure high durability of session data and be able to recover from a complete zone failure. Which three actions should they take? (Choose THREE.)

Select 3 answers
A.Schedule regular exports of the instance data to Cloud Storage using gcloud
B.Configure cross-region replication to have a replica in another region
C.Use a Redis Cluster with multiple shards for horizontal scaling
D.Enable RDB persistence on the primary instance
E.Set up a second instance in a different zone and use client-side replication
AnswersA, B, E

Exports can be done via the gcloud redis instances export command (or using the console) to create backups in Cloud Storage.

Why this answer

To ensure high durability and recovery from a complete zone failure for a Memorystore for Redis cluster with standard tier (replication enabled): Option A: Regular exports to Cloud Storage provide point-in-time backups that can be restored in a different zone if needed. Option B: Cross-region replication creates a replica in another region, allowing failover if the primary zone fails. Option E: Setting up a second instance in a different zone with client-side replication allows the application to switch to the replica if the primary zone fails.

Option C is incorrect because Redis Cluster with multiple shards is for horizontal scaling and does not inherently provide zone failure recovery or durability beyond what replication provides. Option D is incorrect because RDB persistence, while supported in Memorystore for Redis, only provides local recovery and does not protect against a complete zone failure; you need cross-zone or cross-region replication for that.

1390
Multi-Selectmedium

An organization is moving to a GitOps model for managing both application deployments and GCP infrastructure. They want to use a single tool to sync Kubernetes manifests and manage GCP resources like Cloud SQL and Pub/Sub. Which two Google Cloud services should they combine?

Select 2 answers
A.Deployment Manager
B.Cloud Build
C.Cloud Deploy
D.Config Sync
E.Config Connector
AnswersD, E

Syncs K8s manifests from Git to GKE.

Why this answer

Config Sync (D) is correct because it continuously reconciles the state of Kubernetes resources in a cluster with manifests stored in a Git repository, enabling a GitOps workflow for application deployments. Config Connector (E) is correct because it allows managing GCP resources (e.g., Cloud SQL, Pub/Sub) declaratively using Kubernetes custom resource definitions (CRDs), which can also be synced via Config Sync. Together, they provide a single Git-based toolchain for both Kubernetes and GCP infrastructure.

Exam trap

Google often tests the misconception that Cloud Build or Cloud Deploy can serve as the continuous reconciliation engine for GitOps, but they are pipeline orchestrators, not pull-based sync tools. Config Sync and Config Connector together provide the desired GitOps model for both Kubernetes and GCP resources.

1391
MCQeasy

A data warehouse in BigQuery is running slower due to large full-table scans. Which feature can reduce the amount of data processed for common queries?

A.All of the above
B.Clustering
C.Materialized Views
D.Partitioning
AnswerA

All three features reduce data processed.

Why this answer

Partitioning, clustering, and materialized views all reduce the amount of data scanned in BigQuery. Partitioning limits scans to specific date ranges, clustering sorts data within partitions to skip irrelevant blocks, and materialized views precompute and store query results so subsequent queries read only the pre-aggregated output instead of scanning the base table. Together, these features minimize full-table scans and improve query performance.

Exam trap

Google Cloud often tests the misconception that a single optimization technique (like partitioning or clustering) is sufficient to solve all performance issues, when in fact the correct answer requires combining multiple features to achieve the greatest reduction in data scanned.

How to eliminate wrong answers

Option B is wrong because clustering alone does not reduce the amount of data processed; it only reorganizes data within partitions to improve filter and aggregation efficiency, but without partitioning, a query can still scan the entire table. Option C is wrong because materialized views alone do not reduce data processed for all common queries; they only help for queries that match the view's definition, and they require manual creation and maintenance. Option D is wrong because partitioning alone only limits scans to specific partitions based on the partition key, but if queries do not filter on that key, full-table scans still occur.

1392
Multi-Selectmedium

Which TWO metrics are most important to monitor for a Cloud SQL for PostgreSQL instance to detect performance degradation?

Select 2 answers
A.Memory usage
B.CPU utilization
C.Query latency
D.Disk IOPS
E.Network throughput (bytes sent/received)
AnswersB, D

High CPU indicates query processing load.

Why this answer

CPU utilization (B) is a primary indicator of performance degradation because sustained high CPU usage (e.g., >80%) can lead to query queuing, reduced throughput, and increased latency. Disk IOPS (D) is equally critical because Cloud SQL for PostgreSQL relies on disk I/O for WAL writes, checkpointing, and query execution; hitting the IOPS limit of the underlying persistent disk (e.g., 3,000 IOPS for a pd-standard disk) causes throttling and severe performance drops.

Exam trap

Google Cloud often tests the misconception that query latency is a primary monitoring metric, but the trap here is that latency is a downstream effect—you must monitor the underlying resource metrics (CPU and IOPS) to detect degradation before users experience slow queries.

1393
MCQmedium

You are managing a Cloud SQL for PostgreSQL instance that is experiencing high CPU usage and slow query performance. You notice that the database has a high number of idle-in-transaction connections. Which immediate action should you take to reduce CPU load without disrupting active transactions?

A.Use VPC firewall rules to block new connections until the issue resolves.
B.Kill all idle-in-transaction connections using pg_terminate_backend.
C.Set the cloudsql.enable_idle_in_transaction_session_timeout flag to true and configure idle_in_transaction_session_timeout.
D.Set a statement_timeout at the session level for new connections.
AnswerC

This flag automatically terminates idle-in-transaction sessions after a specified timeout, reducing CPU usage without manual intervention.

Why this answer

Setting the `cloudsql.enable_idle_in_transaction_session_timeout` flag to true and configuring `idle_in_transaction_session_timeout` allows Cloud SQL to automatically terminate idle-in-transaction connections after a specified timeout, reducing CPU load without manually killing connections or disrupting active transactions. This is a built-in, non-disruptive mechanism that targets only connections that are holding resources while idle, freeing up CPU and memory for active queries.

Exam trap

Google Cloud often tests the distinction between `statement_timeout` (which limits query execution time) and `idle_in_transaction_session_timeout` (which limits idle time within a transaction), and candidates mistakenly choose the session-level timeout thinking it will handle idle transactions, but it only applies to individual statements, not the idle period between statements within a transaction.

How to eliminate wrong answers

Option A is wrong because using VPC firewall rules to block new connections would prevent all new traffic, including legitimate active transactions, and does not address the existing idle-in-transaction connections that are already consuming CPU. Option B is wrong because killing all idle-in-transaction connections with `pg_terminate_backend` would abruptly terminate those backends, potentially causing application errors and disrupting any transactions that might be in a brief idle state but still holding locks or resources. Option D is wrong because setting `statement_timeout` at the session level only limits the duration of a single query, not the idle time of a transaction; it would not automatically terminate connections that are idle in a transaction, leaving the CPU load unaddressed.

1394
Multi-Selectmedium

A company wants to use Cloud SQL for MySQL to serve a read-heavy application. They need to ensure high availability and offload read traffic. Which TWO steps should they take? (Choose two.)

Select 2 answers
A.Schedule on-demand backups daily
B.Create a cross-region read replica
C.Create a same-region read replica
D.Enable auto-storage increase
E.Enable high availability (HA) configuration on the primary instance
AnswersC, E

Same-region read replicas offload read traffic and are low-latency.

Why this answer

To ensure high availability, create a Cloud SQL HA configuration (regional instance with standby). To offload read traffic, create read replicas. Cross-region replicas are for disaster recovery but add latency.

On-demand backups are for data protection, not availability. Auto-storage increase is for storage management.

1395
Multi-Selectmedium

Which THREE components are required to compute a 7-day moving average of daily sales using a window function? (Choose three.)

Select 3 answers
A.PARTITION BY product
B.WINDOW clause
C.AVG() function
D.ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
E.ORDER BY date
AnswersC, D, E

AVG calculates the average.

Why this answer

The AVG() function is the aggregate function that computes the arithmetic mean of the sales values over the specified window frame. In a moving average calculation, AVG() is applied to the rows defined by the window frame to produce the average for each row.

Exam trap

Google Cloud often tests the misconception that the WINDOW clause is mandatory for window functions, when in fact it is only a convenience for reusing a window specification, and the frame can be defined directly in the OVER clause.

1396
MCQhard

A company uses Cloud Spanner. The backup service account 'sa-backup' needs to create and manage backups of the 'orders' database. However, backup creation fails with a permission error. What is the most likely cause?

A.The service account lacks the spanner.databases.read permission.
B.The service account is assigned the role roles/spanner.databaseBackupAdmin at the database level, but this role only grants database-level permissions and does not include the spanner.backups.create permission required at the instance level.
C.The backup role must be granted at the instance level, not on the database.
D.The instance 'orders-db' is in a regional configuration, which does not support backups.
AnswerC

The role roles/spanner.backupAdmin must be granted on the instance, not the database, to create backups.

Why this answer

Cloud Spanner backup permissions must be granted at the instance level, not on the database itself. The service account 'sa-backup' needs the `spanner.backups.create` permission on the instance resource to create backups, and assigning a role like `roles/spanner.databaseBackupAdmin` at the database level does not propagate the necessary instance-level permissions, causing the backup creation to fail with a permission error.

Exam trap

The pitfall is that roles/spanner.databaseBackupAdmin is a predefined role at the database level, but creating backups requires the spanner.backups.create permission at the instance level. Assigning this role at the database level mistakenly gives the impression that backup operations are allowed, but they fail because the instance-level permission is missing.

How to eliminate wrong answers

Option A is wrong because the `spanner.databases.read` permission is for reading database data, not for creating backups; backup creation requires `spanner.backups.create` and related permissions at the instance level. Option B is wrong because `roles/spanner.databaseBackupAdmin` is a predefined role that includes `spanner.backups.create` and other necessary permissions; it is not a custom role lacking that permission, so the failure is not due to a missing permission in the role itself. Option D is wrong because Cloud Spanner supports backups for both regional and multi-region instances; a regional configuration does not prevent backup creation.

1397
MCQhard

A company uses Terraform to manage infrastructure. They have a monolithic Terraform configuration that manages all projects in a single state file. As the organization grows, the configuration becomes slow and error-prone. The team wants to adopt a modular approach with separate state files for each project while reusing common modules. Which strategy should they follow?

A.Create a single Terraform module for all resources and call it with different variables for each project, using the same state file.
B.Keep the monolithic configuration but use Terraform workspaces to create separate state files for each project.
C.Split the monolithic configuration into separate root modules per project, store state in GCS buckets with prefix per project, and use terraform_remote_state data sources to share outputs between modules.
D.Use Cloud Deployment Manager with separate YAML templates for each project and a central state stored in Cloud Storage.
AnswerC

This enables independent state management and reuse of outputs across projects.

Why this answer

Terraform workspaces are used to manage multiple state files within a single root module but are not designed for separate project state files. Remote state data sources allow reading outputs from other state files, enabling modular architecture. Using separate root modules for each project with remote state dependencies is the recommended approach for large environments.

1398
MCQmedium

A global e-commerce platform needs a database that supports strong consistency across multiple continents and can handle high write throughput. Which database service should they choose?

A.Cloud SQL for PostgreSQL
B.Cloud Firestore
C.Cloud Spanner
D.Cloud Bigtable
AnswerC

Cloud Spanner offers global strong consistency and high write throughput, making it ideal for global e-commerce.

Why this answer

Cloud Spanner is the correct choice because it provides globally distributed, strongly consistent relational database service with synchronous replication across regions and continents, supporting external consistency and high write throughput via TrueTime and Paxos-based consensus. This meets the requirement for strong consistency across multiple continents and high write throughput, which is not achievable with traditional single-region or eventually consistent databases.

Exam trap

The trap here is that candidates often confuse 'strong consistency' with 'eventual consistency' and choose Cloud Bigtable or Cloud Firestore for their high throughput, failing to recognize that only Cloud Spanner provides both strong consistency and horizontal scalability across continents.

How to eliminate wrong answers

Option A is wrong because Cloud SQL for PostgreSQL is a single-region, single-writer database that cannot scale horizontally across continents or provide strong consistency across multiple geographic regions. Option B is wrong because Cloud Firestore is a NoSQL document database that offers strong consistency only within a single region, and its multi-region mode provides eventual consistency, not the strong consistency required across continents. Option D is wrong because Cloud Bigtable is a wide-column NoSQL database designed for high throughput but only supports single-row transactions and eventual consistency across regions, lacking the strong consistency and multi-row transactional support needed for a global e-commerce platform.

1399
MCQmedium

A company is migrating an on-premises Oracle database to Cloud SQL for PostgreSQL. The database is 2 TB in size and the network bandwidth to Google Cloud is limited to 500 Mbps. The migration window is 48 hours. Which migration strategy should the Database Engineer recommend?

A.Create a VPN tunnel and use pg_dump/pg_restore over the network.
B.Use Database Migration Service with continuous replication.
C.Export the database to flat files, compress, upload to Cloud Storage, then import to Cloud SQL.
D.Request a dedicated interconnect and then migrate.
AnswerC

File-based migration with compression can work within the bandwidth and time constraints.

Why this answer

The 2 TB database size and 500 Mbps bandwidth yield a theoretical transfer time of approximately 9.5 hours (2 TB * 1024 GB/TB * 8 bits/byte / 500 Mbps / 3600 seconds/hour), which fits within the 48-hour window. However, pg_dump/pg_restore over a VPN (Option A) would be slower due to TCP overhead and latency, and Database Migration Service with continuous replication (Option B) requires ongoing connectivity and may not complete the initial load within the window. Exporting to flat files, compressing them (e.g., with gzip), uploading to Cloud Storage, and then importing to Cloud SQL leverages high-throughput parallel uploads and avoids network latency issues, making it the most reliable strategy for a one-time migration within the given constraints.

Exam trap

The trap here is that candidates often assume Database Migration Service (Option B) is always the best choice for any migration, but they overlook that continuous replication is unnecessary for a one-time migration and that the initial load still faces the same bandwidth bottleneck as other network-based methods.

How to eliminate wrong answers

Option A is wrong because pg_dump/pg_restore over a VPN tunnel with 500 Mbps bandwidth would be severely impacted by TCP overhead, latency, and potential packet loss, making it unlikely to complete a 2 TB migration within 48 hours. Option B is wrong because Database Migration Service with continuous replication is designed for minimal downtime migrations, but the initial full load still requires transferring the entire 2 TB over the network, which faces the same bandwidth limitation; additionally, continuous replication would be unnecessary and add complexity for a one-time migration. Option D is wrong because requesting a dedicated interconnect is a long-term provisioning process (weeks to months) that cannot be completed within the 48-hour migration window, and it is overkill for a single migration event.

1400
Multi-Selectmedium

A DevOps team is implementing distributed tracing for a microservices application on GKE. They want to ensure traces are exported to Cloud Trace with minimal overhead. Which TWO approaches should they consider? (Choose 2)

Select 2 answers
A.Instrument the application using the OpenTelemetry SDK and configure the OTel Collector to export to Cloud Trace
B.Enable automatic instrumentation via Anthos Service Mesh (ASM)
C.Configure a Prometheus metric to capture trace data
D.Use the Stackdriver Trace API directly from the application
E.Use the Cloud Monitoring API to send trace data
AnswersA, B

OpenTelemetry is the recommended approach for distributed tracing.

Why this answer

OpenTelemetry SDK and automatic instrumentation for GKE (via Anthos Service Mesh) are both valid. The Stackdriver Trace API is deprecated in favor of OpenTelemetry.

1401
MCQmedium

A team is using OpenTelemetry to instrument their microservices and wants to export traces to Cloud Trace. They have deployed the OpenTelemetry Collector as a DaemonSet on GKE. What configuration is needed on the Collector to send traces to Cloud Trace?

A.No configuration needed; the Collector automatically detects GKE and exports to Cloud Trace.
B.Configure the 'logging' exporter in the Collector to write traces to stdout, and use a sidecar to forward them.
C.Use the 'otlp' exporter to send traces to Cloud Trace's OTLP endpoint.
D.Configure the 'googlecloud' exporter with a project ID and service account credentials.
AnswerD

The googlecloud exporter sends traces directly to Cloud Trace.

Why this answer

The OpenTelemetry Collector needs an exporter configured for Google Cloud Trace. The 'googlecloud' exporter (or 'stackdriver' exporter) sends traces to Cloud Trace. The Collector must also have the appropriate IAM permissions (e.g., roles/cloudtrace.agent).

1402
MCQhard

A company wants to enforce Binary Authorization on images deployed to GKE. Images must be signed by an approved authority. What must be configured in the CI/CD pipeline to ensure images are signed before deployment?

A.Use cosign to sign the image in Cloud Build and store the signature in Artifact Registry
B.Add a Cloud Build step that runs gcloud container binauthz attestations create
C.Configure Cloud Deploy to sign images during the deployment process
D.Enable Container Analysis on Artifact Registry to automatically sign images
AnswerA

Signing with cosign and storing signatures in Artifact Registry is the standard way to comply with Binary Authorization.

1403
MCQeasy

A company runs Cloud SQL for PostgreSQL and wants to automatically increase storage when usage reaches a threshold. What should they enable?

A.Create a cron job to resize via gcloud
B.Configure automated backups
C.Use Active Assist recommendations to resize
D.Enable storage auto-increase in instance settings
AnswerD

This feature automatically increases disk size when usage is high.

Why this answer

Cloud SQL has a built-in 'auto-storage increase' feature that automatically adds storage when necessary, avoiding manual intervention.

1404
MCQhard

A company uses Cloud Monitoring to create an SLO for a service. They want to define a request-based SLO with a ratio of good requests to valid requests. Which of the following is a valid way to define the SLI in Cloud Monitoring SLOs?

A.Use a distribution metric for latency and set a threshold for good latency
B.Select a metric for good requests and a separate metric for total valid requests, then define the SLI as good-request-count / valid-request-count
C.Create a custom metric for requests and use Cloud Monitoring's built-in availability SLI for HTTP services
D.Use a single metric that indicates success (1 for success, 0 for failure) and set a threshold filter
AnswerB

This is the correct method for request-based SLOs in Cloud Monitoring.

Why this answer

Cloud Monitoring SLOs require two metrics: one for good events and one for total valid events. The ratio is good/total. The correct configuration uses separate metrics for good and valid requests.

1405
MCQeasy

Your company runs a critical application on Google Kubernetes Engine (GKE) with a StatefulSet using persistent volumes backed by Compute Engine persistent disks. The application performs frequent small random writes to a MySQL database stored on the persistent disks. You notice that the disk write latency has increased significantly, and the application's throughput has dropped. Monitoring shows that the disk queue depth is consistently high. The current disk type is pd-standard. What is the most cost-effective way to reduce write latency and improve throughput?

A.Change the persistent disk type from pd-standard to pd-ssd.
B.Use a regional persistent disk for higher availability and performance.
C.Add more replicas of the StatefulSet to distribute writes across multiple disks.
D.Increase the size of the persistent disks to improve IOPS limits.
AnswerA

SSD provides lower latency and higher IOPS for random write workloads, solving the problem cost-effectively.

Why this answer

The application is experiencing high write latency due to insufficient IOPS from pd-standard disks, which are HDD-based and optimized for sequential reads, not small random writes. Changing to pd-ssd (SSD-based) provides significantly higher IOPS and lower latency for random write workloads, directly addressing the high queue depth and throughput drop. This is the most cost-effective solution because pd-ssd offers the necessary performance improvement without requiring architectural changes or over-provisioning capacity.

Exam trap

The trap here is that candidates may think increasing disk size (Option D) is the cheapest way to improve IOPS, but they overlook that pd-standard's IOPS/GB ratio is so low that the cost to reach equivalent pd-ssd performance would be much higher, making a disk type change the more cost-effective choice.

How to eliminate wrong answers

Option B is wrong because regional persistent disks provide higher availability through synchronous replication across zones, but they do not improve IOPS or latency performance over the base disk type; they would still use pd-standard performance if that type is selected. Option C is wrong because adding more replicas of the StatefulSet does not reduce write latency on the existing disks; writes to the MySQL database are typically concentrated on a single primary instance, and distributing writes across multiple disks would require application-level sharding, which is not described. Option D is wrong because increasing disk size improves IOPS limits for pd-standard disks only marginally (IOPS scale linearly with size but remain far below pd-ssd levels), and it would be less cost-effective than switching to pd-ssd since you would need a much larger pd-standard volume to match pd-ssd IOPS.

1406
MCQeasy

A company wants to use the Vertical Pod Autoscaler (VPA) to automatically adjust resource requests for their pods. They want the VPA to update the resource requests of running pods. Which VPA updateMode should they use?

A.Auto
B.Initial
C.Recreate
D.Off
AnswerA

Incorrect. Auto mode applies recommendations by recreating pods, violating the 'without recreating them' requirement.

Why this answer

The VPA Auto mode automatically updates resource requests for running pods (by evicting and recreating them when necessary). Initial only assigns requests at pod creation and never updates running pods. Recreate mode evicts and recreates pods to apply recommendations, similar to Auto but more aggressive.

Off only provides recommendations without applying changes. Since the requirement is to update running pods, Auto is the appropriate mode.

1407
Multi-Selectmedium

A company is using Bigtable for a high-throughput write workload. They need to monitor replication lag between clusters in a replicated setup and ensure that reads are eventually consistent. Which two configurations should they check? (Choose TWO.)

Select 2 answers
A.Create a replication dashboard in Data Studio
B.Set the replication consistency level to 'strong'
C.Ensure replication is set to asynchronous (default)
D.Monitor the 'bigtable.googleapis.com/cluster/replication_lag' metric
E.Enable synchronous replication for zero lag
AnswersC, D

Async replication is the default and provides eventual consistency.

Why this answer

Bigtable replication is asynchronous and eventually consistent by default. Replication lag can be monitored using the 'replication lag' metric in Cloud Monitoring. Consistency levels are not configurable; async is the default.

1408
Multi-Selecthard

You are managing a Cloud SQL for MySQL instance that is experiencing high latency and connection timeouts during peak hours. The current configuration uses 4 vCPUs, 15 GB memory, and 100 GB SSD storage. The database workload is a mix of transactional queries and batch inserts. Which TWO actions would most effectively reduce latency and improve performance?

Select 2 answers
A.Disable binary logging to reduce write I/O.
B.Increase the storage size to 200 GB to improve IOPS.
C.Increase the instance to 8 vCPUs and 30 GB memory.
D.Decrease the max_connections parameter to reduce overhead.
E.Enable the Cloud SQL proxy and use connection pooling.
AnswersC, E

Provides more resources to handle peak load.

Why this answer

Increasing vCPUs and memory directly addresses the resource bottleneck causing high latency and connection timeouts during peak hours. Cloud SQL for MySQL performance is heavily dependent on CPU for query processing and memory for buffer pool caching; doubling these resources reduces query execution time and improves concurrency handling. Option E is correct because using Cloud SQL proxy with connection pooling reduces the overhead of establishing new connections, which is a common cause of latency and timeouts under high concurrency.

Connection pooling reuses database connections, minimizing connection setup time and improving throughput. The other options are incorrect: A (disabling binary logging is not recommended for production as it compromises point-in-time recovery), B (increasing storage does not linearly improve IOPS beyond a baseline and does not address compute/memory bottleneck), and D (decreasing max_connections may cause more timeouts under peak load rather than reduce them).

Exam trap

Google Cloud often tests the misconception that increasing storage always improves IOPS, but in Cloud SQL for MySQL, IOPS scaling is tied to storage size only up to a baseline, and the real bottleneck in this scenario is compute and memory, not storage throughput.

1409
Multi-Selecthard

An engineer is manually migrating a MySQL database to Cloud SQL using mysqldump and import. They need to capture the binary log position to enable CDC with Database Migration Service later. Which TWO mysqldump flags should they include to ensure a consistent snapshot and capture the log position? (Choose 2 correct answers.)

Select 2 answers
A.--no-data
B.--single-transaction
C.--master-data=2
D.--skip-lock-tables
E.--triggers
AnswersB, C

This flag ensures a consistent snapshot without locking tables.

Why this answer

--single-transaction ensures a consistent snapshot by starting a transaction and avoiding table locks (for InnoDB). --master-data=2 writes the binary log position as a comment in the dump file (value 2). --skip-lock-tables is not needed because --single-transaction handles consistency. --triggers exports triggers but not binary log position. --no-data excludes data.

1410
MCQmedium

A team wants to define an SLO for their service based on availability. Over a 30-day window, the service handled 1,000,000 requests, of which 999,500 succeeded. What is the achieved availability, and what is the error budget consumed if the SLO is 99.95%?

A.99.95% availability; error budget consumed 50%
B.99.95% availability; error budget remaining 100%
C.99.5% availability; error budget consumed 10%
D.99.95% availability; error budget consumed 100%
AnswerD

Correct calculation: availability equals SLO, so all budget used.

Why this answer

Availability = successful / total = 999,500 / 1,000,000 = 99.95%. SLO target is also 99.95%, so the allowed error budget is 0.05% of requests = 500 failures. Actual failures = 500, so error budget consumed = 500/500 = 100%.

1411
MCQhard

You are designing a Spanner schema for a social media application. The table Posts has primary key (UserId, PostId) where PostId is a UUID. The application frequently queries all posts for a given user, ordered by timestamp descending. The current schema uses PostId as the second part of the key, which is random. How can you improve read performance for this query pattern?

A.Use a hash prefix on UserId
B.Create a secondary index on (UserId, Timestamp DESC) with STORING clause
C.Use a materialized view
D.Change the primary key to (UserId, Timestamp, PostId)
AnswerB

This index supports the query pattern efficiently without changing the primary key.

Why this answer

To efficiently query posts for a user in descending order of timestamp, you need the timestamp to be part of the primary key after UserId. However, using PostId (UUID) as the second part doesn't help ordering. You can add a timestamp column and create a secondary index with descending order, but that adds write overhead.

Another approach is to change the primary key to (UserId, Timestamp, PostId) and use a separate mechanism to avoid hotspots (e.g., hash prefix on Timestamp). But the simplest improvement is to use a secondary index on (UserId, Timestamp DESC). The question asks to improve read performance; a secondary index with storing clause can provide good performance.

The best answer is to create a secondary index on UserId and Timestamp with STORING to include other columns.

1412
MCQeasy

A company is running a MySQL database on Cloud SQL and needs to optimize for high random read/write performance. Which storage type should they choose?

A.SSD persistent disk
B.Local SSD
C.Balanced persistent disk
D.HDD persistent disk
AnswerA

SSD persistent disk offers high IOPS and low latency, ideal for database storage in Cloud SQL.

Why this answer

SSD persistent disk provides consistent low-latency performance for random read/write operations, which is critical for MySQL databases on Cloud SQL. It offers higher IOPS and throughput compared to HDD or balanced persistent disks, making it the optimal choice for high random read/write workloads.

Exam trap

The trap here is that candidates may confuse Local SSD's high performance with persistence, not realizing it is ephemeral and cannot be used for Cloud SQL's managed database service, which requires durable storage.

How to eliminate wrong answers

Option B (Local SSD) is wrong because it is ephemeral and data is lost if the instance stops or fails, making it unsuitable for persistent database storage on Cloud SQL. Option C (Balanced persistent disk) is wrong because it offers lower IOPS and higher latency than SSD persistent disk, which is not ideal for high random read/write performance. Option D (HDD persistent disk) is wrong because it is designed for sequential read/write workloads and has significantly lower IOPS and higher latency, making it unsuitable for random access patterns.

1413
MCQmedium

A team uses Skaffold for local development and wants to integrate it into their CI/CD pipeline on Cloud Build for continuous deployment to GKE. What is the recommended approach?

A.Use Cloud Build's built-in kubectl deployer
B.Run 'skaffold dev' in the Cloud Build step
C.Convert skaffold.yaml to a Helm chart
D.Use 'skaffold run' in a Cloud Build step
AnswerD

'skaffold run' builds and deploys once, suitable for CI/CD.

Why this answer

Skaffold can be run as a step in cloudbuild.yaml. It handles building, tagging, and deploying based on skaffold.yaml configuration. Using 'skaffold run' in a Cloud Build step is the standard integration.

1414
MCQhard

A team is reviewing IAM permissions on a Cloud Storage bucket. The exhibit shows the bucket's IAM policy. A developer is using the service account sa-1 and reports that they cannot delete objects in the bucket. What is the likely reason?

A.The etag value must be updated before any delete operation.
B.The service account sa-1 does not have the storage.objects.delete permission.
C.A condition is attached to the objectViewer role that prevents deletion.
D.The policy only allows deletion by the service account sa-2.
AnswerB

objectViewer only grants read access.

Why this answer

The IAM policy shown in the exhibit grants the `objectViewer` role to service account `sa-1`, which includes the `storage.objects.get` and `storage.objects.list` permissions but does not include `storage.objects.delete`. Without the `storage.objects.delete` permission, the developer cannot delete objects in the bucket, even if they can view them. The correct answer is B because the service account lacks the necessary delete permission.

Exam trap

Google Cloud often tests the distinction between viewing and deleting objects, where candidates mistakenly assume that having read access (objectViewer) also allows deletion, or that a condition or etag is the blocking factor, rather than recognizing the missing delete permission.

How to eliminate wrong answers

Option A is wrong because the `etag` field in an IAM policy is used for optimistic concurrency control during policy updates, not for object deletion operations; object deletion does not require updating the etag. Option C is wrong because the exhibit shows no conditions attached to the `objectViewer` role; even if a condition existed, it would restrict access further, but the core issue is the lack of the delete permission. Option D is wrong because the policy does not explicitly restrict deletion to `sa-2`; it only grants `storage.objectAdmin` to `sa-2`, which includes delete permission, but this does not prevent `sa-1` from deleting if it had the permission.

1415
MCQhard

A financial services company is migrating from an on-premises Oracle RAC database to Cloud Spanner. The current application uses sequences to generate globally unique IDs for transactions. To avoid creating hotspots in Spanner, the database architect recommends using a different primary key strategy. Which primary key design is most appropriate for Spanner to avoid hotspots?

A.Use a bit-reversed sequential key generated by the application.
B.Use a UUID string as the primary key.
C.Continue using sequential IDs from Oracle sequences to maintain consistency.
D.Use a composite key with a hash prefix derived from the transaction timestamp.
AnswerA

Bit-reversed keys distribute writes evenly while preserving some locality, avoiding hotspots.

Why this answer

Bit-reversed sequential keys distribute writes evenly across Cloud Spanner's split boundaries, preventing hotspots. Spanner uses key-range-based sharding, so monotonically increasing keys (like Oracle sequences) cause all new writes to hit a single split, leading to contention. Bit-reversal spreads sequential values across the key space, ensuring balanced write distribution.

Exam trap

A common trap in this question is that candidates may assume UUIDs are the best choice for distributed databases due to their uniqueness, but in Cloud Spanner, UUIDs cause storage bloat and poor performance due to random key distribution. The real pitfall is overlooking the hotspot issue with sequential keys and not considering Spanner's key-range sharding behavior.

How to eliminate wrong answers

Option B is wrong because UUIDs, while random, are 128-bit strings that cause excessive storage overhead and poor read locality in Spanner; they also lead to random splits and inefficient range scans. Option C is wrong because continuing to use sequential IDs from Oracle sequences creates monotonically increasing keys, which cause all new writes to target the same Spanner split, creating a hotspot. Option D is wrong because a composite key with a hash prefix derived from the transaction timestamp can still lead to hotspots if the timestamp is monotonically increasing; additionally, hash prefixes add complexity and may not guarantee uniform distribution if the hash function is not carefully chosen.

1416
Multi-Selecteasy

You need to send alert notifications to a Slack channel. Which TWO components are required?

Select 2 answers
A.A notification channel of type 'slack' in Cloud Monitoring
B.A Slack webhook URL
C.A Cloud Pub/Sub topic
D.An email notification channel
E.A Cloud Function to transform the alert
AnswersA, B

Correct. The Slack notification channel must be created with the webhook URL.

Why this answer

To send alerts to Slack, you need a Slack app with a webhook URL, and a Cloud Monitoring notification channel of type 'slack' configured with that webhook URL. Pub/Sub is not required for Slack directly; Slack channels are configured via webhooks. Email notification channel type is incorrect; Slack is a separate type.

A Cloud Function could be used as an intermediary but is not required.

1417
MCQmedium

A logistics company uses BigQuery to track shipments. The `shipments` table has columns `id`, `status`, `created_date`, and `delivery_date`. They need a query that returns the number of shipments that were delivered within 5 days of creation for each month of 2024. Which SQL construct is most appropriate?

A.SELECT EXTRACT(MONTH FROM created_date) AS month, COUNT(*) FROM shipments WHERE TIMESTAMP_DIFF(delivery_date, created_date, HOUR) <= 120 AND EXTRACT(YEAR FROM created_date) = 2024 GROUP BY month
B.SELECT EXTRACT(MONTH FROM created_date) AS month, COUNTIF(DATETIME_DIFF(delivery_date, created_date, DAY) <= 5) FROM shipments WHERE EXTRACT(YEAR FROM created_date) = 2024 GROUP BY month
C.SELECT EXTRACT(MONTH FROM created_date) AS month, COUNT(*) FROM shipments WHERE DATETIME_DIFF(delivery_date, created_date, DAY) <= 5 AND EXTRACT(YEAR FROM created_date) = 2024 GROUP BY month
D.SELECT EXTRACT(MONTH FROM created_date) AS month, COUNT(*) FROM shipments WHERE DATE_DIFF(delivery_date, created_date, DAY) <= 5 AND EXTRACT(YEAR FROM created_date) = 2024 GROUP BY month
AnswerC

Correct function and clear intent.

Why this answer

It uses `DATETIME_DIFF` with `DAY` precision to accurately compute the difference between `delivery_date` and `created_date` in days, and filters for shipments delivered within 5 days (i.e., <= 5 days). The `WHERE` clause also restricts to the year 2024, and the `GROUP BY month` with `EXTRACT(MONTH FROM created_date)` correctly aggregates counts per month. This matches the requirement precisely.

Exam trap

Google Cloud often tests the distinction between `DATE_DIFF`, `DATETIME_DIFF`, and `TIMESTAMP_DIFF`, and candidates mistakenly choose `DATE_DIFF` without considering the actual data types of the columns, or they use `TIMESTAMP_DIFF` with hours thinking it is equivalent, but fail to account for timezone and daylight saving effects.

How to eliminate wrong answers

Option A is wrong because it uses `TIMESTAMP_DIFF` with `HOUR` precision and checks `<= 120` hours, which is equivalent to 5 days but introduces potential edge-case errors due to daylight saving time shifts or timezone differences, and it is less readable and less precise for day-level logic. Option B is wrong because it uses `COUNTIF` with `DATETIME_DIFF` inside the SELECT clause, but `COUNTIF` is not a valid aggregate function in standard BigQuery SQL; the correct function is `COUNTIF` only in the context of a `COUNT` with a filter expression, but here it would cause a syntax error. Option D is wrong because it uses `DATE_DIFF` with `DAY` precision, but `DATE_DIFF` expects `DATE` type arguments, and if `delivery_date` or `created_date` are `DATETIME` or `TIMESTAMP` types, this will cause a type mismatch error or implicit conversion issues.

1418
MCQeasy

A developer needs to authenticate to Artifact Registry from a CI/CD pipeline that runs on Compute Engine. The pipeline does not have access to user credentials. Which authentication method should they use?

A.Configure Workload Identity on the Compute Engine VM
B.Create a service account key and store it in Cloud Storage
C.Use a personal access token in the pipeline
D.Use gcloud auth login with a user account
AnswerA

Workload Identity allows the VM to authenticate as a service without keys.

Why this answer

Workload Identity allows a Compute Engine VM to act as a service account without needing to manage keys. The VM's service account can be granted permissions to access Artifact Registry.

1419
MCQmedium

An organization is migrating an Oracle database to Cloud SQL for PostgreSQL. They have numerous stored procedures written in PL/SQL. Which tool should they use to automatically convert these procedures to PL/pgSQL?

A.Ora2Pg
B.BigQuery Data Transfer Service
C.Database Migration Service (DMS)
D.gcloud sql import
AnswerA

Ora2Pg is designed for Oracle-to-PostgreSQL schema conversion, including stored procedures.

Why this answer

Ora2Pg is a schema conversion tool that translates Oracle PL/SQL code to PostgreSQL PL/pgSQL, handling data type mappings and object conversions.

1420
MCQmedium

Your Firestore database in Native mode is used by a mobile app. You need to query a collection where documents are filtered by two fields: 'status' (string) and 'createdAt' (timestamp). The query is not performing as expected. What action is required?

A.Create an index exemption for the collection to allow multi-field queries.
B.Add a third field to the query to make it more specific.
C.Create a composite index on the 'status' and 'createdAt' fields.
D.Ensure that single-field indexes exist for both 'status' and 'createdAt'.
AnswerC

Composite indexes are required for multi-field queries. Firestore does not automatically create them.

Why this answer

Firestore in Native mode requires a composite index to efficiently query documents filtered by multiple fields, such as 'status' and 'createdAt'. Without this index, the query may fail or perform poorly, as Firestore cannot combine separate single-field indexes for equality and range filters. Option C is correct because creating a composite index on both fields enables the query to run as expected.

Exam trap

Google Cloud often tests the misconception that single-field indexes are sufficient for multi-field queries, but Firestore requires composite indexes for any query combining equality and range filters on different fields.

How to eliminate wrong answers

Option A is wrong because index exemptions are not a Firestore feature; they are used in other databases like Cloud Datastore to skip automatic index creation, but Firestore requires explicit composite indexes for multi-field queries. Option B is wrong because adding a third field does not resolve the missing composite index requirement; it would only introduce another filter that still needs indexing. Option D is wrong because single-field indexes exist by default in Firestore for all fields, but they cannot be combined to support queries with both an equality filter on 'status' and a range filter on 'createdAt'; a composite index is mandatory.

1421
Multi-Selectmedium

A team is planning a migration from Oracle to PostgreSQL on Cloud SQL. They use Ora2Pg to convert the schema. Which THREE Oracle data types require special attention for correct mapping to avoid data loss or precision issues? (Choose 3 correct answers.)

Select 3 answers
A.DATE
B.NUMBER(10,2)
C.FLOAT
D.CLOB
E.VARCHAR2
AnswersA, B, D

Oracle DATE includes time; maps to TIMESTAMP, not DATE.

Why this answer

NUMBER(10,2) maps to NUMERIC(10,2) (exact). DATE in Oracle includes time, so it maps to TIMESTAMP. CLOB maps to TEXT.

VARCHAR2 maps to VARCHAR. FLOAT maps to double precision, but NUMBER(10) without decimal maps to INTEGER. The tricky ones are DATE (includes time), NUMBER with precision (exact numeric), and CLOB (large text).

1422
MCQmedium

An e-commerce platform uses Cloud Spanner with a table Orders and a child table OrderItems. The primary key of Orders is (CustomerId, OrderId) where OrderId is a UUID. The primary key of OrderItems is (CustomerId, OrderId, ItemId). However, writes to OrderItems are creating hotspots. What is the most likely cause?

A.Using UUID for OrderId causes random writes
B.The primary key is too long
C.The parent-child interleaving is not defined correctly
D.The leading key (CustomerId) is monotonically increasing
AnswerD

Monotonically increasing leading keys cause writes to concentrate on one tablet, creating hotspots.

Why this answer

Hotspots occur when writes are concentrated on a small range of keys. Since OrderId is a UUID, it's already random. However, using CustomerId as the first part of the primary key can cause hotspots if certain customers place many orders.

But more commonly, if OrderItems uses the same CustomerId and OrderId, and many items are inserted for the same order, they will be interleaved and written sequentially. Still, the hotspot is due to the leading key CustomerId being monotonically increasing if customers are assigned IDs sequentially. The best answer is that the primary key design leads to concentrated writes because CustomerId is not distributed well.

However, the question likely expects that the primary key design is correct (UUID) but the hotspot might be due to not using a hash prefix. Actually, in Spanner, the first key part should be distributed. If CustomerId is sequential (e.g., auto-increment), it causes hotspots.

So the cause is a monotonically increasing leading key. The correct answer should point to the leading key being monotonically increasing.

1423
MCQhard

A retail company uses BigQuery to store sales data. The 'sales' table has 10 billion rows and is partitioned by transaction_date (daily). The BI dashboard runs a query that aggregates sales by product_category for the last 30 days. The query is slow and expensive. Which improvement is most effective?

A.Cluster the table on product_category
B.Change partitioning to monthly
C.Denormalize the product_category into the sales table
D.Use a materialized view with aggregation on product_category
AnswerA

Clustering on product_category organizes data within each partition so that queries filtering/aggregating on that column scan fewer blocks.

Why this answer

Clustering the table on product_category organizes the data within each daily partition by that column, allowing BigQuery to use block-level pruning to skip irrelevant blocks when filtering or aggregating by product_category. This directly reduces the amount of data scanned for the 30-day aggregation query, improving both performance and cost.

Exam trap

Google Cloud often tests the distinction between partitioning (which limits data by time range) and clustering (which organizes data within partitions for column-based pruning), and candidates mistakenly choose partitioning changes or materialized views without understanding that clustering directly addresses the slow aggregation on a non-time column.

How to eliminate wrong answers

Option B is wrong because changing partitioning from daily to monthly would increase the partition size, forcing the query to scan more data per partition (the entire month) rather than only the last 30 days, which would actually worsen performance and cost. Option C is wrong because denormalizing product_category into the sales table is already the current schema; the issue is not about normalization but about data organization for efficient pruning. Option D is wrong because a materialized view with aggregation on product_category would still require scanning all partitions unless the view is also partitioned and clustered; moreover, materialized views in BigQuery are best for pre-aggregating high-frequency queries but do not inherently reduce scan costs if the underlying table is not properly clustered.

1424
MCQmedium

A company is migrating Oracle to Cloud SQL for PostgreSQL using Ora2Pg. For a column defined as NUMBER(10,2) in Oracle, what is the corresponding data type in PostgreSQL?

A.INTEGER
B.NUMERIC(10,2)
C.DOUBLE PRECISION
D.TEXT
AnswerB

NUMERIC(10,2) matches the precision and scale.

Why this answer

Oracle's NUMBER(10,2) specifies a fixed-point number with up to 10 digits total and 2 digits after the decimal point. PostgreSQL's NUMERIC(10,2) is the direct equivalent, offering identical precision and scale semantics. Ora2Pg automatically maps NUMBER(p,s) to NUMERIC(p,s) to preserve exact numeric storage.

Exam trap

A common misconception in Google Cloud migrations is that NUMBER(p,s) maps to DOUBLE PRECISION or FLOAT. Candidates often confuse fixed-point and floating-point semantics, especially when they see 'NUMBER' and assume it's a generic numeric type instead of recognizing the exact precision and scale specified.

How to eliminate wrong answers

Option A is wrong because INTEGER stores only whole numbers without decimal places, losing the fractional precision required by NUMBER(10,2). Option C is wrong because DOUBLE PRECISION is a floating-point type that can introduce rounding errors for exact decimal values, unlike the fixed-point NUMERIC. Option D is wrong because TEXT is a variable-length string type, completely unsuitable for storing numeric data with precision and scale constraints.

1425
MCQmedium

A team manages infrastructure across multiple Google Cloud projects using Terraform. They want to centralize state file management in a GCS bucket and ensure that each project's state is isolated. Which backend configuration best achieves this?

A.Use a single bucket with a separate prefix for each project; configure the backend for each project with its own prefix.
B.Use a separate bucket for each project.
C.Use local state files and commit them to Git.
D.Store all state files in the same bucket under the same prefix and use workspaces.
AnswerA

This isolates state files by project using prefixes.

Why this answer

Terraform backend configuration allows specifying a GCS bucket and prefix. Using a separate prefix per project (e.g., `project-a/terraform.tfstate`) isolates state files. Workspaces are not needed; the prefix approach is simpler.

Page 18

Page 19 of 20

Page 20