Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 226300

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

Page 3

Page 4 of 20

Page 5
226
Multi-Selecthard

A team is designing a CI/CD pipeline for a microservice that requires canary deployments with metrics-based rollback. They want to use Cloud Deploy and Cloud Run. Which three features must they configure? (Choose 3)

Select 3 answers
A.Canary deployment strategy with canary percentage and metric thresholds
B.Delivery pipeline with dev, staging, and prod targets
C.Cloud Run as the deployment target
D.Binary Authorization policy
E.Manual approval gate on the prod target
AnswersA, B, C

This defines the canary rollout and rollback conditions.

Why this answer

Cloud Deploy's canary strategy requires a delivery pipeline with stages, targets using Cloud Run, and a canary deployment strategy with percentage and metrics. Approval gates are optional.

227
MCQmedium

A team is migrating an on-premises MySQL database to Cloud SQL using DMS with continuous CDC. The source database uses public IP. The DMS connection profile for the source requires IP allowlisting. Which IP addresses should be allowlisted?

A.The IP address of the Cloud SQL Auth Proxy.
B.The public IP of the Cloud SQL instance.
C.The IP address of the DMS service in the region of the destination.
D.The private IP range of the destination VPC.
AnswerC

DMS uses a specific IP range for the region; this must be allowlisted on the source firewall.

Why this answer

DMS uses a managed VPC network; the outgoing IPs come from the region where the DMS job runs. These are published as a range and must be allowlisted on the source.

228
MCQeasy

Which database service should you use if your workload requires complex JOINs, ACID transactions, and you want to avoid operational overhead of managing patching and backups?

A.Cloud SQL
B.Cloud Bigtable
C.Firestore
D.Cloud Storage
AnswerA

Cloud SQL provides fully managed relational databases with ACID transactions and JOIN support.

Why this answer

Cloud SQL is a fully managed relational database service for MySQL, PostgreSQL, and SQL Server that handles patching, backups, and replication. AlloyDB also is managed, but Cloud SQL is more common for standard OLTP. Firestore and Bigtable are NoSQL.

229
MCQmedium

A company uses Cloud Bigtable with replication across two regions. They want to ensure that read requests are automatically routed to the nearest available cluster with the lowest latency. Which routing policy should be configured?

A.Single-cluster routing
B.Any-replica routing
C.Multi-cluster routing
D.Read-failover routing policy
AnswerC

Multi-cluster routing routes reads to the nearest cluster based on latency and provides automatic failover, meeting the requirement.

Why this answer

Bigtable replication supports two routing policies: single-cluster routing and multi-cluster routing. Multi-cluster routing allows the Bigtable client to route requests to the nearest cluster based on latency, and it automatically fails over to another cluster if the first is unavailable. Any-replica routing is not a valid Bigtable policy.

Read-failover routing is a Cloud DNS concept, not Bigtable. Single-cluster routing forces all requests to a specific cluster.

230
MCQmedium

An SRE team notices that a routine database cleanup task takes 30 minutes of manual effort each week. The task does not add enduring value and scales linearly with the number of databases. How should the team classify this work?

A.Technical debt.
B.Operational overhead.
C.Toil.
D.Engineering project.
AnswerC

Matches all characteristics of toil: manual, repetitive, no enduring value, scales with growth.

Why this answer

This work is manual, repetitive, does not add enduring value, and scales with service growth — the classic definition of toil. SREs should automate it and track it against the toil budget.

231
MCQmedium

What is the most likely cause of the high execution time?

A.The WHERE clause uses a string comparison
B.Missing index on status column
C.The query selects two columns causing inefficiency
D.The instance has insufficient nodes
E.The query does not filter on primary key
AnswerB

An index on status would allow efficient row retrieval instead of a full table scan.

Why this answer

The execution plan shows a full table scan. Since the query filters on the status column, an index on that column would allow direct lookup instead of scanning all rows. The high execution time is most likely due to the missing index on the status column.

Therefore, option B is correct. Options A, C, D, and E are not the primary cause: string comparison (A) does not inherently cause high execution time; selecting two columns (C) is not inefficient; insufficient instance nodes (D) would affect overall performance but not specifically this query; not filtering on primary key (E) is not a problem if other columns are indexed appropriately.

232
MCQmedium

An engineer is building a CI/CD pipeline for a microservice that uses feature flags via LaunchDarkly. They want to automatically enable a new feature flag in a staging environment after deployment, but not in production. How should they integrate this into Cloud Deploy?

A.Use a Cloud Build step after deployment to call LaunchDarkly API
B.Enable the flag manually in LaunchDarkly after deployment
C.Configure a postDeploy hook in Cloud Deploy that invokes a Cloud Run Job to enable the flag
D.Use a Kubernetes ConfigMap to hold flag state, and have the app read it
AnswerC

postDeploy hooks run after a deployment succeeds, allowing environment-specific actions.

Why this answer

Cloud Deploy's postDeploy hooks allow you to run a Cloud Run Job after a rollout completes, which can call the LaunchDarkly REST API to enable the flag specifically for the staging target. This integrates flag management directly into the pipeline without manual steps or exposing production flags.

Exam trap

The trap here is that candidates confuse Cloud Build steps (which run before deployment) with Cloud Deploy hooks (which run after deployment), and fail to recognize that postDeploy hooks can be scoped per environment to avoid affecting production.

How to eliminate wrong answers

Option A is wrong because a Cloud Build step runs during the build phase, not after deployment, and cannot conditionally target only staging environments; it would run for all deployments. Option B is wrong because manual flag enabling defeats the purpose of automated CI/CD and introduces human error risk, especially in staging where repeatable automation is expected. Option D is wrong because a Kubernetes ConfigMap is a static configuration mechanism that cannot dynamically toggle feature flags at runtime via LaunchDarkly, and it bypasses the flag management system entirely.

233
Multi-Selectmedium

Which TWO are valid methods to define an SLI for a request-driven service? (Choose 2.)

Select 2 answers
A.Proportion of requests completed within a latency threshold
B.CPU utilization of the server
C.Number of code commits per week
D.Number of running instances
E.Proportion of requests returning a successful HTTP status
AnswersA, E

This is latency SLI.

Why this answer

Common SLIs: proportion of successful requests (availability) and proportion of requests meeting a latency threshold.

234
MCQeasy

A site reliability engineer needs to alert when the error budget burn rate exceeds 14x the budget over a 1-hour window. Which type of alert should be configured in Cloud Monitoring?

A.Error budget burn rate alert with a 30-day window and 1x burn rate
B.Slow burn rate alert with a 6-hour window and 5x burn rate
C.SLI threshold alert when latency exceeds 500 ms
D.Fast burn rate alert with a 1-hour window and 14x burn rate
AnswerD

This matches the requirement for fast burn alerting.

Why this answer

Fast burn rate alerts use a short window (1 hour) and a high burn rate threshold (14x). Slow burn rate alerts use a longer window (6 hours) and a lower threshold (5x).

235
MCQeasy

A company uses Artifact Registry to store Docker images. They want to enforce that only images signed by a trusted authority can be deployed to their GKE cluster. Which service should they use with Artifact Registry?

A.Binary Authorization
B.Identity and Access Management (IAM)
C.Container Analysis
D.Cloud Build
AnswerA

Binary Authorization ensures only signed images are deployed, integrating with Artifact Registry.

Why this answer

Binary Authorization enforces deployment-time policy based on image signatures. Container Analysis scans for vulnerabilities, not enforcements; IAM controls access; Cloud Build is the CI service.

236
MCQmedium

You are running a Cloud Run service that performs background image processing tasks after responding to HTTP requests. Users report that tasks are sometimes not completed. You have set CPU to always-on, but you notice the service's concurrency is set to the default of 80. What is the most likely cause of incomplete tasks?

A.The service should use Gen2 execution environment for better background processing.
B.The CPU always-on setting is not sufficient; you need to enable background CPU.
C.You need to increase the request timeout beyond 60 minutes.
D.The concurrency setting of 80 allows too many requests to share the instance's CPU, starving background tasks.
AnswerD

High concurrency causes resource contention; reducing concurrency gives each request more CPU.

Why this answer

Cloud Run allows up to 80 concurrent requests per instance by default. If the concurrency is too high, the instance's CPU may be overwhelmed, causing background tasks to be preempted or not completed. Setting CPU to always-on ensures CPU is available but does not limit concurrency.

Reducing concurrency to a lower value (e.g., 1) ensures each request gets dedicated CPU for background work.

237
MCQmedium

During a blameless postmortem after an incident, the team identified that the root cause was a misconfigured load balancer health check. Which practice should the team prioritize to prevent recurrence?

A.Create a rollback plan for health check changes
B.Schedule a weekly manual review of load balancer settings
C.Add a test in CI/CD to validate health check configuration
D.Write a runbook for future load balancer incidents
AnswerC

Automated validation prevents misconfiguration from reaching production.

Why this answer

A blameless postmortem focuses on finding contributing factors and creating action items to improve the system. The action item should be to fix the health check configuration and automate validation. Implementing a runbook for future incidents is reactive, not preventive.

Creating a rollback plan is also reactive.

Exam trap

A common misconception is that writing a runbook is sufficient, but automated validation in the CI/CD pipeline is the only way to prevent recurrence of misconfigured health checks.

238
MCQmedium

A data analyst is running a BigQuery query that joins multiple tables to generate a BI report. The query is slow and uses many LEFT JOINs. What is the best approach to improve performance without changing the business logic?

A.Denormalize the data using nested repeated fields to avoid joins
B.Add indexes on the join columns
C.Replace LEFT JOINs with INNER JOINs where possible
D.Increase the number of BigQuery slots
AnswerA

Using nested repeated fields reduces joins and improves query performance by storing related data together.

Why this answer

Denormalizing data using nested repeated fields in BigQuery reduces the number of JOIN operations, which are expensive in a distributed, columnar storage system. By storing related data in a single table with REPEATED fields, the query avoids shuffling large datasets across slots, directly improving performance while preserving the original business logic.

Exam trap

Google Cloud often tests the misconception that traditional database optimization techniques like indexing or increasing resources apply to BigQuery, when in fact the correct approach is to leverage BigQuery's native schema design features like nested and repeated fields.

How to eliminate wrong answers

Option B is wrong because BigQuery does not support traditional indexes; it uses columnar storage and clustering/partitioning for performance, so adding indexes is not applicable. Option C is wrong because replacing LEFT JOINs with INNER JOINs changes the business logic by excluding rows that do not have matching records in the joined table, which may alter the BI report results. Option D is wrong because increasing the number of BigQuery slots only addresses resource contention, not the root cause of slow JOINs; it is a costly workaround that does not optimize the query structure.

