Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 14261446

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

Page 19

Page 20 of 20

1426
Multi-Selectmedium

A company is using Cloud SQL for PostgreSQL and wants to improve read scalability for a reporting dashboard that executes complex aggregate queries. The reports can tolerate up to 5 minutes of data staleness. Which two actions should the team take?

Select 2 answers
A.Enable PostgreSQL query cache to speed up aggregate queries
B.Create read replicas in Cloud SQL and configure the reporting application to connect to the replicas
C.Increase the number of vCPUs on the primary instance to handle more queries
D.Configure a connection pool to reduce connection overhead
E.Use Database Migration Service to continuously replicate data to BigQuery for reporting
AnswersB, E

Read replicas offload read traffic and can serve stale data with minimal lag.

Why this answer

Creating read replicas in Cloud SQL offloads read traffic from the primary instance, allowing complex aggregate queries to run on replicas without impacting write performance. Since the reports can tolerate up to 5 minutes of staleness, the asynchronous replication lag inherent in Cloud SQL read replicas is acceptable, making this a cost-effective and scalable solution.

Exam trap

Google Cloud often tests the distinction between scaling reads via replicas versus scaling writes or optimizing connections, and candidates mistakenly choose connection pooling or vertical scaling as a solution for read-heavy workloads.

1427
MCQeasy

An organization wants to enforce that all Compute Engine VMs are created with Shielded VM features enabled to protect against rootkits and boot-level malware. Which Google Cloud mechanism should be used?

A.Organization policies
B.Resource labels
C.Service accounts
D.IAM roles
AnswerA

Organization policies can enforce constraints like requiring Shielded VMs across the organization.

Why this answer

Organization policies allow you to define constraints that apply to all resources under an organization. The `compute.requireShieldedVm` constraint enforces that VMs must have Shielded VM enabled. IAM roles and service accounts control access but not resource properties.

Labels are for metadata, not enforcement.

1428
MCQmedium

An SRE team is creating a postmortem after a service outage. They want to ensure the process is blameless and focuses on systemic improvements. Which practice is central to a blameless postmortem?

A.Determining the financial cost of the outage
B.Escalating the issue to senior management
C.Assigning action items with owners and due dates to prevent recurrence
D.Identifying the individual who caused the incident for performance review
AnswerC

Action items drive improvements; blameless culture ensures people feel safe contributing to solutions.

Why this answer

A blameless postmortem focuses on identifying contributing factors and systemic issues rather than assigning blame to individuals. The 5 Whys technique helps drill down to root causes.

1429
MCQhard

A team is migrating to GCP and wants to use Cloud Deployment Manager for infrastructure. They have existing Terraform modules. What is the best approach?

A.Use Deployment Manager only for new resources and Terraform for existing.
B.Convert Terraform modules to Deployment Manager templates manually.
C.Run Terraform as a subprocess within Deployment Manager.
D.Use Terraform with a GCS backend; avoid Deployment Manager.
AnswerD

Terraform is the preferred tool; no need to switch.

Why this answer

The team already has existing Terraform modules, and using Terraform with a GCS backend allows them to continue leveraging their investment in Terraform without rewriting or bridging tools. Cloud Deployment Manager is a native Google Cloud IaC tool, but it does not natively import or execute Terraform configurations; forcing a migration or hybrid approach introduces unnecessary complexity and risk. The best practice is to standardize on one IaC tool, and since Terraform is already in use, using it with a GCS backend for state management is the most efficient and reliable path.

Exam trap

The trap here is that candidates assume Cloud Deployment Manager is the 'native' GCP tool and must be used, but the question tests whether you recognize that existing Terraform modules should be preserved and that forcing a migration or hybrid approach is anti-pattern.

How to eliminate wrong answers