239
Multi-Selectmedium

Which THREE actions can reduce read latency for a globally distributed Cloud Spanner database?

Select 3 answers
A.Use read-only replicas (follower reads)
B.Use multi-region configuration
C.Use leader reads
D.Use interleaved tables
E.Use secondary indexes
AnswersA, B, E

Follower reads allow reads from nearby replicas instead of the leader, reducing latency.

Why this answer

Read-only replicas (follower reads) allow Cloud Spanner to serve read requests from non-leader replicas, reducing the distance data must travel and thus lowering read latency for globally distributed users. This is particularly effective when strong consistency is not required, as follower reads can return data that is up to a few seconds stale but much faster to access from a nearby replica.

Exam trap

Google Cloud often tests the misconception that leader reads are always optimal for latency, but the trap here is that leader reads actually increase latency for distant users because they force all reads to the single leader region, while follower reads distribute read traffic to the nearest replica.

240
MCQmedium

An e-commerce platform uses Cloud SQL for PostgreSQL. They need to run complex reporting queries that join several tables. These queries are slowing down the transactional workload. What should they do?

A.Create materialized views for common reports.
B.Change all joins to use subqueries.
C.Increase the number of vCPUs on the primary instance.
D.Use read replicas to offload reporting queries.
AnswerD

Read replicas serve read-only traffic without impacting the primary.

Why this answer

Read replicas in Cloud SQL for PostgreSQL allow you to offload read-only queries, such as complex reporting joins, from the primary instance. This separation reduces contention for CPU, memory, and I/O resources, preserving transactional performance. Read replicas are asynchronous and can handle heavy analytical workloads without impacting the primary's write path.

Exam trap

The trap here is that candidates confuse materialized views (which still run on the primary) with read replicas (which offload the query execution entirely), leading them to choose A instead of D.

How to eliminate wrong answers

Option A is wrong because materialized views are stored on the same primary instance and do not offload query processing; they still consume the same CPU and I/O resources, and refreshing them can add further load. Option B is wrong because changing joins to subqueries does not reduce resource consumption—subqueries often perform worse than joins in PostgreSQL due to lack of optimization for correlated subqueries. Option C is wrong because increasing vCPUs on the primary instance only scales vertically, which may help but does not isolate reporting workloads; the transactional queries still compete for the same resources, and scaling is limited by instance tier constraints.

241
MCQmedium

A company runs a Cloud SQL for PostgreSQL instance that is nearing its storage limit of 500 GB. The database administrator needs to increase storage capacity online without any downtime. What should they do?

A.Use the gcloud sql instances patch command with --storage-size flag
B.Enable automatic storage increase and wait for it to trigger
C.Delete and recreate the instance with a larger disk
D.Shut down the instance, increase the disk size, and restart
AnswerA

Correct. The gcloud sql instances patch command can resize storage online.

Why this answer

The `gcloud sql instances patch` command with the `--storage-size` flag allows you to increase the storage capacity of a Cloud SQL for PostgreSQL instance online without any downtime. Cloud SQL supports live storage increases by automatically resizing the underlying persistent disk while the instance remains available, so no restart or maintenance window is required.

Exam trap

Google often tests the misconception that storage increases require a restart or downtime, but Cloud SQL supports online storage scaling via the gcloud command, making options that involve shutdown or recreation incorrect.

How to eliminate wrong answers

Option B is wrong because enabling automatic storage increase only triggers when the instance reaches a predefined threshold (typically 90% of current capacity), and it increases storage in small increments (e.g., 10 GB), which may not be sufficient to immediately address a near-limit situation and could still risk downtime if the threshold is crossed unexpectedly. Option C is wrong because deleting and recreating the instance would cause complete downtime and data loss unless a backup is restored, which is not a zero-downtime solution. Option D is wrong because shutting down the instance to increase disk size introduces downtime, which violates the requirement of no downtime; Cloud SQL does not require a shutdown for storage increases.

242
MCQhard

A company is deploying a microservice to Cloud Run. They need to ensure that the service can handle sudden traffic spikes without cold starts. The service has a memory requirement of 2 GB and CPU usage is bursty. What should they configure?

A.Set --min-instances to 2 and --cpu-throttling to false.
B.Set --ingress to all and --vpc-connector to a Serverless VPC Access connector.
C.Set --max-instances to 100 and --concurrency to 80.
D.Set --memory to 2Gi and --cpu to 2.
AnswerA

min-instances keeps at least 2 instances warm. Setting cpu-throttling to false ensures CPU is always available, but that's optional. The key is min-instances.

Why this answer

Setting --min-instances to 2 ensures that at least two container instances are always warm, eliminating cold starts during traffic spikes. Setting --cpu-throttling to false disables CPU throttling, allowing the service to use burst CPU capacity immediately without waiting for allocation, which is ideal for bursty CPU workloads.

Exam trap

Google Cloud often tests the distinction between resource allocation (memory/CPU) and operational settings (min-instances, CPU throttling) that directly impact cold starts and burst handling, leading candidates to mistakenly choose resource sizing options.

How to eliminate wrong answers

Option B is wrong because configuring ingress and a VPC connector addresses network access control and private connectivity, not cold starts or CPU burst handling. Option C is wrong because setting --max-instances and --concurrency controls scaling limits and request concurrency, but does not prevent cold starts or manage CPU throttling. Option D is wrong because setting --memory and --cpu defines resource allocation, but does not keep instances warm or disable CPU throttling to handle sudden spikes without cold starts.

243
MCQeasy

A company runs a production Cloud SQL for PostgreSQL instance used by a web application. The instance experiences intermittent latency spikes during peak hours. You need to diagnose the cause without downtime. Which tool should you use first?

A.Use Database Migration Service to failover to a read replica.
B.Use Cloud SQL Insights to analyze query performance and identify slow queries.
C.Use gcloud sql instances describe to check instance configuration.
D.Use VPC Flow Logs to analyze network traffic.
AnswerB

Cloud SQL Insights provides query-level performance diagnostics without downtime.

Why this answer

Cloud SQL Insights provides built-in query performance monitoring and diagnostics without requiring any downtime. It surfaces slow queries, lock contention, and resource bottlenecks directly from the PostgreSQL engine, making it the ideal first step to identify the root cause of intermittent latency spikes during peak hours.

Exam trap

The trap here is that candidates may confuse Cloud SQL Insights with a general monitoring tool like VPC Flow Logs or assume that failing over to a read replica is a diagnostic step, when in fact Insights is the only option that provides database-internal performance data without downtime.

How to eliminate wrong answers

Option A is wrong because Database Migration Service is used for migrating databases to Cloud SQL, not for failover; failing over to a read replica would cause downtime during the promotion process and does not diagnose the latency issue. Option C is wrong because gcloud sql instances describe only returns static configuration metadata (e.g., machine type, region, maintenance window) and does not provide real-time query performance or latency diagnostics. Option D is wrong because VPC Flow Logs capture network-level metadata (source/destination IP, ports, packet count) and cannot reveal slow SQL queries, lock waits, or database engine internals.

244
MCQeasy

An organization wants to store Docker images in a private Google Cloud repository with vulnerability scanning enabled. Which service should they use?

A.Container Registry
B.Cloud Build
C.Artifact Registry
D.Cloud Storage
AnswerC

Artifact Registry supports Docker repositories with integrated vulnerability scanning via Container Analysis.

245
MCQhard

A BI team uses BigQuery BI Engine to accelerate dashboards. They have a 100 GB table and enable BI Engine with a reservation of 10 GB. Some queries on this table are still slow. What is the most likely reason?

A.The query selects columns that are not fully cached due to the small reservation size.
B.BI Engine only works with SQL views, not direct tables.
C.The table uses clustering, which BI Engine ignores.
D.The table is partitioned, which BI Engine does not support.
AnswerA

BI Engine reserves memory for caching columns; insufficient memory leads to partial caching.

Why this answer

BI Engine accelerates queries by caching columns in memory. With a 100 GB table and only a 10 GB reservation, the cache can hold only a fraction of the table's columns. Queries that reference columns not fully cached will fall back to BigQuery's standard execution, causing slow performance.

Exam trap

Google Cloud often tests the misconception that BI Engine caches entire tables, when in reality it caches only columns up to the reservation limit, and queries referencing uncached columns will be slow.

How to eliminate wrong answers

Option B is wrong because BI Engine works with both tables and SQL views, not exclusively with views. Option C is wrong because BI Engine fully supports clustered tables and can leverage clustering metadata for efficient pruning. Option D is wrong because BI Engine supports partitioned tables and can use partition pruning to reduce the data scanned.

246
MCQmedium

A DevOps team is designing a landing zone for a multi-team organization. They need to separate environments (prod, staging, dev) and also provide isolated projects for each team's sandbox testing. The team wants to centrally manage networking and security through a shared VPC. Which folder structure best supports this design?

A.Folders: TeamA, TeamB; inside each: prod, staging, dev projects
B.Folders: prod, staging, dev; inside each, folders for each team's project; no sandbox folder
C.Folders: prod, staging, dev, common; inside each, folders for teams with their projects; plus a sandbox folder
D.Folders: prod, staging, dev, sandbox; all projects inside with no team subfolders
AnswerC

This separates environments, teams, and shared services; sandbox projects can be placed in a separate folder with relaxed policies.

Why this answer

A common best practice is to have environment folders (prod, staging, dev) and within each, team folders with team-specific projects. A separate 'common' folder for shared services like networking and security aligns with a landing zone design. The 'Sandbox' folder can contain sandbox projects outside the environment hierarchy.

247
MCQmedium

A company uses Cloud Spanner for a global inventory application. They need to add a new index to a large table without downtime. What is the recommended approach?

A.Create the index using ALTER TABLE with 'ONLINE' clause
B.Use gcloud spanner databases ddl update with --async flag
C.Take a backup, create index on a new instance, and switch traffic
D.Use CREATE INDEX; Spanner handles it as a non-blocking operation
AnswerD

Spanner perform index creation as a background operation that does not block writes.

Why this answer

Cloud Spanner's CREATE INDEX operation is inherently non-blocking; it performs the index backfill as a background process without locking the table or blocking reads and writes. This allows the index to be added to a large table with zero downtime, as Spanner manages the consistency and availability of the data throughout the operation.

Exam trap