Option A is wrong because maintaining two separate IaC tools (Deployment Manager for new resources and Terraform for existing) creates fragmentation, increases the risk of configuration drift, and adds operational overhead with no clear benefit. Option B is wrong because manually converting Terraform modules to Deployment Manager templates is time-consuming, error-prone, and negates the value of existing tested modules; it also introduces a manual translation step that can introduce bugs. Option C is wrong because running Terraform as a subprocess within Deployment Manager is not a supported integration pattern, adds unnecessary complexity, and defeats the purpose of using a single declarative tool; Deployment Manager cannot natively execute Terraform or manage its state.

1430
MCQeasy

Your Cloud SQL for MySQL instance is running low on storage. You need to increase the storage size without downtime. What should you do?

A.You cannot increase storage online; you must create a new instance.
B.Create a clone of the instance with larger storage and switch traffic.
C.Enable automatic storage increase and it will happen automatically.
D.Edit the instance and increase the storage size; it will be applied online.
AnswerD

Cloud SQL allows online storage increase without downtime.

Why this answer

Cloud SQL for MySQL supports online storage increases. When you edit the instance and increase the storage allocation, the operation is applied without requiring a restart or causing downtime. The underlying infrastructure uses live migration and dynamic volume expansion to make the additional capacity available immediately while the instance continues serving traffic.

Exam trap

The trap here is that candidates may assume any storage change requires downtime (Option A) or that cloning is the only safe method (Option B), but Cloud SQL explicitly supports online storage increases for MySQL instances.

How to eliminate wrong answers

Option A is wrong because Cloud SQL for MySQL does allow online storage increases; you do not need to create a new instance. Option B is wrong because creating a clone and switching traffic introduces unnecessary complexity and potential downtime during the cutover, and it is not the recommended method for a simple storage increase. Option C is wrong because automatic storage increase is a feature that triggers when storage usage reaches a threshold, but it does not allow you to manually specify a larger size; it only adds storage automatically based on usage, and you may need to increase storage on demand without waiting for automatic triggers.

1431
MCQhard

A data engineer creates a clustered table in BigQuery with clustering order: country, city, product_id. The BI team frequently runs a query that filters on city and product_id but rarely on country. What is the most likely performance issue?

A.BigQuery allows only one clustering column per table.
B.The query does not filter on the first clustering column (country), so block pruning is minimal.
C.The table should be partitioned by country instead of clustered.
D.The query filters on too many clustering columns, causing overhead.
AnswerB

Clustering is optimized when filters include the leftmost clustering column.

Why this answer

BigQuery clustered tables use block pruning to skip reading blocks that don't match the query's filter. Pruning is most effective when the filter includes the first clustering column (country). Without it, BigQuery must scan more blocks, leading to higher query costs and slower performance.

Exam trap

Google Cloud often tests the misconception that any filter on clustering columns is equally effective, but the key is that pruning requires the first column in the clustering order to be filtered for maximum benefit.

How to eliminate wrong answers

Option A is wrong because BigQuery allows up to four clustering columns per table, not just one. Option C is wrong because partitioning by country would not help if the query rarely filters on country; partitioning is most beneficial for queries that filter on the partition column. Option D is wrong because filtering on multiple clustering columns does not cause overhead; it actually improves pruning, but the missing first column is the issue.

1432
MCQeasy

Which Google Cloud service can be used to automate repetitive operational tasks such as restarting a VM or clearing a cache, as part of toil reduction?

A.Compute Engine
B.Cloud Run
C.Cloud Build
D.Cloud Functions
AnswerD

Cloud Functions can automate tasks like VM restarts, cache clearing, etc.

Why this answer

Cloud Functions is a serverless execution environment that can be triggered by events or schedules to automate tasks. It is well-suited for automating simple operational tasks.

1433
MCQhard

A BI dashboard query is slow and high cost. The query does multiple joins on large tables and uses window functions. The data engineer suggests using materialized views. However, the query uses non-deterministic functions. What is the limitation?

A.Materialized views cannot include non-deterministic functions
B.Materialized views cannot be updated automatically
C.Materialized views cannot be created with joins
D.Materialized views only support simple aggregation
AnswerA