The PCDOE exam often tests the misconception that Cloud Spanner requires special syntax or flags (like ONLINE or --async) to achieve non-blocking DDL, when in fact all DDL operations in Spanner are designed to be non-blocking by default.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner does not support an 'ONLINE' clause in ALTER TABLE; that syntax is specific to Oracle and other databases, not Spanner. Option B is wrong because the --async flag in gcloud spanner databases ddl update merely returns immediately without waiting for the DDL operation to complete, but the underlying CREATE INDEX operation is still the same non-blocking mechanism; the flag does not change the blocking behavior—it only affects the client-side wait. Option C is wrong because taking a backup and creating an index on a new instance is unnecessary overhead; Spanner's native non-blocking index creation eliminates the need for such a cumbersome migration, which would also introduce potential data inconsistency and extended downtime during traffic switch.

248
MCQmedium

A company has a parent-child relationship in Cloud Spanner. They want to minimize cross-table join latency. What should they use?

A.Interleaved tables
B.Cloud Functions
C.Stored procedures
D.Secondary indexes
AnswerA

Interleaved tables physically co-locate parent and child rows, minimizing join latency.

249
Multi-Selecthard

Which THREE considerations are important when designing a schema for Cloud Firestore to ensure scalability?

Select 3 answers
A.Design collections to avoid high read/write rates on a single document.
B.Create composite indexes tailored to the application's query patterns.
C.Nest subcollections up to 10 levels deep to model complex hierarchies.
D.Use collection group indexes for all queries to avoid manual index creation.
E.Limit document size to avoid exceeding the 1 MiB limit.
AnswersA, B, E

Hot documents cause contention; distribute writes across documents.

Why this answer

Cloud Firestore scales by distributing data across multiple documents. A single document with high read/write rates creates a hotspot, leading to contention and degraded performance. Designing collections to spread load evenly avoids this bottleneck and ensures linear scalability.

Exam trap

A common misconception is that deeper nesting (up to 10 levels) or automatic indexes simplify schema design, but Cloud Firestore's scalability relies on shallow, flat structures and explicit composite indexes tailored to query patterns.

250
MCQhard

A data scientist runs a complex SQL query on a large BigQuery dataset and receives the above error. The query joins 10 tables and uses multiple window functions. Which action is most likely to resolve the issue?

A.Apply for a quota increase for concurrent queries.
B.Increase the number of slots allocated to the project.
C.Use the '--maximum_billing_tier' flag to increase the billing tier.
D.Simplify the query by reducing the number of joins or using a temporary table.
AnswerD

Reducing query complexity lowers resource demands and can stay within tier limits.

Why this answer

The error is likely a resource or memory exhaustion error caused by the complexity of the query (10 joins and multiple window functions). Simplifying the query by reducing joins or using temporary tables reduces the amount of data shuffled and processed in a single stage, directly addressing the root cause. In BigQuery, complex queries with many joins and window functions can exceed slot memory limits, and breaking them into simpler steps avoids this.

Exam trap

A common misconception in BigQuery is that increasing slot allocation or concurrency limits will resolve resource exhaustion errors caused by complex queries. In reality, the root cause is often query complexity, and simplifying the query (e.g., by reducing joins or using temporary tables) directly addresses memory and slot limits.

How to eliminate wrong answers

Option A is wrong because applying for a quota increase for concurrent queries addresses the number of queries running simultaneously, not the resource consumption of a single complex query. Option B is wrong because increasing the number of slots allocated to the project provides more parallel processing capacity but does not fix the underlying issue of a query that exceeds per-stage memory or shuffle limits; it may only delay the failure. Option C is wrong because the '--maximum_billing_tier' flag is a legacy BigQuery feature that caps query cost, not a way to increase resources; it cannot resolve memory or complexity errors.

251
MCQmedium

A company needs to store petabytes of time-series IoT sensor data and query it with single-digit millisecond latency at millions of reads per second. The data has a simple key-value structure with timestamps. Which Google Cloud database is MOST appropriate?

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

Bigtable is the correct choice: wide-column NoSQL, designed for time-series and IoT workloads, single-digit ms latency, and scales to millions of QPS with additional nodes.

Why this answer

Cloud Bigtable is designed for exactly this use case — petabyte-scale, low-latency (single-digit ms), high-throughput NoSQL storage for time-series, IoT, and financial data. It scales horizontally by adding nodes. BigQuery is optimised for analytics (seconds-to-minutes latency), Cloud SQL is for OLTP (limited to tens of thousands of QPS), and Firestore is for document data with hierarchical structure.

252
MCQmedium

A financial institution uses BigQuery for BI reporting. They have a table 'transactions' (10 TB) partitioned by transaction_date and clustered by customer_id. A common report filters on customer_id and last 30 days. The report is slow. Which change would most improve query performance for this specific report?

A.Change partition column to customer_id
B.Remove clustering and rely only on partitioning
C.Add clustering on transaction_date in addition to customer_id
D.Manually recluster the table daily
AnswerC

Clustering on the partition column can further optimize queries that filter on both customer_id and date range.

Why this answer

The report filters on customer_id and the last 30 days. The table is partitioned by transaction_date and clustered by customer_id. Adding clustering on transaction_date (in addition to customer_id) allows BigQuery to sort rows within each partition by transaction_date, enabling block pruning for the date range filter in addition to partition pruning.

This reduces the amount of data scanned and improves query performance. Option A is incorrect because changing the partition column to customer_id would not help with the date filter, which is a key part of the report. Option B is wrong because removing clustering would increase scanned data for the customer_id filter.

Option D is unnecessary because BigQuery automatically manages clustering metadata; manual reclustering is not required.

Exam trap

Candidates often assume clustering on the partition column provides no benefit, but when partition granularity is coarser than the filter range (e.g., monthly partitions vs. 30-day filter), clustering on the partition column within each partition further reduces scanned data by sorting rows by date, enabling faster block pruning for the exact date range.

How to eliminate wrong answers

Option A is wrong because changing the partition column to customer_id would prevent partition pruning for the date filter (last 30 days), forcing a full table scan of 10 TB and degrading performance. Option B is wrong because removing clustering entirely would eliminate the benefit of sorted blocks within partitions, increasing the amount of data scanned even with partition pruning. Option D is wrong because manually reclustering the table daily is unnecessary and inefficient; BigQuery automatically manages clustering metadata during write operations, and manual reclustering does not provide additional performance gains for this query pattern.

253
MCQeasy

An organization requires a disaster recovery solution for Cloud SQL with a target RPO of less than 5 minutes and RTO of less than 2 hours. The primary region is us-central1, and the DR region is us-west1. Which approach should they use?

A.Create a cross-region read replica and promote it during disaster
B.Use point-in-time recovery with daily backups and restore into a new instance
C.Configure a scheduled export of the database to Cloud Storage and import in DR region
D.Enable HA configuration in a single region
AnswerA

Cross-region read replicas have minimal replication lag, providing low RPO and RTO within minutes after promotion.

Why this answer

Cross-region read replicas provide an RPO equal to replication lag (typically <5s) and RTO of minutes (manual promotion). This meets the requirements. Cross-region backup restore would have an RPO equal to the last backup age (hours) and RTO of hours.

HA failover is for same-region only. PITR alone does not provide cross-region DR.

254
MCQmedium

A team wants to improve incident response by creating a runbook for a common failure scenario: a database replication lag exceeds 5 seconds. Which Cloud Monitoring feature should be used to automatically trigger the runbook?

A.Write a cron job on a VM that checks Cloud Monitoring metrics via API and runs the runbook
B.Configure a Cloud Monitoring alert to send a notification to a Cloud Function that executes the runbook steps
C.Create a Cloud Monitoring dashboard that displays replication lag and expect the on-call engineer to follow the runbook manually
D.Use Cloud Scheduler to run the runbook every 5 minutes
AnswerB

This automates the runbook execution in response to the alert.

Why this answer

Cloud Monitoring alert policies can trigger notifications to various channels, including webhooks that can integrate with incident management tools like PagerDuty or OpsGenie. These tools can then invoke runbooks automatically. Alternatively, Cloud Monitoring can directly send to Cloud Run or Cloud Functions that execute the runbook.

The key is that the alert triggers an automated response.

255
MCQeasy

A team is designing a schema for a time-series database in Bigtable to store IoT sensor readings. Each sensor sends a reading every minute. The team needs to create a row key that supports efficient queries for a specific sensor's readings over a time range. Which row key design is most appropriate?

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

Groups all readings for a sensor together in reverse chronological order.

Why this answer

Bigtable stores rows sorted lexicographically by row key. By placing the sensor_id first, all readings for a given sensor are co-located in contiguous rows. Using reverse_timestamp (e.g., 9999-12-31 minus actual timestamp) ensures that the most recent readings appear first within that sensor's row range, which optimizes scans for the latest data and allows efficient range queries over a time window.

Exam trap

Google Cloud often tests the misconception that putting the timestamp first is always best for time-range queries, but in Bigtable, the row key's prefix determines data locality, so the sensor_id must come first to avoid scattering reads across the entire table.

How to eliminate wrong answers

Option A is wrong because timestamp first scatters readings for the same sensor across the entire table, making queries for a specific sensor's time range require a full table scan or multiple lookups. Option B is wrong because hashing the sensor_id destroys the natural sort order, so even though the sensor_id is first, the hash distributes rows randomly, preventing efficient range scans over time. Option D is wrong because a random UUID provides no ordering or grouping, forcing full table scans for any sensor-specific time-range query.

256
Multi-Selectmedium

A company is designing a disaster recovery plan for their Cloud Bigtable instance. They need to ensure that in the event of a regional outage, they can failover to a secondary region with minimal data loss and automatic re-routing of traffic. Which TWO actions should they take? (Choose two.)

Select 2 answers
A.Export Bigtable data to Cloud Storage daily and script the import into a new cluster.
B.Set up Cloud DNS with a health check that updates the routing policy to the secondary cluster on failure.
C.Increase the number of nodes in the primary cluster to handle failover load.
D.Configure Bigtable replication with a secondary cluster in a different region.
E.Use Cloud Spanner instead of Bigtable for built-in multi-region failover.
AnswersB, D

Cloud DNS health check can detect primary failure and automatically update the routing policy to direct traffic to the secondary cluster, achieving automated failover.

Why this answer

To achieve DR with Bigtable, you need to configure replication to a secondary cluster in a different region. Additionally, you need to configure the application's routing to failover to the secondary cluster. Using Cloud DNS with a health check that updates the routing policy can automate traffic re-routing.