Materialized views require deterministic expressions to maintain consistency between base table changes.

Why this answer

Materialized views store the result set of a query physically, like a table. If the query includes non-deterministic functions (e.g., NOW(), RAND(), CURRENT_TIMESTAMP), the stored result would become stale immediately because the function's output changes each time it is evaluated. Most SQL databases (e.g., PostgreSQL, Oracle, Snowflake) explicitly forbid non-deterministic functions in materialized view definitions to prevent this logical inconsistency.

Exam trap

Google Cloud often tests the misconception that materialized views are 'static' and cannot be refreshed, or that they only support simple aggregations, when the real limitation is the prohibition of non-deterministic functions to ensure data consistency.

How to eliminate wrong answers

Option B is wrong because materialized views can be updated automatically via refresh mechanisms (e.g., ON COMMIT, scheduled refreshes), though they are not always updated in real-time. Option C is wrong because materialized views commonly support joins; in fact, they are often used to pre-join large tables for performance. Option D is wrong because materialized views can include complex aggregations, window functions, and multiple joins—not just simple aggregation.

1434
MCQmedium

A BI query uses COUNT(column) to count non-null values and COUNT(*) to count all rows. The analyst expects both counts to be equal, but COUNT(column) returns fewer rows. What is the most likely explanation?

A.The query has a WHERE clause that filters some rows.
B.COUNT(*) is faster, so it's not accurate.
C.COUNT(*) counts duplicate rows, while COUNT(column) does not.
D.The column contains NULL values, which are not counted by COUNT(column).
AnswerD

COUNT(column) only counts non-null values.

Why this answer

COUNT(column) ignores NULL values in the specified column, while COUNT(*) counts every row in the result set regardless of NULLs. If the column contains any NULLs, COUNT(column) will return a lower number. This is a fundamental SQL behavior defined in the ANSI SQL standard and is consistent across all major BI platforms (e.g., Tableau, Power BI, Looker) that generate SQL queries.

Exam trap

Google Cloud often tests the subtle distinction between COUNT(*) and COUNT(column) by embedding NULL values in the column, tempting candidates to incorrectly attribute the difference to duplicates or filtering.

How to eliminate wrong answers

Option A is wrong because a WHERE clause would filter rows before aggregation, affecting both COUNT(column) and COUNT(*) equally, so it cannot cause a discrepancy between the two counts. Option B is wrong because COUNT(*) is not inherently faster or less accurate; both functions return precise counts based on the same data set, and performance differences are irrelevant to accuracy. Option C is wrong because both COUNT(*) and COUNT(column) count duplicate rows; COUNT(column) counts non-null occurrences of the column, including duplicates, so duplicates do not cause a difference.

1435
MCQhard

A global financial services company requires a multi-region Spanner instance with an RPO of zero and an RTO of less than 5 seconds for a critical transactional workload. The application writes to a single region and reads from multiple regions. Which Spanner configuration should they choose?

A.A single-region configuration with read replicas in multiple zones
B.A two-region multi-region configuration (e.g., nam6)
C.A dual-region configuration with two read-write regions and one read-only region
D.A three-region multi-region configuration (e.g., nam-eur-asia1)
AnswerB

Two-region multi-region configs use synchronous replication across two regions, providing RPO=0 and RTO<5s. Nam6 (us-central1 and us-east1) fits this scenario.

Why this answer

For zero RPO and sub-5-second RTO, a multi-region configuration with synchronous replication is needed. Spanner multi-region configurations like nam6 use synchronous replication across a primary and secondary region (with both read-write replicas). The leader region handles writes, and read-only replicas are for reads.

A two-region multi-region config (e.g., nam6) provides synchronous replication (RPO=0) and automatic failover in <5 seconds. Three-region configs (nam-eur-asia1) have higher write latency due to longer distances.

1436
MCQmedium

An engineer configures Cloud Deploy to promote a container to production after manual approval. The deployment strategy must gradually shift traffic from the current version to the new version while monitoring error rates. Which deployment strategy should they select in the delivery pipeline?

A.Blue/green
B.Rollback
C.Canary
D.Standard
AnswerC

Canary deploys a small percentage first, then increases based on metrics and approval.

Why this answer

Canary deployment is the correct choice because it gradually shifts traffic from the current version to the new version while allowing monitoring of error rates. In Cloud Deploy, a canary strategy uses a sequence of phases (e.g., 10%, 50%, 100%) to incrementally route traffic, enabling real-time observability and automated rollback if error thresholds are breached.

Exam trap

Google Cloud exams often test the distinction between deployment strategies by making candidates confuse canary (gradual traffic shifting with monitoring) with blue/green (instantaneous full traffic switch), so the trap here is assuming blue/green supports gradual traffic shifting when it actually flips all traffic at once.

How to eliminate wrong answers

Option A is wrong because blue/green deployment switches all traffic at once between two environments (blue and green), not gradually, and does not inherently support phased traffic shifting with error rate monitoring. Option B is wrong because rollback is not a deployment strategy but a recovery action to revert to a previous version after a failure, not a method for gradual traffic shifting. Option D is wrong because standard deployment (also known as rolling update) replaces instances incrementally but does not provide fine-grained traffic control or canary-style phased routing with error rate monitoring.

1437
Multi-Selectmedium

A data pipeline writes 10 TB of streaming data daily into Bigtable. The row key is based on the device ID and timestamp in reverse order. Recent data is queried most frequently. Which three design choices optimize performance and cost? (Choose THREE.)

Select 3 answers
A.Use HDD storage to reduce cost per GB.
B.Use a single cluster with SSD storage.
C.Use reverse timestamp to make recent data first.
D.Pre-split the table to avoid write hotspotting during initial load.
E.Enable compression on column families to reduce storage footprint.
AnswersB, D, E

SSD provides low latency; single cluster reduces cost.

Why this answer

A single cluster with SSD storage provides low-latency access for frequently queried recent data, which is critical for streaming workloads. SSDs offer consistent single-digit millisecond latency, while HDDs would introduce higher latency unsuitable for real-time queries. This balances performance and cost for the described use case.

Exam trap

The Google Cloud Professional Data Engineer exam often tests the misconception that HDD is acceptable for cost savings in high-throughput streaming workloads, ignoring the latency requirements for frequent recent data queries, and that a design choice already implemented (like reverse timestamp) can be selected again as an optimization.

1438
MCQmedium

A company is adopting GitOps for managing their Kubernetes infrastructure with Config Sync. They want to ensure that any changes to the cluster's desired state are automatically applied from a Git repository. Which branching strategy is MOST suitable for this workflow?

A.One branch per cluster, with manual merge from development to production branches.
B.Trunk-based development where all changes are merged into the main branch frequently, and Config Sync watches the main branch.
C.Gitflow with separate develop and release branches, merging to main only for production releases.
D.Feature branching with long-lived branches per environment (dev, staging, prod).
AnswerB

Trunk-based development ensures that main branch is always the single source of truth, which is ideal for GitOps.

Why this answer

Trunk-based development with short-lived feature branches and direct commits to main (or a single release branch) is the simplest and most aligned with GitOps principles where main branch represents the desired state.

1439
Multi-Selectmedium

Which three of the following are valid considerations when designing secondary indexes in Cloud Spanner? (Choose three.)

Select 3 answers
A.Secondary indexes maintain strong consistency with the base table
B.Secondary indexes are automatically used for queries that filter on primary key columns
C.Secondary indexes require a unique constraint
D.Secondary indexes can be created on child tables without including the parent key
E.Secondary indexes can be created with a STORING clause to include non-key columns
AnswersA, D, E

All indexes in Spanner are strongly consistent.

Why this answer