Increasing the number of nodes does not provide DR. Exporting to Cloud Storage is for backup, not failover. Using Spanner is a different service.

257
MCQhard

A team is using Firestore in Native mode. They have a collection 'users' with an array field 'roles'. They need to query all users where roles contains 'admin'. What index configuration is required?

A.Create a single-field index on roles with ascending order.
B.Create an index exemption on the 'roles' field.
C.Create a composite index on roles and the default field.
D.No index is needed; Firestore automatically supports array-contains queries.
AnswerB

Correct. An index exemption is required for array fields to support array-contains queries.

Why this answer

Firestore supports array membership queries using the 'array-contains' operator. An index exemption for the array field is required because Firestore does not automatically index array fields for array-contains queries. The exemption is created manually.

258
MCQhard

A company is performing a heterogeneous migration from Oracle to Cloud SQL for PostgreSQL using Ora2Pg. During testing, they find that a stored procedure using Oracle's PL/SQL `DBMS_OUTPUT.PUT_LINE` does not execute after conversion. What is the most likely issue, and how should it be resolved?

A.The procedure uses `DBMS_OUTPUT.PUT_LINE`, which should be replaced with `RAISE EXCEPTION`.
B.The procedure uses `DBMS_OUTPUT.PUT_LINE`, which is supported natively in PostgreSQL.
C.The procedure uses `DBMS_OUTPUT.PUT_LINE`, which should be replaced with `RAISE NOTICE` in PostgreSQL.
D.The procedure must be rewritten in Python using PL/Python.
AnswerC

Correct. `DBMS_OUTPUT.PUT_LINE` is Oracle-specific; in PostgreSQL, use `RAISE NOTICE`.

Why this answer

Ora2Pg converts PL/SQL to PL/pgSQL. `DBMS_OUTPUT.PUT_LINE` in Oracle is equivalent to `RAISE NOTICE` in PostgreSQL. Ora2Pg may not automatically convert all procedural constructs, requiring manual review and adjustment.

259
Multi-Selecthard

A Cloud Bigtable instance is configured with asynchronous replication across two regions for disaster recovery. The team needs to ensure that read-after-write consistency is maintained within a region. Which three strategies should they implement? (Choose THREE.)

Select 3 answers
A.After writing, have the application wait for a confirmation that the write is durable before performing a read.
B.Use single-cluster routing for read/write operations within the primary region.
C.Disable replication and use only the primary cluster.
D.Use multi-cluster routing to distribute reads across regions.
E.Monitor replication lag metrics to ensure replicas are up to date.
AnswersA, B, E

Application-level confirmation ensures consistency.

Why this answer

In Cloud Bigtable, writes are acknowledged only after they are committed to the tablet server's log and replicated to the underlying Colossus file system. By waiting for this confirmation before performing a read, the application ensures that the read will see the latest write, providing read-after-write consistency within the region.

Exam trap

The trap here is that candidates confuse asynchronous replication with eventual consistency and assume that monitoring replication lag alone can guarantee read-after-write consistency, when in fact only application-level write confirmation and single-cluster routing provide that guarantee within a region.

260
Multi-Selectmedium

A company wants to implement a landing zone with centralized logging and monitoring. Which TWO services should they use to collect and analyze logs from all projects? (Choose 2)

Select 2 answers
A.Cloud Logging
B.Cloud Monitoring
C.Pub/Sub
D.Cloud Storage
E.BigQuery
AnswersA, E

Aggregates logs from all projects into a central sink.

Why this answer

Centralized logging requires Logging (to aggregate logs) and BigQuery (for analysis and long-term storage). Cloud Monitoring is for metrics, not logs. Pub/Sub is for streaming, not analysis.

Cloud Storage can store logs but is not ideal for analysis.

261
MCQmedium

Your Cloud SQL for PostgreSQL instance is experiencing intermittent slowdowns during peak hours. You notice that the CPU utilization spikes to 80% and the number of connections increases. The application team confirms they are not running any new queries. What should you do first to diagnose the issue?

A.Increase the machine type of the Cloud SQL instance to add more CPU.
B.Enable connection pooling to reduce the number of connections.
C.Use Cloud SQL Insights to analyze query performance and wait statistics.
D.Set a maximum connection limit and reduce the connection lifetime.
AnswerC

Query Insights helps identify high CPU queries, wait events, and performance trends.

Why this answer

Cloud SQL Insights provides built-in query performance monitoring and wait statistics that can pinpoint the root cause of intermittent slowdowns without making changes. Since CPU spikes and increased connections are symptoms, not the cause, analyzing wait events (e.g., CPU, IO, lock contention) directly reveals which queries or resources are bottlenecked. This is the first diagnostic step before any scaling or configuration changes.

Exam trap

Google Cloud often tests the principle that you must diagnose before scaling; the trap here is that candidates jump to scaling or connection limits (A, B, D) because they seem like immediate fixes, but the correct first step is always to use monitoring tools like Cloud SQL Insights to identify the actual bottleneck.

How to eliminate wrong answers

Option A is wrong because increasing the machine type adds cost and masks the underlying issue without diagnosing why CPU spikes occur; it treats a symptom, not the cause. Option B is wrong because enabling connection pooling reduces connection overhead but does not address CPU spikes or query performance; it may even hide connection-related issues without solving the root cause. Option D is wrong because setting a maximum connection limit or reducing connection lifetime can cause application errors or dropped connections without identifying why connections are increasing or why CPU is spiking.

262
MCQmedium

What is the correct way to create a Spanner instance with 2 nodes?

A.Use --num-nodes=2 instead of --nodes
B.Set --processing-units=2000 and remove --nodes
C.Remove the --processing-units flag
D.Set --nodes=2 and --processing-units=0
AnswerC

Nodes and processing units are exclusive; remove one.

Why this answer

`--processing-units` and `--nodes` are mutually exclusive flags in `gcloud spanner instances create`. To create a 2-node instance, you must use only `--nodes=2` and omit `--processing-units`. The `--nodes` flag is the correct way to specify the number of nodes; `--num-nodes` is not a valid flag.

Exam trap

The trap is that candidates may think they need to use both `--nodes` and `--processing-units` or that `--processing-units` can be used for any instance size. In reality, `--processing-units` is only for small, burstable configurations (up to 1000 processing units), and for node-based instances, only `--nodes` is used. They are mutually exclusive.

How to eliminate wrong answers

Option A is wrong because `--num-nodes=2` is the correct flag, but the statement says 'instead of --nodes' — there is no `--nodes` flag in the gcloud spanner instances create command; the correct flag is `--num-nodes`. Option B is wrong because setting `--processing-units=2000` would create a 2-node equivalent in processing units (1000 per node), but the question explicitly asks for '2 nodes', not a processing-units-based instance, and removing `--nodes` is not a valid approach. Option D is wrong because `--processing-units=0` is invalid (minimum is 100) and combining `--nodes=2` with `--processing-units` is not allowed; the flags are mutually exclusive.

263
MCQmedium

A company uses Cloud SQL for PostgreSQL and wants to create a cross-region read replica for disaster recovery (DR) purposes. They also want the option to promote the replica to a standalone instance in the event of a regional outage. What should the engineer do?

A.Export the database as a SQL file and import it into a new instance in the target region during DR.
B.Create a cross-region read replica and use gcloud sql instances promote-replica to promote it during DR.
C.Create a same-region read replica and enable point-in-time recovery on it.
D.Configure cross-region backup replicas and restore from backup in the target region.
AnswerB

This is the correct approach. Cross-region replica provides DR, and promotion makes it a standalone instance.

Why this answer

Cloud SQL for PostgreSQL supports cross-region read replicas, which can be promoted to standalone instances using the `gcloud sql instances promote-replica` command. This provides a managed DR solution with minimal data loss (asynchronous replication) and faster failover compared to export/import or backup restore methods.

Exam trap

Google often tests the distinction between read replicas (which can be promoted for DR) and backups (which require manual restore), leading candidates to mistakenly choose backup-based options like D or export/import like A.

How to eliminate wrong answers

Option A is wrong because exporting and importing a SQL file is a manual, time-consuming process that does not provide near-real-time replication, leading to significant data loss and longer recovery time objectives (RTO). Option C is wrong because a same-region read replica does not protect against a regional outage; it only provides read scalability and high availability within the same region. Option D is wrong because Cloud SQL does not support 'cross-region backup replicas'; backups are regional and must be manually copied or restored to another region, which is slower and less automated than a cross-region read replica promotion.

264
MCQeasy

A small business runs a Cloud SQL instance with 10 GB data. They want to automate daily backups with 7-day retention. They also need to restore quickly if needed. What is the simplest solution?

A.Use Cloud Scheduler to trigger exports.
B.Export to Cloud Storage daily using a cron job.
C.Enable automatic backups in Cloud SQL settings.
D.Use gcloud to create a backup schedule with retention.
AnswerC

Automatic backups are simple and support retention settings.

Why this answer

Cloud SQL provides a built-in automatic backup feature that can be configured with a 7-day retention period directly in the instance settings. This eliminates the need for custom scripts or external schedulers, and enables point-in-time recovery for fast restoration without manual export/import overhead.

Exam trap

The trap here is that candidates often overcomplicate the solution by choosing manual export/import methods (A, B, D) when Cloud SQL's built-in automatic backup feature provides a simpler, fully managed solution with integrated retention and fast restore capabilities.

How to eliminate wrong answers

Option A is wrong because Cloud Scheduler triggers exports to Cloud Storage, which are manual snapshot-like backups that do not support point-in-time recovery and require additional steps to restore, adding complexity. Option B is wrong because exporting to Cloud Storage via a cron job is a manual, scripted approach that lacks the automated retention management and integrated restore capabilities of Cloud SQL's native backup feature. Option D is wrong because gcloud commands can create backup schedules, but this still requires manual setup and does not leverage the fully managed automatic backup feature with built-in retention and point-in-time recovery that is simpler to enable via the Cloud Console or API.

265
MCQmedium

You need to transfer 10 TB of data from on-premises servers to Cloud Storage for loading into Bigtable. Which method is the most efficient and reliable for this volume?

A.Set up Cloud VPN and use rsync
B.Use Storage Transfer Service
C.Use gsutil cp in parallel
D.Use Dataflow to read and write data
AnswerB

Storage Transfer Service is designed for large-scale data transfers with features like incremental sync and verification.

Why this answer

The Storage Transfer Service is designed for large-scale, online data transfers from on-premises or other cloud providers to Google Cloud. It handles 10 TB efficiently by automatically managing retries, checksums, and network optimization without requiring manual scripting or persistent VPN connections, making it the most reliable and efficient choice for this volume.