Cloud Spanner secondary indexes are fully synchronous with the base table, meaning they are updated atomically in the same transaction as the table write. This ensures that reads using the secondary index always return strongly consistent data, without any eventual consistency window.

Exam trap

A common misconception is that secondary indexes in Cloud Spanner are automatically used for any query filter. In reality, the optimizer only uses a secondary index when the query filter columns match the index key. Filters on primary key columns will not automatically leverage secondary indexes; they use the primary index instead.

1440
MCQhard

During a postmortem for a service outage, the team identifies that the root cause was a configuration change that disabled TLS on a critical internal service. The change was made by an automated deployment pipeline. Which tool or practice should be implemented to prevent this in the future?

A.Use Cloud Audit Logs to detect configuration changes after the fact
B.Implement canary deployments with automated rollback based on SLI metrics
C.Add a manual approval gate before every deployment
D.Disable automated deployments and require all changes to be made manually
AnswerB

This would catch the degradation (e.g., TLS errors) and rollback automatically.

Why this answer

Preventing misconfigurations requires automated validation in the deployment pipeline. A canary analysis or progressive delivery with automated checks can catch such issues. Cloud Deploy supports canary deployments with verification using Cloud Monitoring.

Additionally, using Binary Authorization or Config Connector can enforce policies. But the best practice is to implement automated canary analysis that checks SLI metrics before full rollout.

1441
Multi-Selecthard

A company is designing a data model for a BI dashboard that requires real-time updates and historical analysis. Which THREE practices should be followed?

Select 3 answers
A.Use clustering on frequently filtered columns.
B.Use streaming inserts for real-time data.
C.Create a separate table for each day's data.
D.Use the default BigQuery table expiration setting.
E.Use partitioning by ingestion time for continuous data.
AnswersA, B, E

Clustering orders data within partitions, improving filter performance.

Why this answer

Clustering on frequently filtered columns in BigQuery organizes data into blocks based on the values of those columns, allowing queries with filters on those columns to skip irrelevant blocks entirely. This reduces the amount of data scanned, improving query performance and lowering costs, which is critical for a BI dashboard that needs real-time updates and fast historical analysis.

Exam trap

Google Cloud often tests the misconception that creating separate tables for daily data is a good practice for time-series data, when in fact BigQuery's partitioning and clustering features are designed to handle such data more efficiently and with less administrative overhead.

1442
Multi-Selecthard

Which THREE factors should you consider when configuring Cloud SQL for MySQL query caching to optimize performance?

Select 3 answers
A.High write workloads can lead to frequent cache invalidation, reducing its effectiveness.
B.The query cache can become fragmented and require periodic defragmentation.
C.Query cache uses disk storage for cached results.
D.The query cache is deprecated and removed in MySQL 8.0+, so it should not be relied upon for new deployments.
E.Prepared statements always bypass the query cache.
AnswersA, B, D

Every table modification invalidates cached queries for that table, making cache less useful for write-heavy workloads.

Why this answer

In Cloud SQL for MySQL, high write workloads cause frequent updates to tables, which invalidates the query cache entries for those tables. This means the cache must be repopulated often, reducing the hit rate and potentially adding overhead from cache maintenance, making it less effective for performance optimization.

Exam trap

Google Cloud often tests the misconception that the query cache uses disk storage, when in fact it uses memory, and that prepared statements always bypass the cache, which is not universally true across all MySQL configurations.

1443
Multi-Selecthard

A company uses Cloud Spanner in a multi-region configuration. They want to perform a non-destructive disaster recovery drill to validate their ability to recover from a regional failure. Which THREE steps should they include in the drill? (Choose three.)

Select 3 answers
A.Validate that the restored instance has the correct data and schema.
B.Restore a Spanner backup to a new instance in a different region.
C.Update the disaster recovery runbook with any issues found during the drill.
D.Stop the primary Spanner instance to simulate a region failure and observe automatic failover.
E.Promote a cross-region read replica to a new primary instance.
AnswersA, B, C