Exam trap

The trap here is that candidates confuse 'efficient and reliable' with 'fastest raw throughput' (gsutil cp in parallel) or 'familiar tool' (rsync), overlooking that managed services like Storage Transfer Service provide built-in fault tolerance and optimization for large-scale transfers.

How to eliminate wrong answers

Option A is wrong because Cloud VPN provides encrypted connectivity but does not optimize bulk data transfer; rsync over VPN lacks built-in retry logic and parallelization for 10 TB, leading to slow and unreliable transfers. Option C is wrong because gsutil cp in parallel can transfer data but requires manual management of concurrency, retries, and consistency checks, and is less reliable than a managed service for 10 TB. Option D is wrong because Dataflow is a stream and batch processing framework, not a data transfer tool; using it to read and write data adds unnecessary complexity and cost compared to a purpose-built transfer service.

266
Multi-Selecthard

A data team uses BigQuery and wants to ensure data freshness for BI reports with low latency. Which three techniques can help achieve near-real-time updates? (Select THREE).

Select 3 answers
A.Create a scheduled query that rewrites the entire table every hour
B.Use a live view that queries the source table directly
C.Use BigQuery's BI Engine for caching
D.Use streaming inserts to load data in real-time
E.Schedule a query every 15 minutes to refresh a materialized view
AnswersB, D, E

A view always returns the latest data from the base table, so it reflects streaming inserts immediately.

Why this answer

A live view (also known as a logical view) queries the source table directly each time it is accessed, ensuring that BI reports always see the most current data without any materialization delay. This provides near-real-time freshness by avoiding periodic refresh cycles.

Exam trap

The trap here is that candidates often confuse caching mechanisms (like BI Engine) with data freshness techniques, not realizing that caching improves query speed but does not update the underlying data; they may also mistakenly think that periodic full table rewrites (Option A) are acceptable for near-real-time, when in fact they introduce significant latency and cost.

267
MCQeasy

You are designing a Firestore database for a chat application. Documents will store messages with fields: senderId, messageText, timestamp, conversationId. To efficiently retrieve the most recent 50 messages in a conversation, which index should you create?

A.A composite index on (conversationId, timestamp, __name__) descending
B.A single-field index on timestamp
C.An index on conversationId only
D.A composite index on (senderId, timestamp)
AnswerA

This index covers the query with filtering and ordering, enabling efficient retrieval.

Why this answer

To efficiently retrieve the most recent 50 messages for a specific conversation, you need a composite index on (conversationId, timestamp, __name__) with descending order. This allows Firestore to perform a range query on conversationId and then order by timestamp descending, using the index to skip scanning irrelevant documents. The __name__ field is included to ensure the index is covering and to handle document name ordering ties, which is required for consistent pagination with descending order.

Exam trap

A common misconception is that a single-field index on the ordering field (timestamp) is sufficient for filtered and ordered queries, but Firestore requires a composite index that includes all equality filter fields before the order field to avoid a full collection scan. Additionally, including __name__ in the index ensures proper handling of document name sorting for consistent pagination with descending order.

How to eliminate wrong answers

Option B is wrong because a single-field index on timestamp alone cannot filter by conversationId, so Firestore would have to scan all messages across all conversations to find the most recent 50 for a specific conversation, which is inefficient and expensive. Option C is wrong because an index on conversationId only allows filtering by conversation but does not support ordering by timestamp, so Firestore would need to sort the results in memory, which fails for large datasets and cannot guarantee efficient retrieval of the most recent 50. Option D is wrong because a composite index on (senderId, timestamp) filters by sender, not by conversation, so it cannot efficiently retrieve messages for a given conversation; it would require a full collection scan or an additional filter step.

268
MCQhard

A BI team uses a complex SQL query with multiple Common Table Expressions (CTEs) that are referenced several times within the main query. The query performs poorly. What is the best optimization strategy?

A.Add indexes on the tables used in the CTEs
B.Use temporary tables or table snapshots to materialize the CTE results
C.Reuse the same CTE names as often as possible in the query
D.Replace CTEs with derived tables in the FROM clause
AnswerB

Materializing the result once and referencing the temporary table avoids repeated computation.

Why this answer

CTEs are not materialized by default; they are re-evaluated each time they are referenced, leading to repeated execution of the same logic. By using temporary tables or table snapshots, you materialize the intermediate result set once, which avoids redundant scans and significantly improves performance for complex queries with multiple CTE references.

Exam trap

Google Cloud often tests the misconception that CTEs are automatically materialized or cached, leading candidates to overlook the need for explicit temporary tables when performance is critical.

How to eliminate wrong answers

Option A is wrong because adding indexes on base tables does not address the core issue of repeated CTE evaluation; indexes can help but are not a targeted fix for the redundant execution of CTE logic. Option C is wrong because reusing the same CTE name multiple times does not change execution behavior; each reference still triggers a separate evaluation of the CTE definition. Option D is wrong because replacing CTEs with derived tables in the FROM clause does not change the execution plan; derived tables are also non-materialized and will be re-evaluated on each reference, offering no performance benefit.

269
MCQmedium

A data engineer is designing a BI solution in BigQuery for a retail chain. They need to support queries that aggregate sales by store, product, and date across millions of transactions. The data is loaded in near real-time from Cloud Pub/Sub. Which table design provides the best balance of query performance and cost?

A.Partition by store_id, cluster by product_id
B.Partition by date, cluster by store_id and product_id
C.Unpartitioned table with clustering on store_id and product_id
D.Use materialized views with aggregation on store_id, product_id, and date
AnswerB

Partitioning by date enables efficient pruning for time-range queries, and clustering on store_id and product_id speeds up common aggregations.

Why this answer

Partitioning by date enables BigQuery to prune entire partitions when querying by date range, which is the most common filter in sales aggregation queries. Clustering on store_id and product_id further reduces the data scanned within each partition by colocating rows with similar store and product values. This design minimizes both query cost (bytes billed) and latency, while supporting near-real-time ingestion from Pub/Sub without requiring table rewrites.

Exam trap

Google Cloud often tests the misconception that partitioning can be applied to any column type (like store_id) or that clustering alone is sufficient for cost control, when in fact BigQuery requires partitioning on a time-unit or integer-range column and clustering is a complementary optimization, not a replacement.

How to eliminate wrong answers

Option A is wrong because BigQuery does not support partitioning by store_id (partitioning requires a DATE, TIMESTAMP, or INTEGER column with a specified range), and clustering alone cannot provide the same level of cost reduction as date-based partitioning for time-range queries. Option C is wrong because an unpartitioned table with clustering only still requires scanning the entire table for queries that filter by date, leading to higher costs and slower performance compared to a partitioned design. Option D is wrong because materialized views are automatically refreshed and incur additional storage costs; they do not replace the need for an efficient base table design, and they cannot be used as the primary ingestion target for near-real-time data from Pub/Sub.

270
MCQeasy

A retail company is designing a Cloud Spanner schema for an order management system. Orders are identified by a UUID and contain multiple line items. Each line item references a product. Which schema design best supports high read throughput for queries that retrieve all line items for a given order?

A.Store orders and line items in a single table with repeated fields for line items.
B.Create an Orders table and a LineItems table interleaved in Orders with ORDER_ID as the parent key.
C.Create separate Orders and LineItems tables with a foreign key relationship and index on ORDER_ID.
D.Denormalize product information into the LineItems table and store orders separately.
AnswerB

Interleaving colocates line items with their order for fast retrieval.

Why this answer

Cloud Spanner interleaved tables store child rows (LineItems) physically adjacent to their parent row (Orders) on the same split, enabling a single key lookup to retrieve all line items for a given order without cross-table joins or distributed queries. This colocation maximizes read throughput by minimizing latency and avoiding scatter-gather operations across nodes.

Exam trap

Google Cloud often tests the misconception that a foreign key with an index is equivalent to interleaving for performance, but in Cloud Spanner, only interleaved tables guarantee physical colocation and single-split access for parent-child queries, whereas indexed foreign keys still require distributed lookups.

How to eliminate wrong answers

Option A is wrong because storing repeated fields (e.g., ARRAY<STRUCT>) for line items within a single row violates Cloud Spanner's 10 MB row size limit and prevents efficient indexing or atomic updates of individual line items, degrading throughput for large orders. Option C is wrong because separate tables with a foreign key and index on ORDER_ID require a two-step lookup (index scan then table access) and may involve distributed reads if the index and data are on different splits, increasing latency compared to interleaving. Option D is wrong because denormalizing product information into LineItems does not address the core read pattern (retrieving all line items for an order) and introduces data redundancy and update anomalies without improving colocation; it still requires a separate table or repeated fields, neither of which matches the interleaved design's performance benefit.

271
MCQmedium

A company runs a MySQL database on-premises and wants to migrate to Cloud SQL with minimal downtime. They have a multi-terabyte database. Which migration method is most appropriate?

A.Use Cloud SQL's import feature from a CSV file.
B.Take a physical backup and restore to Cloud SQL.
C.Use Database Migration Service with continuous replication.
D.Use mysqldump to export and then import into Cloud SQL.
AnswerC

DMS provides minimal downtime via CDC.

Why this answer

Database Migration Service (DMS) supports continuous replication and minimal downtime for large databases. It handles initial snapshot and ongoing CDC.

272
MCQeasy

You are designing a schema for Cloud Spanner and need to avoid write hotspots. Which primary key design strategy is recommended?

A.Use the most frequently queried column as the primary key
B.Use a UUID or hash prefix as the first part of the primary key
C.Use a composite key with the leading column being a timestamp
D.Use a monotonically increasing timestamp as the primary key
AnswerB

UUIDs or hash prefixes distribute writes across tablets, avoiding hotspots.

Why this answer

Using a UUID or a hash prefix as the first part of the primary key ensures that writes are distributed across nodes, avoiding hotspots. Monotonically increasing keys like timestamps cause all writes to hit the same tablet, creating a hotspot.

273
Multi-Selectmedium

A company is designing a schema for Cloud Spanner for an order management system. They need to ensure efficient joins between Order and OrderItems tables. Which TWO design practices should they adopt? (Choose 2)

Select 2 answers
A.Use parent-child interleaving for Order and OrderItems
B.Use a monotonically increasing primary key for Order
C.Store OrderItems in a separate database
D.Use UUID as primary key for Order
E.Denormalize OrderItems into an array column in Order
AnswersA, D

Interleaving optimizes joins between parent and child tables.

Why this answer

Parent-child interleaving places child rows physically near parent rows, enabling efficient joins. Using the OrderId as the primary key of Order and also as the first part of the primary key of OrderItems (with a line item identifier) allows for strongly consistent interleaved queries.

274
MCQmedium

A company is migrating their on-premises Oracle database to Cloud SQL for PostgreSQL. They want to test the converted stored procedures using unit tests. Which framework should they use?

A.pgAdmin
B.SQL Developer
C.pgTAP
D.Ora2Pg
AnswerC

pgTAP is a PostgreSQL testing framework for unit testing SQL functions and procedures.

Why this answer

pgTAP is a unit testing framework for PostgreSQL that can test stored procedures and functions.

275
MCQeasy

An SRE team wants to define an SLO for a microservice that processes HTTP requests. They need an SLI that measures the proportion of requests that are answered within 200ms with a non-5xx status code. Which type of SLI should they use?

A.Request-based SLI counting good requests divided by total requests
B.Availability-based SLI using a rolling window of 30 days
C.Window-based SLI counting good minutes
D.Throughput-based SLI measuring requests per second
AnswerA

A request-based SLI where a good request is one with latency <=200ms and a non-5xx status fits this scenario.

Why this answer

A latency-based SLI with a threshold (200ms) combined with availability (non-5xx) is a request-based SLI measuring good requests (fast+successful) over total requests.

276
MCQhard

An organization is migrating an Oracle database to Cloud SQL for PostgreSQL using Ora2Pg. During testing, a stored procedure that uses Oracle's SYSDATE produces incorrect results. What is the correct approach to handle this conversion?

A.Replace SYSDATE with LOCALTIMESTAMP.
B.Use TO_DATE(SYSDATE, 'YYYY-MM-DD HH24:MI:SS') to convert the value.
C.Replace SYSDATE with CURRENT_TIMESTAMP.
D.Replace SYSDATE with CURRENT_DATE in the converted procedure.
AnswerC

CURRENT_TIMESTAMP returns date and time with time zone, equivalent to Oracle's SYSDATE.

Why this answer

Oracle's SYSDATE returns date and time; PostgreSQL equivalent is CURRENT_TIMESTAMP (or NOW()). Simply mapping to CURRENT_DATE would lose time component, breaking logic.

277
MCQhard

Your Cloud SQL for SQL Server instance has a query that uses a non-clustered index to filter rows but then performs key lookups to retrieve additional columns. The query is slow. Which database tuning option would most likely reduce I/O?

A.Increase the buffer pool size
B.Rebuild the non-clustered index with FILLFACTOR=80
C.Create a covering index that includes all columns referenced in the query
D.Use a FORCESEEK query hint
AnswerC

Covering index avoids the need for lookups, reducing I/O.

Why this answer

The query is slow because key lookups require random I/O to retrieve additional columns not included in the non-clustered index. Creating a covering index that includes all columns referenced in the query eliminates the need for key lookups entirely, converting the operation into a single index seek or scan with minimal I/O. This directly reduces the number of page reads and improves query performance.

Exam trap

Google Cloud often tests the misconception that any index tuning or query hint can fix performance, but the trap here is that candidates may choose FORCESEEK or FILLFACTOR without realizing that only a covering index directly addresses the root cause of key lookup I/O.

How to eliminate wrong answers

Option A is wrong because increasing the buffer pool size only caches more data in memory, which may reduce physical I/O but does not eliminate the logical I/O caused by key lookups; the query still performs the same number of page accesses. Option B is wrong because rebuilding the index with FILLFACTOR=80 reduces page splits and fragmentation but does not change the index structure to include additional columns, so key lookups still occur. Option D is wrong because using a FORCESEEK query hint forces the optimizer to use an index seek, but it does not prevent key lookups if the index does not cover all required columns; it may even degrade performance by forcing a suboptimal plan.

278
MCQhard

A financial services company uses Cloud Spanner for a globally distributed application. They need to add a new column to an existing table that contains billions of rows. The change must not cause any downtime or performance degradation. How should the engineer implement this schema change?

A.Use ALTER TABLE ADD COLUMN; Spanner applies the change online without downtime.
B.Export the table, modify the schema in a temporary table, and import it back.
C.Use CREATE INDEX to add the column as an index.
D.Create a new table with the additional column, backfill data from the old table, then rename the tables.
AnswerA

Correct. Spanner's DDL is online and non-blocking.

Why this answer

Cloud Spanner supports online schema changes via the `ALTER TABLE ADD COLUMN` statement, which applies the change asynchronously without locking the table or causing downtime. Spanner uses a multi-phase approach to add columns, allowing reads and writes to continue uninterrupted while the schema change propagates across all nodes and regions.

Exam trap

The common misconception is that schema changes on large distributed databases require manual backfill or table recreation, but Cloud Spanner's online DDL handles this transparently without downtime.

How to eliminate wrong answers

Option B is wrong because exporting and re-importing a table with billions of rows would cause significant downtime and performance degradation, defeating the requirement for zero downtime. Option C is wrong because `CREATE INDEX` does not add a column; it creates an index on existing columns, and adding a column requires `ALTER TABLE`. Option D is wrong because creating a new table, backfilling data, and renaming tables would require complex coordination and likely cause downtime or data inconsistency, whereas Spanner's native `ALTER TABLE` handles the change online without such manual steps.

279
MCQhard

An organization wants to use a GitOps workflow for infrastructure deployment with Terraform. They use GitHub as the source of truth and want to automatically apply Terraform changes when a pull request is merged to the main branch. They need to review Terraform plans before apply. Which solution meets these requirements?

A.Use Cloud Source Repositories and Cloud Functions to trigger Terraform on merge.
B.Use Terraform workspaces with remote state and manual apply after merging.
C.Configure Cloud Build triggers to run `terraform apply` on every push to main.
D.Use Terraform Cloud with VCS integration: plan on pull request, apply on merge to main.
AnswerD

Terraform Cloud's VCS workflow supports plan on PR and auto-apply on merge.

Why this answer

Terraform Cloud / Enterprise supports VCS-driven workflows with speculative plans on PRs and automatic applies on merges. Atlantis is a self-hosted option that also does plan on PR and apply on merge. Cloud Build would require custom scripting.

Cloud Source Repositories is a Git host but lacks native plan/apply workflow.

280
MCQeasy

A developer has deployed a new version of an application that uses Cloud SQL. After the deployment, you notice a sharp increase in the number of slow queries. What should you do first to identify the problematic queries?

A.Check the slow query log in Cloud Logging and look for queries with high rows_examined.
B.Use Cloud SQL Query Insights to identify the queries with the highest latency and examine their execution plans.
C.Increase the instance tier to reduce the impact of slow queries.
D.Enable the general query log and parse the log file to find slow queries.
AnswerB

Query Insights provides detailed query performance data without additional overhead.

Why this answer

Cloud SQL Query Insights is the recommended first step for diagnosing slow queries because it provides built-in query monitoring, latency breakdowns, and execution plans without additional configuration. It directly surfaces the queries with the highest latency, allowing you to examine their execution plans to identify root causes such as missing indexes or inefficient joins.

Exam trap

Google Cloud often tests the distinction between reactive scaling (Option C) and proactive diagnostics (Option B), trapping candidates who think adding resources is the first troubleshooting step instead of identifying the root cause.

How to eliminate wrong answers

Option A is wrong because the slow query log in Cloud Logging requires manual filtering and may not be enabled by default, whereas Query Insights provides immediate, structured visibility into high-latency queries. Option C is wrong because increasing the instance tier only masks the symptom by adding more resources, without identifying or fixing the underlying problematic queries. Option D is wrong because enabling the general query log generates excessive volume and performance overhead, and parsing it manually is inefficient compared to using Query Insights' built-in analysis.

281
MCQeasy

An engineer wants to use Skaffold for local development and for CI/CD on Google Cloud. Which feature allows Skaffold to run on Cloud Build and deploy to GKE?

A.Skaffold dev loop
B.Skaffold init command
C.Skaffold delete command
D.Skaffold run command
AnswerD

skaffold run executes a single build-and-deploy cycle, ideal for CI/CD pipelines.

Why this answer

The `skaffold run` command is the correct answer because it performs a one-shot build and deploy, which is the exact behavior needed for CI/CD pipelines. When integrated with Cloud Build, `skaffold run` executes the entire workflow (build, test, deploy) in a non-interactive, headless mode, making it suitable for automated deployments to GKE without requiring a continuous dev loop.

Exam trap

In the Google Cloud PCDE exam, a common trap is confusing `skaffold dev` (interactive, continuous loop) with `skaffold run` (one-shot, CI/CD-ready). Candidates may incorrectly choose `skaffold dev` because it sounds like development, but it is not suitable for automated pipelines like Cloud Build.

How to eliminate wrong answers

Option A is wrong because the `skaffold dev` loop is designed for continuous local development with file watching and automatic redeployment, not for a single CI/CD pipeline execution on Cloud Build. Option B is wrong because `skaffold init` is used to generate an initial `skaffold.yaml` configuration file, not to run a deployment. Option C is wrong because `skaffold delete` is used to clean up deployed resources (e.g., deleting Kubernetes manifests), not to build and deploy.

282
Multi-Selectmedium

A company wants to migrate from an on-premises MySQL database to Cloud SQL. They need to minimize downtime and ensure data consistency. Which two steps should they include in the migration plan? (Choose TWO.)

Select 2 answers
A.Create a read replica in the same region for validation before cutover
B.Use Cloud SQL's import functionality to load a mysqldump file
C.Set up continuous replication from the on-premises database to the Cloud SQL instance using Database Migration Service
D.Take a consistent snapshot of the on-premises database at the time of cutover
E.Disable binary logging on the on-premises database to reduce overhead
AnswersC, D

DMS supports continuous replication to minimize downtime.

Why this answer

Database Migration Service (DMS) supports continuous replication using MySQL binary logs, enabling a near-zero-downtime migration by keeping the Cloud SQL instance synchronized with the on-premises database until cutover. Option D is correct because taking a consistent snapshot (e.g., using mysqldump with --single-transaction or a storage-level snapshot) at cutover ensures data consistency and provides a fallback point if the migration fails.

Exam trap

Google Cloud exams often test the misconception that a simple import/export (like mysqldump) is sufficient for minimal downtime, but the key is that continuous replication (via DMS) is required to keep the target synchronized during the migration window.

283
MCQhard