Data integrity validation is critical to ensure the backup is usable and the recovery process works.

Why this answer

A non-destructive DR drill for Spanner should test the ability to restore from a backup to a different region (simulating recovery), validate the restored data integrity, and update runbooks based on lessons learned. Failing over a read replica is not applicable to Spanner (it uses multi-region replication, not read replicas). Stopping the primary instance is destructive.

Changing leader region is a configuration change that may affect live traffic.

1444
Matchingmedium

Match each BigQuery feature to its purpose.

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

Concepts
Matches

Column-based ordering to improve query performance

Dividing tables into segments for cost and performance

Guaranteed query capacity

In-memory analysis for sub-second query response

Automated data ingestion from various sources

Why these pairings

These features optimize cost, performance, and management in BigQuery. Partitioning reduces scan costs, Clustering improves query performance, Materialized Views accelerate complex queries, and Slots provide resource control.

1445
MCQhard

Your Bigtable cluster is experiencing high CPU utilization and write latency during a daily batch job that writes 500 GB of data. The job uses bulk mutations with 1000 rows per request. What is the most effective way to reduce CPU usage?

A.Disable write-ahead logs
B.Increase the number of rows per mutation to 10,000
C.Increase the number of nodes temporarily
D.Create a new cluster in a different zone
AnswerB

Increasing the number of rows per mutation reduces the overhead per row, lowering CPU usage.

Why this answer

Larger mutations reduce overhead per row. Option A is wrong because disabling write-ahead logs does not significantly reduce CPU and risks data integrity. Option C is wrong because increasing nodes does not reduce CPU per request.

Option D is wrong because creating a new cluster in a different zone does not directly reduce CPU usage for writes.

1446
MCQmedium

A social media application uses Memorystore for Redis to cache user profiles and session data. Recently, the application experienced intermittent errors and high latency. You observe that the Redis CPU utilization is consistently above 90% and the cache hit ratio is 85%. The instance type is a Standard tier M2 (30 GB) with a maxmemory setting of 25 GB. The eviction policy is allkeys-lru. The number of keys is 10 million with an average value size of 2 KB. You suspect memory pressure is causing CPU spikes. What should you do to reduce CPU utilization and improve performance?

A.Reduce the maxmemory setting to force more aggressive eviction and free up memory.
B.Change the eviction policy to volatile-lru to prefer evicting keys with TTL.
C.Upgrade the Memorystore instance to a larger size (e.g., M5 with 60 GB) to provide more CPU and memory resources.
D.Implement Redis monitoring with Cloud Monitoring and set alerts to notify when CPU exceeds 80%.
AnswerC

A larger instance has more CPU cores and memory, reducing pressure.

Why this answer

Upgrading to a larger instance (e.g., M5 with 60 GB) directly addresses both the high CPU utilization and memory pressure. The M2 instance is CPU-bound with sustained >90% usage, and the 85% cache hit ratio indicates that evictions are already occurring under the allkeys-lru policy, causing CPU spikes from eviction overhead and key lookups. A larger instance provides more CPU cores and memory, reducing eviction frequency and allowing the cache to serve more requests without thrashing.

Exam trap

In the Google PCDE exam, a common trap is the misconception that tuning eviction policies or reducing memory limits can solve CPU pressure, when in fact the root cause is resource exhaustion that requires vertical scaling.

How to eliminate wrong answers

Option A is wrong because reducing maxmemory would force even more aggressive eviction, increasing CPU overhead from eviction processing and further degrading cache hit ratio, worsening the problem. Option B is wrong because changing to volatile-lru would only evict keys with TTLs, but the question does not indicate that keys have TTLs; if most keys lack TTLs, volatile-lru would evict nothing, leaving memory pressure unchanged and CPU spikes unresolved. Option D is wrong because monitoring and alerts only provide visibility into the problem; they do not reduce CPU utilization or improve performance, which requires a resource scaling action.

Page 19

Page 20 of 20