A DevOps engineer is configuring a Cloud Build pipeline that needs to deploy to a Cloud Run service in a VPC Service Controls perimeter. The build must access resources within the VPC. What should they use?

A.Configure Cloud Build to use a private pool in the same VPC
B.Use Cloud Build with a Shared VPC
C.Use Cloud Build public pool with a service account
D.Add a NAT gateway to the project
AnswerA

Private pools run inside your VPC and can access VPC-protected resources.

Why this answer

Cloud Build private pools run in your VPC, allowing access to internal resources. This is required when the build needs to interact with resources protected by VPC Service Controls.

284
MCQhard

A company runs a BigQuery data warehouse with many scheduled queries and materialized views. They notice that materialized view refreshes are taking longer than expected, causing delays in downstream reports. What is the most effective optimization?

A.Manually refresh materialized views outside peak hours
B.Increase the refresh interval to reduce frequency
C.Disable automatic refresh and use scheduled queries to rebuild the materialized view
D.Partition and cluster the base table on columns used in the materialized view
AnswerD

Partitioning and clustering reduce the amount of data scanned during refresh, improving speed.

Why this answer

Partitioning and clustering the base table on columns used in the materialized view (D) is the most effective optimization because it allows BigQuery to perform incremental refreshes using only the changed partitions, significantly reducing scan and recomputation overhead. Without proper partitioning, the materialized view refresh must scan the entire base table, which becomes increasingly costly as data grows. Clustering further improves efficiency by co-locating related data, minimizing the data processed during aggregation or join operations in the refresh.

Exam trap

The trap here is that candidates often assume scheduling or manual timing adjustments (A, B, C) will solve performance issues, when in fact the core optimization lies in the physical design of the base table to enable incremental processing, which is a fundamental BigQuery materialized view requirement.

How to eliminate wrong answers

Option A is wrong because manually refreshing materialized views outside peak hours does not address the root cause of slow refreshes; it merely shifts the timing, and the underlying full-table scan cost remains unchanged. Option B is wrong because increasing the refresh interval reduces the frequency of refreshes but does not optimize the refresh operation itself; the refresh will still be slow when it runs, and downstream reports may become even more stale. Option C is wrong because disabling automatic refresh and using scheduled queries to rebuild the materialized view replaces an optimized incremental refresh with a full rebuild, which is typically slower and more expensive, and it loses BigQuery's automatic incremental refresh capabilities.

285
Matchingmedium

Match each database migration term to its description.

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

Concepts
Matches

Fully managed service for migrating to Cloud SQL

Same database engine source and target

Different database engine source and target

Ongoing replication with minimal downtime

Full dump and restore with planned downtime

Why these pairings

The correct matches are: Homogeneous migration = same engine, Heterogeneous migration = different engine, Database Migration Service = Google Cloud's database migration tool. Common confusions involve swapping the definitions of homogeneous and heterogeneous, or misattributing DMS to application migration.

286
MCQmedium

A company is migrating their on-premises MySQL database to Cloud SQL using Database Migration Service (DMS). The source database is MySQL 5.7, and the target is a Cloud SQL MySQL 8.0 instance. The migration job is set to continuous, but after the full dump phase, the CDC phase keeps failing with the error 'binary log not found'. What is the most likely cause?

A.Cloud SQL Auth Proxy is not configured on the source.
B.The Cloud SQL instance does not have binary logging enabled.
C.The DMS migration job uses the wrong source connection profile.
D.The source MySQL binary logs have been purged before DMS could replicate them.
AnswerD

If source binary logs are purged (e.g., due to low retention), DMS cannot find them and CDC fails.

Why this answer

DMS continuous migration requires binary logging enabled on the source with row-based format, and the binary log files must be retained until they are consumed. If the source binary logs are purged before DMS reads them, CDC fails.

287
MCQhard

A team uses GitOps with Config Sync to manage multiple GKE clusters. They want to ensure that if a configuration change is applied to the git repository, it is automatically synced to all clusters within minutes. What must be configured?

A.Use Anthos Service Mesh to distribute configurations
B.Set the `syncWait` parameter in the Config Sync operator to 1 second
C.Configure Config Sync with a webhook from Cloud Source Repositories or GitHub to trigger re-sync
D.Set up a Cloud Build trigger that runs `gcloud container clusters update` on each cluster
AnswerC

Webhook triggers immediate sync, achieving near-real-time.

Why this answer

Config Sync relies on a polling mechanism by default, which can introduce delays. Configuring a webhook from Cloud Source Repositories or GitHub triggers an immediate re-sync when changes are pushed to the repository, ensuring that configurations are applied to all GKE clusters within minutes without waiting for the next polling interval.

Exam trap

A common misconception is that Config Sync automatically syncs changes instantly via polling, leading candidates to overlook the need for a webhook to achieve near-real-time synchronization.

How to eliminate wrong answers

Option A is wrong because Anthos Service Mesh is a service mesh platform for traffic management and observability, not a configuration distribution mechanism; it does not replace or enhance Config Sync's sync trigger. Option B is wrong because `syncWait` is not a valid parameter in Config Sync; the correct parameter for controlling sync frequency is `SYNC_REPO_SECS` or the `--sync-period` flag, and setting it to 1 second would be impractical and unsupported. Option D is wrong because `gcloud container clusters update` is used to modify cluster-level settings (e.g., add-ons, maintenance windows), not to apply Kubernetes resource configurations from a Git repository; it does not integrate with Config Sync's reconciliation loop.

288
MCQhard

An SRE team uses Cloud Monitoring SLOs with an error budget policy. They want to receive an alert when the error budget is consumed at a fast burn rate, using a 1-hour lookback window. The SLO is 99.9% over 30 days. The error budget is 43.2 minutes. What burn rate threshold should be used?

A.5
B.14
C.720
D.1
AnswerB

Standard fast burn alert uses a 14x burn rate over a 1-hour window.

Why this answer

In Google SRE practice, a fast burn alert typically uses a 1-hour lookback window and a burn rate threshold of 14 for a 99.9% SLO over 30 days. The burn rate threshold indicates how many times faster the error budget is being consumed compared to the allowed rate. With a burn rate of 14, the error budget would be exhausted in approximately 30 days / 14 ≈ 2.14 days.

The 1-hour reference in the question pertains to the alert's lookback window, not the total time to exhaust the budget. A burn rate of 720 would exhaust the budget in exactly 1 hour, but that is not a standard alerting threshold and would be too sensitive. Therefore, 14 is the correct threshold for a fast burn alert in this context.

289
Multi-Selecthard

You are migrating a relational database to Cloud Bigtable. The source schema has a Users table and an Orders table with a one-to-many relationship. The application frequently queries all orders for a user. Which three Bigtable schema design practices should you apply?

Select 3 answers
A.Denormalize by storing orders as multiple columns or a serialized column in the Users row
B.Maintain 3NF to avoid data duplication
C.Use a row key that includes a hash prefix to distribute writes
D.Keep the foreign key relationship by storing UserId in the Orders row key
E.Create a separate column family for user attributes and orders
AnswersA, C, E

Denormalization avoids joins; storing orders within the user row allows single-row reads for all orders.

Why this answer

Cloud Bigtable is a wide-column NoSQL database that does not support joins. To efficiently query all orders for a user, you must denormalize the one-to-many relationship by storing orders as multiple columns (e.g., order_1, order_2) or as a serialized JSON/protobuf column within the user's row. This avoids the need for a separate lookup or join, enabling single-row reads for the user's orders.

Exam trap

Google often tests the misconception that relational normalization principles apply to NoSQL databases, but in Bigtable, denormalization and row-key design are critical for performance, and maintaining foreign keys or 3NF leads to inefficient scans and poor latency.

290
MCQmedium

A team wants to automate the response to a common incident: restarting a service when it becomes unhealthy. Which GCP service is best suited to trigger a Cloud Function based on a Cloud Monitoring alert?

A.Cloud Endpoints
B.Cloud Scheduler
C.Cloud Tasks
D.Cloud Monitoring alert with notification channel to Pub/Sub
AnswerD

Alert policies can send notifications to Pub/Sub, which can trigger a Cloud Function.

Why this answer

Cloud Monitoring alert notification channels can trigger a Cloud Function via Pub/Sub or webhook. This is the standard pattern for automated incident response.

291
MCQhard

Your organization mandates that all application logs must be structured JSON and include a trace ID for correlation with Cloud Trace. Developers are using various logging libraries. Which approach ensures consistent structured logging across all services with minimal code changes?

A.Use a centralized logging agent (e.g., Fluentd) to parse unstructured logs and add trace IDs.
B.Require developers to manually format JSON logs and include trace IDs from environment variables.
C.Adopt OpenTelemetry SDK and use its logging API to produce structured logs with trace context.
D.Use Cloud Logging's automatic trace ID extraction from log entries.
AnswerC

OpenTelemetry provides a standard way to include trace IDs in logs without manual effort.

Why this answer

The OpenTelemetry SDK provides a unified way to instrument logging, metrics, and traces. By using the OTel logging SDK, developers can emit structured logs that include trace context automatically. This ensures consistency across polyglot environments without requiring custom code.

292
MCQeasy

A Cloud Spanner database is experiencing high latency for point reads. The table has a primary key of (CustomerID, OrderDate). Most reads are by CustomerID only. What should the engineer do?

A.Add a secondary index on CustomerID.
B.Use interleaved tables.
C.Reorder primary key to (OrderDate, CustomerID).
D.Increase the number of nodes.
AnswerA

A secondary index allows direct lookup by CustomerID, significantly reducing read latency.

Why this answer

Point reads by CustomerID only are inefficient on the primary key (CustomerID, OrderDate) because Cloud Spanner requires the full primary key for direct lookup. Adding a secondary index on CustomerID allows Spanner to perform an index scan followed by a point read, drastically reducing latency for these queries.

Exam trap

The trap here is that candidates assume reordering the primary key (Option C) is a valid optimization, but Cloud Spanner's design requires the full primary key for efficient point reads, and changing the key order does not eliminate the need for a secondary index when filtering on a prefix alone.

How to eliminate wrong answers

Option B is wrong because interleaved tables optimize joins and hierarchical data access, not point reads by a non-primary-key column. Option C is wrong because reordering the primary key to (OrderDate, CustomerID) would break existing data distribution and still not optimize reads by CustomerID alone, as OrderDate would still be required for efficient lookups. Option D is wrong because increasing nodes improves throughput and capacity, not the fundamental latency of point reads caused by missing index support.

293
Multi-Selectmedium

A company is migrating their on-premises MySQL database to Cloud SQL. The database is 500 GB and they have a 1 Gbps network connection. They want to minimize downtime. Which THREE steps should they take?

Select 3 answers
A.Perform a test migration to validate the process.
B.Export the database to a SQL file and import after the cutover.
C.Test the application against the new Cloud SQL instance.
D.Use Database Migration Service with continuous replication.
E.Schedule a maintenance window for the cutover.
AnswersA, C, D

Testing reduces risk.

Why this answer

Performing a test migration validates the entire process, including schema compatibility, data integrity, and application connectivity, before the actual cutover. This reduces the risk of unexpected failures during the production migration, which is critical for minimizing downtime. A test migration also helps estimate the time required for the final cutover and allows for tuning of the Database Migration Service settings.

Exam trap

Google Cloud often tests the misconception that a simple export/import or a maintenance window is sufficient for minimizing downtime, when in fact continuous replication and pre-validation steps are essential for achieving near-zero downtime migrations.

294
MCQeasy

A Cloud Memorystore for Redis instance needs to ensure data is not lost during a maintenance event. The team decides to enable persistence. However, Memorystore does not support Redis persistence. What is the recommended alternative?

A.Use the Standard tier with replication and take regular snapshots to Cloud Storage using a scheduled script.
B.Migrate to Cloud SQL for MySQL and use its backup feature.
C.Enable AOF persistence in Memorystore.
D.Increase the maxmemory setting and rely on the allkeys-lru eviction policy.
AnswerA

Standard tier provides replication; snapshots to Cloud Storage provide persistency.

Why this answer

Cloud Memorystore for Redis does not support native Redis persistence (RDB or AOF). To prevent data loss during maintenance events, the recommended alternative is to use the Standard tier (which provides replication and automatic failover) and supplement it with scheduled snapshots exported to Cloud Storage. This approach ensures a durable backup outside the Redis instance that can be restored if needed.

Exam trap

The Google Cloud Professional Data Engineer exam often tests the misconception that Cloud Memorystore supports all native Redis features, including persistence commands like BGSAVE or CONFIG SET appendonly yes, when in fact these are explicitly disabled in the managed service.

How to eliminate wrong answers

Option B is wrong because Cloud SQL for MySQL is a relational database, not an in-memory cache, and migrating to it would fundamentally change the architecture and performance characteristics of the application. Option C is wrong because Cloud Memorystore for Redis does not support AOF persistence; enabling it is not possible in the managed service. Option D is wrong because increasing maxmemory and relying on the allkeys-lru eviction policy only manages memory usage under pressure, it does not provide any durability or persistence to prevent data loss during maintenance events.

295
MCQhard

A gaming company ingests player clickstream data in real time via Cloud Pub/Sub. They need to aggregate events per player session in BigQuery with exactly-once semantics. Which architecture minimizes latency and cost?

A.Use Cloud Functions to write each message directly to BigQuery
B.Use Cloud Dataflow with exactly-once processing to BigQuery
C.Use Cloud Pub/Sub subscription to write to BigQuery directly
D.Use Cloud Dataproc to run Spark streaming jobs
AnswerB

Dataflow provides exactly-once semantics, low latency, and is cost-effective for this volume.

Why this answer

Cloud Dataflow with exactly-once processing is the correct choice because it provides a unified stream and batch processing model that guarantees exactly-once semantics when writing to BigQuery via the BigQuery I/O connector. This minimizes latency by processing events in micro-batches or streaming mode while avoiding duplicate data, and it is cost-effective as Dataflow auto-scales based on the Pub/Sub throughput.

Exam trap

Google Cloud often tests the misconception that Cloud Pub/Sub can directly write to BigQuery, but in reality Pub/Sub requires a subscriber (like Dataflow) to process the messages before they can be loaded into BigQuery.

How to eliminate wrong answers

Option A is wrong because Cloud Functions writing directly to BigQuery cannot guarantee exactly-once semantics; a function may be retried on failure, leading to duplicate rows, and it lacks built-in deduplication or checkpointing for streaming data. Option C is wrong because Cloud Pub/Sub subscriptions do not support writing directly to BigQuery; Pub/Sub is a messaging service and requires a subscriber (like Dataflow) to process and write data, so this option is not technically feasible. Option D is wrong because Cloud Dataproc running Spark streaming jobs introduces higher operational overhead and latency compared to Dataflow, and while Spark can achieve exactly-once semantics, it requires more manual configuration and does not integrate as seamlessly with BigQuery's streaming buffer as Dataflow does.

296
Multi-Selecthard

A DevOps team is adopting trunk-based development for their Terraform configurations. They want to ensure that all changes are tested before being applied to production. Which THREE practices should they implement?

Select 3 answers
A.Create long-lived feature branches to develop infrastructure changes.
B.Require manual approval before applying changes from main to production.
C.After merge to main, run `terraform apply` automatically in the CI pipeline.
D.Use a single environment (production) only to reduce complexity.
E.Run `terraform plan` in a CI pipeline on feature branches before merge.
AnswersB, C, E

Even in trunk-based development, approval gates for production are recommended.

Why this answer

Trunk-based development involves short-lived branches merged frequently to main. Running `terraform plan` in a CI pipeline on feature branches provides early feedback. Running `terraform apply` from the main branch only after review ensures production changes are controlled.

Running `terraform validate` ensures syntax correctness.

297
Multi-Selecthard

A gaming company is designing a leaderboard using Cloud Spanner. The leaderboard updates scores in real time and supports queries for top players. Which THREE strategies should they implement to achieve high performance and avoid hotspots? (Choose 3)

Select 3 answers
A.Use global secondary indexes with STORING clause to avoid back-to-base lookups
B.Use a monotonically increasing primary key for scores
C.Use a single table with all data and rely on Spanner auto-scaling
D.Maintain a separate table for top scores and update it asynchronously
E.Add a hash prefix to the primary key to distribute writes
AnswersA, D, E

Improves read performance for leaderboard queries.

Why this answer

Salting distributes writes, storing top scores in a separate table reduces contention, and using a STORING clause in indexes prevents data lookup. Global secondary indexes without STORING cause extra round trips.

298
MCQmedium

A financial services company uses Cloud Spanner for transaction processing. They notice increased latency during peak hours. They suspect a hot spot. What is the best way to diagnose the issue?

A.Review Key Visualizer to identify hot keys
B.Add more nodes to the instance
C.Switch to Cloud SQL
D.Check Cloud Spanner's CPU utilization metrics
AnswerA

Key Visualizer shows read and write heatmaps per key range, allowing identification of hot spots.

Why this answer

Key Visualizer is a Cloud Spanner tool that provides a heatmap of access patterns across keys and time ranges, directly revealing hot spots (e.g., monotonically increasing keys or skewed read/write distributions). This allows you to identify the specific keys causing contention without guesswork, making it the most targeted diagnostic approach for hot spot issues.

Exam trap

The trap here is that candidates confuse high-level metrics (CPU utilization) with diagnostic tools, assuming that resource pressure alone identifies the root cause, when in fact only a key-level analysis like Key Visualizer reveals the specific hot key pattern.

How to eliminate wrong answers

Option B is wrong because adding nodes increases throughput and storage capacity but does not diagnose the root cause of a hot spot; it may mask the symptom without fixing the key design issue. Option C is wrong because switching to Cloud SQL is a migration that abandons Spanner's horizontal scaling and global consistency, and does not help diagnose the existing hot spot in Spanner. Option D is wrong because CPU utilization metrics indicate overall resource pressure but cannot pinpoint which specific keys or access patterns are causing contention, so they are insufficient for diagnosing hot spots.

299
MCQeasy

A company wants to ensure point-in-time recovery for their PostgreSQL database on Cloud SQL. What must they enable?

A.Query insights
B.Automatic backups
C.Write-ahead logging (WAL) archiving
D.Binary logging
AnswerB

Automatic backups enable PITR for Cloud SQL PostgreSQL instances.

Why this answer

Automatic backups in Cloud SQL enable point-in-time recovery (PITR) by maintaining transaction logs that allow you to restore the database to any specific time within the backup retention period. Without automatic backups enabled, Cloud SQL only supports restoring from a full backup snapshot, which does not provide the granularity needed for PITR.

Exam trap

Google Cloud often tests the misconception that enabling WAL archiving directly in PostgreSQL is required for PITR, but in Cloud SQL, this is abstracted away and controlled by the automatic backups setting.

How to eliminate wrong answers

Option A is wrong because Query insights is a performance monitoring and troubleshooting feature that provides query-level metrics and execution plans, not a mechanism for backup or recovery. Option C is wrong because write-ahead logging (WAL) archiving is a PostgreSQL internal mechanism for replication and crash recovery, but in Cloud SQL, PITR is enabled via automatic backups, not by directly configuring WAL archiving. Option D is wrong because binary logging is a MySQL/MariaDB feature used for replication and PITR in those databases, not applicable to PostgreSQL, which uses WAL instead.

300
MCQhard

A company uses Cloud Spanner with a multi-region configuration (nam7) to support a global user base. They notice increased read latency for users in Europe, while write latency is acceptable. The database engineer observes that most queries are single-row reads using the primary key. What is the best approach to reduce read latency for European users?

A.Create a secondary index on the primary key column.
B.Increase the number of Spanner nodes to distribute the load.
C.Use read-only transactions with stale reads (timestamp bound) to read from local replicas.
D.Partition the database by region and use directed reads.
AnswerC

Stale reads allow Spanner to serve reads from the nearest replica, reducing latency for far-away users.

Why this answer

Cloud Spanner's multi-region configuration (nam7) includes regional replicas in Europe. By using stale reads with a timestamp bound, read-only transactions can be served from a local replica without incurring cross-region latency, which directly reduces read latency for European users while maintaining acceptable consistency.

Exam trap

Google Cloud often tests the misconception that increasing nodes or adding indexes solves geographic latency, when the real solution is leveraging replica locality via stale reads or read-only transactions.

How to eliminate wrong answers

Option A is wrong because creating a secondary index on the primary key column is redundant—the primary key is already indexed by the table's primary index, and this does not address the cross-region latency issue. Option B is wrong because increasing the number of Spanner nodes distributes load and improves throughput, but does not reduce the physical distance or network round-trip time between European users and the regional leader, so read latency remains high. Option D is wrong because Cloud Spanner does not support partitioning a database by region with directed reads; directed reads can be used to route reads to specific zones, but the database is a single global resource, and partitioning would break global consistency and transaction semantics.

Page 3

Page 4 of 20

Page 5