Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 376450

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

Page 5

Page 6 of 20

Page 7
376
Multi-Selectmedium

A team is migrating a MySQL database to Cloud SQL using DMS. They need to configure the source database for binary logging. Which TWO parameters must be set correctly?

Select 2 answers
A.expire_logs_days = 0
B.binlog_format = STATEMENT
C.server_id = 1
D.binlog_format = ROW
E.log_bin = ON
AnswersD, E

Row-based logging is required for DMS to capture all changes.

Why this answer

For MySQL binary logging to work with DMS, log_bin must be ON and binlog_format must be ROW (or MIXED). ROW-level logging ensures all changes are captured.

377
Multi-Selecthard

A company wants to set up error budget alerting in Cloud Monitoring for a service with a 99.9% SLO over 30 days. They want to receive alerts when the error budget burn rate reaches certain thresholds. Which TWO of the following are typical recommendations for alerting thresholds?

Select 2 answers
A.100x burn rate over 1 minute
B.14x burn rate over 1 hour
C.5x burn rate over 6 hours
D.2x burn rate over 1 day
E.1x burn rate over 30 days
AnswersB, C

Fast burn alert for rapid consumption.

Why this answer

Common SRE practice uses a fast burn alert (e.g., 14x burn rate over 1 hour) and a slow burn alert (e.g., 5x burn rate over 6 hours) to cover both rapid and gradual budget consumption.

378
MCQhard

A Cloud Spanner database is experiencing high CPU utilization (above 80%). The team wants to add an index to optimize a frequently used query. The schema change must not cause downtime. How should they proceed?

A.Export the database, create the index in a new instance, then import.
B.Use gcloud spanner databases ddl update with --async flag.
C.Stop the application, run the DDL statement, then restart.
D.Create the index using the Google Cloud Console; it will be applied online.
AnswerD

Spanner supports online schema changes, including index creation, without downtime.

Why this answer

Spanner supports online schema changes; CREATE INDEX is non-blocking and can be executed via DDL without downtime.

379
MCQmedium

A company uses Cloud Build to deploy to Cloud Run. They want to use a custom service account for the deployment step, not the default Cloud Build service account. How should they configure this?

A.Set the service account in the build trigger's service account field
B.Specify 'serviceAccount' in the step definition in cloudbuild.yaml
C.Use 'gcloud config set account' in the step's entrypoint
D.Use 'impersonate-service-account' flag in gcloud commands
AnswerB

The step-level serviceAccount field allows using a specific service account for that step.

Why this answer

In cloudbuild.yaml, you can specify a service account for each step using the 'serviceAccount' field. This overrides the default build service account for that step.

380
Multi-Selectmedium

A Cloud Spanner instance has a single node and is experiencing high write contention. The workload is 3000 writes per second with 2 KB mutations. Which two changes would improve write throughput? (Choose TWO.)

Select 2 answers
A.Redesign the primary key to distribute writes evenly across splits.
B.Increase the mutation size to 10 KB to reduce number of writes.
C.Scale the instance to 2 nodes.
D.Use a monotonically increasing primary key to improve index performance.
E.Split the table into multiple smaller tables.
AnswersA, C

Even distribution reduces contention.

Why this answer

High write contention in Cloud Spanner often stems from hotspotting, where all writes target the same split. By redesigning the primary key to distribute writes evenly across splits, you reduce contention and improve throughput. This is a fundamental design pattern for Spanner's distributed architecture.

Exam trap

Commonly, candidates think scaling nodes alone solves write contention, but the trap is that while adding nodes increases throughput capacity, it does not fix hotspotting from a poorly designed primary key—so both changes are needed for optimal write throughput.

381
MCQeasy

You are designing a Cloud Bigtable schema for a time-series application that stores temperature readings from sensors. Each reading has a sensor ID (string), a timestamp (microseconds), and a temperature value. Queries always filter by sensor ID and a time range. Which row key design is optimal?

A.[sensor_id]#[timestamp]
B.[salted_hash]#[sensor_id]#[reversed_timestamp]
C.[timestamp]#[sensor_id]
D.[sensor_id]#[reversed_timestamp]
AnswerB

Salting distributes writes, sensor ID groups data, reversed timestamp enables efficient time-range queries.

Why this answer

Optimal because it uses a salted hash to distribute writes across Bigtable tablets, avoiding hot-spotting on a single node for high-write sensors. The sensor_id ensures all data for a sensor is co-located for efficient range scans, and the reversed timestamp allows queries for the most recent data to be served from the start of the row range, leveraging Bigtable's lexicographic ordering.

Exam trap

A common misconception is that a simple sensor_id prefix is sufficient for time-series data, ignoring the need for write distribution via salting to avoid hot-spotting in high-throughput scenarios in Cloud Bigtable.

How to eliminate wrong answers

Option A is wrong because using [sensor_id]#[timestamp] without salting causes all writes for a given sensor to hit a single tablet, creating a hot spot and degrading write throughput. Option C is wrong because [timestamp]#[sensor_id] scatters data for the same sensor across many tablets, making range scans by sensor_id and time range extremely inefficient as they require multiple tablet lookups. Option D is wrong because [sensor_id]#[reversed_timestamp] lacks a salt, so it still suffers from write hot-spotting on the sensor_id prefix, and while it improves recent-data scans, it does not solve the fundamental write distribution problem.

382
MCQeasy

A company needs a fully managed, relational database with strong consistency and global distribution for a travel booking application that supports high concurrency and ACID transactions. Which Google Cloud database should they choose?

A.Cloud SQL
B.Cloud Spanner
C.Cloud Bigtable
D.Firestore
AnswerB

Spanner provides global strong consistency and ACID transactions.

Why this answer

Cloud Spanner is the correct choice because it is a fully managed, globally distributed relational database that provides strong consistency and ACID transactions across regions, making it ideal for high-concurrency travel booking applications that require global distribution and transactional integrity.

Exam trap

Candidates often mistakenly think that Cloud SQL can be globally distributed by using read replicas, but read replicas do not provide strong consistency or ACID transactions across regions, which is a critical requirement for this scenario.

How to eliminate wrong answers

Option A is wrong because Cloud SQL is a regional relational database that does not support global distribution or strong consistency across multiple regions; it is designed for single-region deployments. Option C is wrong because Cloud Bigtable is a NoSQL wide-column database that does not support relational queries or ACID transactions, and it offers only eventual consistency. Option D is wrong because Firestore is a NoSQL document database that provides strong consistency but is not relational and does not support ACID transactions across globally distributed data; it is optimized for mobile and web apps, not for complex relational workloads.

383
MCQmedium

A team is using Helm charts to deploy to GKE. They want to manage environment-specific values (dev, staging, prod) while keeping a single chart. Which approach is recommended?

A.Use --values flags with environment-specific value files
B.Store all environment values in a single values.yaml and use --set to override
C.Use Kustomize overlays to manage Helm values
D.Create separate Helm charts for each environment
AnswerA

This is the standard Helm pattern: default values.yaml plus environment overrides.

Why this answer

Helm supports multiple values files; you can use --values to specify environment-specific files, overriding default values. This keeps one chart and separate configs.

384
MCQmedium

An organization wants to implement policy-as-code to validate Terraform plans against security policies before applying them. They are using Terraform Cloud (TFE). Which tool is natively integrated with Terraform Cloud for policy checks?

A.Open Policy Agent (OPA)
B.Cloud Audit Logs
C.Conftest
D.Sentinel
AnswerD

Sentinel is the native policy engine for Terraform Cloud.

Why this answer

Sentinel is HashiCorp's policy-as-code framework, natively integrated with Terraform Cloud and Terraform Enterprise. OPA and Conftest can be used in CI/CD pipelines but are not natively integrated with Terraform Cloud.

385
Multi-Selecthard

A company is adopting Infrastructure as Code with Terraform and wants to enforce policy as code using Open Policy Agent (OPA). Which THREE components are required to implement this in a CI/CD pipeline? (Choose THREE.)

Select 3 answers
A.A GCS bucket to store policy files.
B.A Terraform provider for OPA.
C.A CI/CD pipeline step that runs the policy check and fails the build on violations.
D.OPA policy files written in Rego language.
E.A tool such as Conftest or OPA itself to evaluate policies against Terraform plan JSON.
AnswersC, D, E

The pipeline must include a step to execute the policy check and enforce the result.

Why this answer

To enforce OPA policies on Terraform plans, you need: 1) OPA policy files written in Rego, 2) a tool like Conftest or a custom OPA integration to evaluate policies against the Terraform plan JSON, and 3) a CI/CD pipeline step that runs the evaluation and fails the build if policies are violated.

386
MCQmedium

A team uses Cloud Deploy with a delivery pipeline that has dev, staging, and prod targets. They want to automatically deploy to staging after a successful deployment to dev, but require manual approval before promoting to prod. How should they configure this?

A.Set the prod target to require approval in Cloud Deploy
B.Create a Cloud Build trigger that runs after dev promotion
C.Configure Cloud Deploy with a canary strategy for prod
D.Use a scheduled Cloud Build to check dev status and then deploy to staging
AnswerA

Approval gate on prod target blocks promotion until manually approved.

Why this answer

Cloud Deploy supports a 'require approval' setting on delivery pipeline targets. By enabling this on the prod target, the pipeline will automatically promote from dev to staging (since no approval is required there) but will pause before promoting to prod, waiting for a manual approval action in the Cloud Deploy console or via the API.

Exam trap

Candidates may confuse deployment strategies (canary, blue/green) with pipeline approval gates, thinking that a canary strategy for prod would require manual approval, but Cloud Deploy's approval is a separate setting on the target itself.

How to eliminate wrong answers

Option B is wrong because creating a Cloud Build trigger that runs after dev promotion adds unnecessary complexity and bypasses the built-in promotion mechanism of Cloud Deploy, which already handles sequential target promotions automatically. Option C is wrong because a canary strategy controls how traffic is shifted during a deployment (e.g., percentage-based rollout), not whether a promotion requires manual approval; approval is a separate pipeline gate. Option D is wrong because using a scheduled Cloud Build to check dev status and then deploy to staging is an anti-pattern—Cloud Deploy already provides automatic promotion between targets without requiring external polling or scheduling.

387
MCQmedium

A company is migrating an on-premises PostgreSQL database to Cloud SQL for PostgreSQL. They need to ensure minimal downtime and maintain ongoing replication until cutover. Which approach should they use?

A.Create a replica of the on-premises PostgreSQL and use pg_basebackup to stream to Cloud SQL.
B.Use Database Migration Service with a continuous migration job.
C.Export using pg_dump with --no-owner and --no-acl flags, then manually configure logical replication slots.
D.Use pg_dump to export the database and import it into Cloud SQL, then set up application-level dual writes.
AnswerB

DMS automates migration with continuous CDC replication, reducing downtime and providing monitoring.

Why this answer

Database Migration Service (DMS) with a continuous migration job is the correct approach because it supports minimal-downtime migrations from on-premises PostgreSQL to Cloud SQL by using PostgreSQL's native logical replication. DMS handles the initial one-time data load and then continuously replicates ongoing changes until you are ready to cut over, meeting the requirement for minimal downtime and ongoing replication.

Exam trap

Google Cloud tests the distinction between one-time export/import tools (pg_dump, pg_basebackup) and managed continuous replication services (DMS), trapping candidates who assume any backup tool can be adapted for ongoing sync without understanding Cloud SQL's connectivity and managed service limitations.

How to eliminate wrong answers

Option A is wrong because pg_basebackup is a physical replication method that creates a binary copy of the database files, but Cloud SQL does not accept direct physical streaming from an external pg_basebackup process; it requires logical replication or a supported migration service. Option C is wrong because while pg_dump with --no-owner and --no-acl can export data, it does not set up ongoing replication; manually configuring logical replication slots on the source and connecting them to Cloud SQL is complex, unsupported by Cloud SQL's managed service, and does not provide a managed continuous migration job. Option D is wrong because pg_dump export/import is a one-time bulk copy that does not provide ongoing replication, and application-level dual writes introduce significant complexity, risk of data inconsistency, and do not guarantee minimal downtime during cutover.

388
MCQeasy

What is the primary purpose of a blameless postmortem in incident management?

A.Identify the individual who caused the incident
B.Update the SLA to exclude the incident period
C.Document the timeline and technical root cause
D.Assign monetary penalties to the responsible team
AnswerC

This is the core purpose: learn from the incident.

Why this answer

Blameless postmortems focus on understanding contributing factors and improving systems, not assigning fault.

389
MCQeasy

What should be adjusted to improve performance and resolve the connection error?

A.Disable automatic failover to reduce overhead
B.Change the instance type to a higher memory machine
C.Increase max_connections and implement connection pooling
D.Increase the disk size to handle more I/O
AnswerC

The error indicates that the connection limit is reached; increasing it together with pooling addresses both the limit and performance.

Why this answer

The connection error is likely due to the database reaching its maximum connection limit, which causes new connection attempts to be rejected. Increasing `max_connections` allows more concurrent client connections, while implementing connection pooling (e.g., using PgBouncer or similar) reuses existing connections efficiently, reducing overhead and preventing connection exhaustion. This directly resolves the error without requiring hardware changes.

Exam trap

Google Cloud often tests the misconception that connection errors are hardware-related (memory or disk), when in fact they are typically caused by exceeding the configured connection limit, which is a software configuration parameter.

How to eliminate wrong answers

Option A is wrong because disabling automatic failover does not address connection limits or errors; failover is a high-availability feature that ensures continuity during node failure, not a performance tuning parameter. Option B is wrong because changing the instance type to a higher memory machine may improve query performance but does not resolve connection errors caused by hitting `max_connections`; memory alone does not increase the connection limit. Option D is wrong because increasing disk size handles I/O throughput and storage capacity, but connection errors are unrelated to disk space or I/O; they are a client-side connection limit issue.

390
MCQhard

An organization has a Cloud SQL for MySQL instance that stores sensitive data. They need to encrypt the data at rest using a customer-managed encryption key (CMEK). The database engineer creates a Cloud KMS key ring and key, and configures the Cloud SQL instance to use CMEK. However, after 30 days, the instance becomes inaccessible and the error message indicates the CMEK key is disabled. What is the most likely cause?

A.The CMEK key was disabled by the key administrator for security reasons.
B.The Cloud SQL instance exceeded the number of times it can access the CMEK key.
C.The CMEK key was rotated, and the old key version was disabled.
D.The CMEK key expired, causing automatic disablement.
AnswerA

If the key is disabled, Cloud SQL cannot access it, causing the instance to become unavailable.

Why this answer

The error message indicates the CMEK key is disabled, and the most common cause in a controlled environment is that the key administrator intentionally disabled the key. Cloud SQL for MySQL requires the CMEK key to be enabled to encrypt and decrypt data at rest; if the key is disabled, the instance cannot access its data and becomes inaccessible. This aligns with the scenario where no other configuration changes are mentioned, making administrative action the likely cause.

Exam trap

The trap here is that candidates may confuse key rotation with key disablement, assuming that rotating a key automatically disables the old version, but in Cloud KMS, old key versions remain enabled unless explicitly disabled.

How to eliminate wrong answers

Option B is wrong because Cloud SQL does not have a limit on the number of times it can access a CMEK key; the key is accessed for each read/write operation, and there is no quota or threshold that would cause disablement. Option C is wrong because key rotation creates a new key version while keeping the old version enabled by default; disabling the old version is a manual action and not an automatic consequence of rotation. Option D is wrong because CMEK keys in Cloud KMS do not have an expiration date; they are disabled only by explicit administrative action or through a key lifecycle policy, not by automatic expiry.

391
Multi-Selecthard

A company is migrating from PostgreSQL to AlloyDB using DMS. They need to set up logical replication on the source. Which THREE components are required for PostgreSQL logical replication?

Select 3 answers
A.DMS migration job
B.pglogical extension
C.Publication on the source database
D.Replication slot
E.Subscription on the destination database
AnswersB, C, E

Provides the logical replication functionality (or built-in pgoutput).

Why this answer

Logical replication requires a publication on the source, a subscription on the destination, and the pglogical extension (or built-in logical replication). DMS is the migration service but not a component of logical replication itself. A replication slot is created automatically.

392
Multi-Selecteasy

Which THREE are components of an effective incident management process? (Choose 3.)

Select 3 answers
A.Automatic rollback of all changes during incidents
B.Blameless postmortem with action items
C.Monthly performance bonuses for on-call
D.On-call rotation with escalation paths
E.Incident commander role
AnswersB, D, E

Learning and improvement.

Why this answer

Key components: on-call rotation, incident command system, and postmortems with action items.

393
Multi-Selecteasy

Which THREE metrics from Cloud Monitoring are important for monitoring Cloud Bigtable performance?

Select 3 answers
A.Storage utilization
B.CPU utilization
C.Latency (P99)
D.Request count
E.Disk usage
AnswersB, C, D

High CPU indicates nodes are busy processing requests.

Why this answer

CPU utilization (option B) is a critical metric for Cloud Bigtable because it directly reflects the processing load on the cluster's nodes. High CPU utilization indicates that the cluster is approaching its throughput limits, which can lead to increased latency and throttling. Monitoring this metric helps in scaling decisions, such as adding nodes or optimizing queries, to maintain performance.

Exam trap

The trap here is that candidates often confuse storage-related metrics (like disk usage or storage utilization) with performance metrics, but Cloud Bigtable abstracts storage management, making CPU, latency, and request count the direct indicators of performance health.

394
MCQhard

You want to create a dashboard-as-code for Cloud Monitoring using the API. You have a JSON representation of the dashboard. Which command correctly creates the dashboard?

A.gcloud monitoring dashboards create --config-from-file=file.json
B.gcloud beta monitoring dashboards create --json-file=file.json
C.gcloud monitoring dashboards import file.json
D.gcloud monitoring dashboards create --dashboard="file.json"
AnswerA

This is the correct command.

Why this answer

The gcloud monitoring dashboards create command with the --config-from-file flag allows you to create a dashboard from a JSON file.

395
Multi-Selectmedium

Which THREE of the following SQL techniques are commonly used to improve BI query performance in BigQuery?

Select 3 answers
A.Select all columns using SELECT * to avoid missing data
B.Avoid JOINs by storing all relevant data in a single table
C.Use self-joins to compare rows within the same table
D.Apply filters in the WHERE clause as early as possible
E.Use APPROX_COUNT_DISTINCT instead of COUNT(DISTINCT) when exact counts are not needed
AnswersB, D, E

Denormalization eliminates JOIN overhead.

Why this answer

Denormalizing data into a single table avoids expensive JOIN operations, which in BigQuery can cause significant performance degradation due to shuffling and data redistribution across slots. By storing all relevant data in one table, you reduce the need for large-scale data shuffling, leading to faster query execution and lower slot consumption.

Exam trap

Google Cloud often tests the misconception that 'SELECT *' is safe for ad-hoc queries, but in BigQuery it directly increases bytes billed and query latency due to full column scans, making it a poor practice for performance optimization.

396
MCQhard

A company uses BigQuery for BI reporting. They have a materialized view that refreshes automatically to provide pre-aggregated sales data. Recently, the materialized view stopped reflecting new data inserted into the base table. The base table is a streaming buffer table with ingestion-time partitioning. What is the most likely reason?

A.The materialized view does not support streaming buffer tables.
B.The automatic refresh interval has been exceeded due to high query load.
C.The materialized view has reached the maximum number of partitions allowed.
D.The base table's schema has changed, making the materialized view incompatible.
AnswerA

Materialized views require data to be committed to storage; streaming buffer data is not yet committed.

Why this answer

Materialized views in BigQuery do not support base tables that use a streaming buffer, such as ingestion-time partitioned tables. The streaming buffer contains data that has not yet been committed to managed storage, and materialized views can only read from committed storage. Therefore, when new data is inserted into the streaming buffer, the materialized view cannot reflect it until the data is flushed from the buffer, which can cause the view to appear stale or stop reflecting new data entirely.

Exam trap

Google Cloud often tests the misconception that materialized views automatically reflect all data in the base table, including uncommitted streaming buffer data, when in fact they only read from committed storage.

How to eliminate wrong answers

Option B is wrong because the automatic refresh interval is not exceeded due to high query load; BigQuery materialized views refresh based on a system-defined interval (typically within 5 minutes of base table changes) and are not affected by query load. Option C is wrong because materialized views do not have a maximum number of partitions limit that would cause them to stop reflecting new data; partition limits apply to tables, not materialized views. Option D is wrong because schema changes to the base table would cause the materialized view to become invalid or require a manual refresh, but the question states the view stopped reflecting new data, not that it became invalid, and schema changes are not the most likely cause in this streaming buffer scenario.

397
MCQmedium

A team is using Cloud Build to build Docker images and push them to Artifact Registry. They want to speed up builds by caching the Docker layers. Which approach is recommended for caching in Cloud Build?

A.Configure Cloud Build to use Kaniko cache with a destination in Artifact Registry
B.Use Google Cloud Storage as a layer cache for Docker builds
C.Use 'gcloud builds submit --cache-from' with a local cache
D.Set up a Docker registry proxy in Compute Engine to cache images
AnswerA

Kaniko with --cache=true and --cache-repo stores layers in Artifact Registry for reuse.

Why this answer

Cloud Build supports Kaniko caching for Docker images. Kaniko can cache layers in a registry, significantly reducing build times by reusing cached layers when the Dockerfile hasn't changed.

398
MCQhard

A company uses Cloud Build with GitHub triggers. The build pipeline runs tests, builds a Docker image, and pushes it to Artifact Registry. Recently, builds started failing with '403 Forbidden' when pushing to Artifact Registry. The Cloud Build service account has the Artifact Registry Writer role. What else could be causing the failure?

A.The Docker credential helper is not configured in the build step.
B.The repository is in a different region than the Cloud Build worker.
C.The Cloud Build service account does not have the 'iam.serviceAccountUser' role on the Compute Engine default service account.
D.The Artifact Registry API is not enabled in the project.
AnswerD

The API must be enabled for any API calls to succeed.

Why this answer

If the Artifact Registry API is not enabled for the project, any attempt to push a Docker image to Artifact Registry will fail with a 403 Forbidden error, regardless of the service account's IAM roles. The Cloud Build service account may have the Artifact Registry Writer role, but without the underlying API enabled, the service cannot interact with the Artifact Registry service at all. Enabling the `artifactregistry.googleapis.com` API is a prerequisite for any API calls to succeed.

Exam trap

Google Cloud often tests the distinction between IAM roles and API enablement, trapping candidates who assume that granting a role automatically enables the underlying service API.

How to eliminate wrong answers

Option A is wrong because the Docker credential helper (e.g., `gcloud auth configure-docker`) is automatically configured by Cloud Build when using the default builder images or the `docker` step with the `-c` flag; a missing credential helper would cause authentication failures (e.g., 'denied: Unauthenticated'), not a 403 Forbidden. Option B is wrong because Cloud Build workers can push to Artifact Registry repositories in any region; cross-region pushes are supported and do not cause 403 errors—only latency or egress costs may differ. Option C is wrong because the `iam.serviceAccountUser` role is required only when Cloud Build needs to impersonate a user-managed service account (e.g., to deploy to Compute Engine); pushing to Artifact Registry does not require impersonation, and the Cloud Build service account already has direct permissions via the Artifact Registry Writer role.

399
MCQeasy

An SRE team is setting up an on-call rotation for incident response. They want to use a tool that integrates with Cloud Monitoring and can escalate incidents if not acknowledged. Which service should they integrate with Cloud Monitoring?

A.Cloud Pub/Sub
B.PagerDuty
C.Cloud Functions
D.Cloud Run
AnswerB

PagerDuty integrates with Cloud Monitoring for alerting and on-call management.

Why this answer

Cloud Monitoring can send notifications to PagerDuty, OpsGenie, and other incident management tools. PagerDuty is a common choice for on-call rotations and escalation policies.

400
Multi-Selecteasy

Which TWO actions can a team take immediately to resolve a Cloud SQL instance running out of storage?

Select 2 answers
A.Enable automatic storage increase
B.Increase storage capacity via gcloud
C.Delete binary log files
D.Migrate to Cloud Spanner
E.Add read replicas
AnswersA, B

Automatic increase ensures future storage issues are avoided.

Why this answer

Enabling automatic storage increase on a Cloud SQL instance allows the database to automatically add storage when it detects that the available space is running low, preventing out-of-storage errors without manual intervention. This is a quick, immediate action that requires no downtime and is configured via the Cloud Console or gcloud command.

Exam trap

A common misconception is that deleting binary logs or adding read replicas directly resolves storage issues in Cloud SQL, but binary logs are managed by the service and replicas do not increase primary storage capacity. The immediate actions are enabling automatic storage increase or manually increasing storage capacity via gcloud.

401
Multi-Selecthard

An engineer is migrating a 20 TB PostgreSQL database to AlloyDB using DMS continuous migration. The full dump phase is taking longer than expected. Which THREE factors could affect the duration of the full dump phase? (Choose THREE.)

Select 3 answers
A.The version of the source PostgreSQL database.
B.The number of tables and indexes on the source.
C.The CPU and I/O capacity of the source database server.
D.The choice of SSL or non-SSL connection.
E.Network bandwidth between the source and DMS.
AnswersB, C, E

More objects increase overhead.

Why this answer

Full dump time depends on data volume, network bandwidth, CPU/memory of the source, and configuration (e.g., parallel workers).

402
Multi-Selectmedium

A site reliability team wants to reduce toil in their incident management process. They currently receive alerts via email and manually create tickets, page the on-call engineer, and update a shared spreadsheet. Which TWO Google Cloud services can help automate these tasks and reduce toil?

Select 2 answers
A.Cloud Build
B.Cloud Monitoring
C.Cloud Functions
D.Cloud Scheduler
E.Cloud Run
AnswersB, C

Can send alert notifications to Pub/Sub, triggering automation.

Why this answer

Cloud Monitoring can send alerts to notification channels that trigger Cloud Functions via webhook or Pub/Sub. Cloud Functions can then automate ticket creation and page on-call via PagerDuty API. Cloud Build is for CI/CD, not incident management.

Cloud Scheduler is for cron jobs, not event-driven. Cloud Run is for stateless containers, not ideal for event-driven automation of incidents.

403
Multi-Selecthard

A company runs Memorystore for Redis with a Standard tier instance. They want to scale to higher throughput and memory capacity beyond the current tier limits. Which TWO actions should they take?

Select 2 answers
A.Switch from HDD to SSD storage.
B.Enable Redis Cluster to shard data across multiple nodes.
C.Add a cross-region replica to increase read capacity.
D.Increase the maxmemory setting beyond the tier limit.
E.Upgrade to a larger tier (e.g., from M5 to M10).
AnswersB, E

Redis Cluster allows horizontal scaling.

Why this answer

Redis Cluster shards data across multiple nodes, allowing horizontal scaling beyond the limits of a single Standard tier instance. This enables higher throughput and memory capacity by distributing the dataset across multiple primary nodes, each handling a subset of the keyspace.

Exam trap

The PCDOE exam often tests the distinction between vertical scaling (upgrading tier) and horizontal scaling (sharding), and candidates may mistakenly think that increasing maxmemory or adding replicas can overcome tier limits, when in fact replicas do not increase total memory capacity and maxmemory is bounded by the instance's physical RAM.

404
MCQmedium

A company uses Helm charts to manage Kubernetes deployments. They want to integrate Skaffold into their CI/CD pipeline for local development and continuous deployment to GKE. Which Skaffold feature is MOST relevant for applying environment-specific configurations?

A.skaffold run with --profile flag
B.Skaffold's built-in Kustomize renderer
C.Helm charts with values files per environment
D.Skaffold's artifact dependency graph
AnswerB

Kustomize overlays modify base YAMLs for each environment, perfect for environment-specific configs.

Why this answer

Skaffold's built-in Kustomize renderer allows you to apply environment-specific overlays and patches directly within the Skaffold pipeline, enabling declarative configuration management without modifying the underlying Helm charts. This is the most relevant feature for applying environment-specific configurations when using Helm charts, as Kustomize can override Helm-generated manifests with environment-specific patches, such as different replica counts or resource limits, without requiring separate Helm values files per environment.

Exam trap

Google often tests the distinction between Skaffold-native features and external tool integrations; the trap here is that candidates may choose Helm values files (Option C) because they are familiar with environment-specific configurations in Helm, but the question explicitly asks for a Skaffold feature, and the Kustomize renderer is the Skaffold-native mechanism for applying such configurations within the Skaffold pipeline.

How to eliminate wrong answers

Option A is wrong because the `--profile` flag in `skaffold run` is used to select a predefined set of configuration overrides within the skaffold.yaml file, not to apply environment-specific configurations to Helm charts; it is a Skaffold-level feature that controls which pipeline steps run, not a mechanism for customizing Kubernetes manifests per environment. Option C is wrong because while Helm charts with values files per environment are a valid approach for environment-specific configurations, the question specifically asks for a Skaffold feature, and using Helm values files is a Helm-native capability, not a Skaffold feature; Skaffold can pass values files, but the feature most relevant for applying environment-specific configurations within Skaffold is its Kustomize renderer. Option D is wrong because Skaffold's artifact dependency graph is used to determine the build and deploy order of artifacts based on their dependencies, not for applying environment-specific configurations; it optimizes the pipeline execution but does not modify Kubernetes manifests.

405
MCQeasy

A SQL query with multiple JOINs is returning duplicate rows. What is the most likely cause?

A.Using INNER JOIN instead of LEFT JOIN.
B.There is a one-to-many relationship between tables.
C.Missing ORDER BY clause.
D.Using UNION instead of UNION ALL.
AnswerB

One-to-many joins multiply rows from the one side.

Why this answer

When a SQL query with multiple JOINs returns duplicate rows, the most likely cause is a one-to-many relationship between the tables being joined. Each matching row in the 'many' side of the join multiplies the rows from the 'one' side, producing duplicates. This is a fundamental behavior of JOIN operations in SQL, where the result set is the Cartesian product of matching rows across the joined tables.

Exam trap

Google Cloud often tests the misconception that duplicate rows are caused by the type of JOIN (e.g., INNER vs LEFT) or by missing sorting, rather than understanding that duplicates arise from the cardinality of the relationship between the joined tables.

How to eliminate wrong answers

Option A is wrong because using INNER JOIN instead of LEFT JOIN does not inherently cause duplicates; it only filters out non-matching rows, which can actually reduce duplicates. Option C is wrong because the ORDER BY clause only affects the sorting of the result set, not the number of rows returned. Option D is wrong because UNION removes duplicates by default (acting like UNION ALL with a DISTINCT step), while UNION ALL preserves all rows including duplicates; the question is about duplicate rows from JOINs, not from set operations.

406
MCQeasy

Which of the following is NOT a characteristic of toil as defined by SRE?

A.No enduring value
B.Requires complex problem-solving
C.Repetitive
D.Manual
AnswerB

Toil does not require complex problem-solving; it's mundane.

Why this answer

Toil is manual, repetitive, automatable, and has no enduring value. Complex design work is the opposite.

407
Multi-Selecteasy

Which TWO data types are supported in Cloud Spanner schemas?

Select 2 answers
A.ARRAY
B.GEOMETRY
C.TIMESTAMP
D.TEXT
E.TINYINT
AnswersA, C

ARRAY is supported for storing repeated values of a specific type.

Why this answer

ARRAY is a supported data type in Cloud Spanner, allowing you to store ordered lists of elements of the same primitive type (e.g., ARRAY<STRING>, ARRAY<INT64>). This is essential for modeling one-to-many relationships without requiring separate tables, and it integrates seamlessly with Cloud Spanner's query engine for array operations.

Exam trap

Candidates often mistakenly choose GEOMETRY or TEXT because they are common in other databases, but Cloud Spanner uses STRING for text and does not support spatial types. Also, TINYINT is not a Cloud Spanner type; use INT64 instead.

408
MCQmedium

During an incident, the incident commander decides to escalate to a higher severity level. Which of the following best describes the incident commander's primary responsibility?

A.Managing the incident response process and communications
B.Debugging the root cause of the incident
C.Writing the postmortem document
D.Implementing the fix
AnswerA

This is the key role of incident commander.

Why this answer

The incident commander is responsible for coordinating response, communication, and prioritization, not necessarily fixing the issue.

409
MCQhard

Refer to the exhibit. You receive the following query output showing bytes processed for a BigQuery query. The table is partitioned by date and clustered on country. What is the most likely reason for the high bytes processed?

A.The GROUP BY country requires sorting all rows
B.The table is not partitioned correctly
C.The date range is too wide
D.The query does not filter on the clustering column, causing full scan of selected partitions
AnswerD

Clustering on country helps only if the WHERE clause filters on country; otherwise, all rows in partitions are scanned.

Why this answer

BigQuery clustering only reduces the bytes scanned when the query filters on the clustering column (country). Without a WHERE clause on country, BigQuery must scan all rows in the selected partitions, even though partition pruning may reduce the date range. The high bytes processed indicates that clustering is not being leveraged, so the query performs a full scan of the chosen partitions.

Exam trap

Google Cloud often tests the misconception that clustering alone reduces bytes scanned, but the trap is that clustering only helps when the query includes a filter on the clustering column; otherwise, it provides no scanning benefit.

How to eliminate wrong answers

Option A is wrong because GROUP BY country does not inherently require sorting all rows; BigQuery can use hash aggregation and clustering metadata to avoid a full sort, and the high bytes processed is due to scanning data, not sorting. Option B is wrong because the table is partitioned correctly by date, as shown by the partition pruning in the query output; incorrect partitioning would cause a different symptom, such as scanning all partitions. Option C is wrong because the date range being too wide would increase bytes processed, but the question states the table is partitioned by date and the query likely filters on date; the primary issue is the lack of a filter on the clustering column, not the date range width.

410
MCQhard

A team is migrating an on-premises PostgreSQL database to Cloud SQL. The current schema uses a composite primary key on columns (customer_id, order_date) in the orders table. The migration team wants to reduce the cost of secondary indexes. Which schema design change should they consider?

A.Partition the table by customer_id to reduce the number of secondary indexes needed.
B.Create a secondary index on the composite key to keep the same query performance.
C.Replace the composite primary key with a surrogate UUID primary key and add unique constraints on the original columns.
D.Use the CLUSTER command to physically reorder the table based on the composite key.
AnswerA

Partitioning by customer_id can eliminate the need for a secondary index on that column by enabling partition pruning, thereby reducing storage costs.

Why this answer

Partitioning the table by customer_id can reduce the need for secondary indexes on that column. When the table is partitioned, queries that filter by customer_id can use partition pruning instead of an index scan, allowing you to drop an index on customer_id and thus reduce secondary index storage costs. Creating a secondary index on the composite key (B) would add an index and increase cost.

Replacing the composite primary key with a surrogate UUID (C) would require a unique constraint index on the original columns, resulting in two indexes (the PK on UUID and the unique index on the composite columns) instead of one, which increases index costs. Using the CLUSTER command (D) physically reorders table rows but does not reduce index sizes.

Exam trap

It is a common misconception that only narrowing the primary key can reduce secondary index costs in PostgreSQL. In PostgreSQL, secondary indexes do not include primary key columns, so partitioning is a valid method to reduce the need for certain indexes by enabling partition pruning.

How to eliminate wrong answers

Option A is wrong because partitioning by customer_id does not reduce the number or size of secondary indexes; it only splits the table into smaller physical segments, and each partition still needs its own indexes. Option B is wrong because creating a secondary index on the composite key duplicates the primary key index, increasing storage and write overhead without reducing cost. Option D is wrong because the CLUSTER command physically reorders rows based on an index, which can improve locality but does not reduce secondary index size or cost; it is a one-time maintenance operation, not a schema design change.

411
MCQeasy

An application uses Cloud SQL (MySQL) and experiences an increasing number of 'too many connections' errors. The current instance has 4 vCPUs and 15GB of RAM. The application's connection pool is configured for 500 connections. What should the engineer do to resolve this error?

A.Configure a Cloud SQL connection pool with a maximum of 100 connections
B.Create a read replica to distribute read connections
C.Upgrade the instance to have 8 vCPUs to increase connection capacity
D.Increase the max_connections flag in the Cloud SQL database flags settings
AnswerD

Raising the max_connections flag allows more concurrent connections, resolving the error.

Why this answer

The max_connections in MySQL is typically set based on memory: max_connections = RAM_MB/16. With 15GB RAM = 15360 MB, max_connections = 15360/16 = 960. The application pool of 500 should be fine, but if the error occurs, it might be due to other factors.

However, the most common fix is to increase the max_connections parameter via a flag. The correct step is to increase the 'max_connections' flag in Cloud SQL. Reducing connections or using a connection pool won't help if the limit is reached.

Increasing vCPUs does not directly change max_connections.

412
MCQmedium

A company uses Cloud Bigtable for real-time analytics. They need to implement disaster recovery across regions with a recovery point objective (RPO) of no more than 5 minutes and recovery time objective (RTO) under 10 minutes. Which approach should they take?

A.Configure Bigtable replication with a secondary cluster in a different region and use Cloud DNS health checks to update routing policy on failover.
B.Perform daily exports of Bigtable data to Cloud Storage and import into a new cluster in case of failure.
C.Migrate the workload to Cloud Spanner multi-region for built-in disaster recovery.
D.Use Cloud Scheduler to trigger a script that takes a Bigtable snapshot every hour.
AnswerA

Bigtable replication provides asynchronous replication across regions (RPO seconds to minutes). Cloud DNS with health checks can automate routing to the secondary cluster, achieving RTO <10 minutes.

Why this answer

Bigtable replication allows creating secondary clusters in different regions. Asynchronous replication has typical lag of a few seconds to minutes, meeting RPO of 5 minutes. For failover, the application's routing policy must be updated to point to the secondary cluster.

Cloud DNS health checks can detect primary failure and automatically update routing policy. Backups have RPO equal to backup interval (hours) and RTO of hours. Exporting to Cloud Storage is manual and slow.

Using Cloud Spanner is a different service.

413
Multi-Selecthard

A team uses Terraform and wants to enforce policy checks before code is committed to the repository. Which TWO tools can be used for pre-commit policy as code checks? (Choose 2)

Select 2 answers
A.Conftest
B.`terraform plan`
C.Cloud Build
D.Sentinel
E.OPA (Open Policy Agent)
AnswersA, E

Runs policy checks locally using OPA policies.

Why this answer

Conftest is designed for pre-commit checks using OPA policy language. OPA itself can be used via Conftest or other tools. Sentinel is for Terraform Cloud/Enterprise, not pre-commit. `terraform plan` is not a policy check.

Cloud Build runs after commit.

414
MCQmedium

A Firestore database is used for a social app. A collection of posts has indexes on fields `author` and `timestamp`. The query `where author == 'user1' order by timestamp desc limit 10` is performing a large number of document reads. What is the likely cause?

A.The limit is too high.
B.The query is scanning all posts.
C.Index on timestamp is not descending.
D.Missing composite index on (author, timestamp).
AnswerD

A composite index covers both the filter and sort, avoiding large scans.

Why this answer

The query filters on `author` and orders by `timestamp`, which requires a composite index on `(author, timestamp)` to avoid a full scan. Without this composite index, Firestore must scan all documents matching `author == 'user1'` (or all posts if no single-field index on `author` is used) and then sort them in memory, leading to excessive document reads. The existing single-field indexes on `author` and `timestamp` are insufficient for this combined filter and sort operation.

Exam trap

Google Cloud often tests the misconception that single-field indexes are sufficient for combined filter and order queries, when in fact Firestore requires a composite index to avoid scanning all matching documents.

How to eliminate wrong answers

Option A is wrong because a limit of 10 is not inherently too high; the excessive reads are due to the lack of a composite index, not the limit value. Option B is wrong because the query is not scanning all posts if a single-field index on `author` exists, but it still reads all documents for that author and sorts in memory, which is inefficient. Option C is wrong because the index on `timestamp` does not need to be descending; Firestore can reverse the sort order at query time as long as a composite index on `(author, timestamp)` exists, and the issue is the missing composite index, not the direction of the single-field index.

415
MCQmedium

Your company is deploying a new application on Google Cloud and needs to choose a database solution. The application requires strong transactional consistency, complex SQL queries, and the ability to scale horizontally for read-heavy workloads. Which database service should you recommend?

A.Cloud Spanner
B.BigQuery
C.Cloud SQL
D.Cloud Firestore
AnswerA

Cloud Spanner offers strong consistency, SQL, and horizontal scaling.

Why this answer

Cloud Spanner is the correct choice because it provides strong transactional consistency (ACID) across globally distributed nodes, supports complex SQL queries with standard SQL syntax, and offers horizontal scaling for read-heavy workloads through automatic sharding and read replicas. Unlike other options, Spanner uniquely combines these three requirements—strong consistency, SQL, and horizontal scaling—in a single managed service.

Exam trap

Google Cloud often tests the misconception that Cloud SQL can scale horizontally for read-heavy workloads, but Cloud SQL's read replicas are limited and do not provide true horizontal scaling or strong consistency across replicas, unlike Spanner's built-in distributed architecture.

How to eliminate wrong answers

Option B (BigQuery) is wrong because it is a data warehouse optimized for analytical queries on large datasets, not for transactional workloads requiring strong consistency and complex SQL with ACID guarantees. Option C (Cloud SQL) is wrong because while it supports complex SQL and strong consistency, it cannot scale horizontally for read-heavy workloads; it is limited to vertical scaling and read replicas with eventual consistency. Option D (Cloud Firestore) is wrong because it is a NoSQL document database that does not support complex SQL queries and offers only eventual consistency in multi-region mode, not strong transactional consistency.

416
MCQeasy

A startup is building a mobile app that requires a highly available, globally distributed, low-latency NoSQL database. The data model is key-value with occasional queries on a secondary field. Which database service should they choose?

A.Cloud SQL (PostgreSQL)
B.Cloud Firestore
C.Cloud Spanner
D.Cloud Bigtable
AnswerB

Firestore is a flexible NoSQL database with automatic multi-region replication, real-time updates, and strong consistency.

Why this answer

Cloud Firestore is a fully managed, globally distributed NoSQL document database that provides strong consistency, automatic multi-region replication, and low-latency queries on key-value pairs as well as secondary fields (via composite indexes). It is ideal for mobile apps requiring high availability and real-time data synchronization across the globe, directly matching the requirements of a key-value model with occasional secondary queries.

Exam trap

The trap here is that candidates often confuse Cloud Spanner's global distribution and strong consistency with being the best fit for NoSQL key-value workloads, overlooking that Spanner is a relational database with SQL semantics and higher operational overhead, while Firestore is purpose-built for mobile app key-value and document storage with automatic secondary indexing.

How to eliminate wrong answers

Option A is wrong because Cloud SQL (PostgreSQL) is a relational database that does not natively support global distribution or low-latency key-value access; it is designed for single-region deployments and requires manual replication for multi-region setups. Option C is wrong because Cloud Spanner is a globally distributed relational database that provides strong consistency and horizontal scaling, but it is optimized for SQL workloads and complex transactions, not for simple key-value models with occasional secondary queries, and it incurs higher cost and complexity than necessary. Option D is wrong because Cloud Bigtable is a wide-column NoSQL database designed for high-throughput, low-latency analytical workloads (e.g., time-series, IoT) but does not support secondary indexes or efficient queries on non-key fields; it is not suitable for mobile app use cases requiring ad-hoc queries on secondary attributes.

417
Multi-Selecteasy

Which TWO database services are fully managed and support global distribution of data for low-latency reads and writes?

Select 2 answers
A.Memorystore
B.Cloud Spanner
C.Firestore
D.Bigtable
E.Cloud SQL
AnswersB, C

Cloud Spanner provides global distribution with automatic synchronous replication across regions.

Why this answer

Cloud Spanner is a fully managed, globally distributed relational database service that provides strong consistency and horizontal scaling across regions. It supports global distribution of data for low-latency reads and writes by using synchronous replication and atomic clocks for TrueTime, enabling ACID transactions at global scale.

Exam trap

Google Cloud often tests the distinction between 'global distribution for reads and writes' versus 'global distribution for reads only'—candidates mistakenly choose Bigtable or Cloud SQL because they offer read replicas globally, but they do not support globally distributed writes with strong consistency.

418
MCQhard

You are responsible for a Cloud Spanner instance that serves a global user base. A new feature requires adding an index on a column of an existing table that contains millions of rows. The table is actively used by production traffic. What is the recommended approach to add the index with minimal impact?

A.Create a second table with the index already defined, then copy the data using batch writes and switch traffic. This avoids any impact to the original table.
B.Take a full database backup to Cloud Storage, restore it to a new instance, create the index on the restored instance, and then fail over to the new instance.
C.Use the gcloud command 'gcloud spanner databases ddl update' with an ALTER TABLE statement to add the index. This will lock the table briefly but is acceptable.
D.Use the gcloud command 'gcloud spanner databases ddl update' with a CREATE INDEX statement. The operation will be non-blocking and will not impact production traffic.
AnswerD

Correct. CREATE INDEX in Spanner is an online, non-blocking operation.

Why this answer

Cloud Spanner supports online, non-blocking index creation. The CREATE INDEX statement processes the index in the background and does not block reads or writes on the table. This is the most efficient and least impactful method.

Using a backup/restore or export/import is unnecessarily complex and disruptive.

419
MCQmedium

Your team has an alerting policy that fires frequently but the on-call engineer has difficulty understanding the impact. You want to add contextual information such as a runbook URL and severity label. What should you do?

A.Set a description on the notification channel
B.Create a separate alert policy for each severity level
C.Edit the alert policy documentation field to include a runbook URL and labels
D.Add labels to the metric descriptor used in the condition
AnswerC

Documentation field supports markdown and can include links and labels.

Why this answer

Alert policy documentation allows you to add plain text, including markdown, which can contain links to runbooks and other info. You can also add labels to the policy. Adding labels to the metric or using notification channel descriptions does not attach documentation to the alert.

420
Multi-Selecteasy

An organization wants to use Cloud Build to automatically build and test code changes when a developer pushes to any branch in a Cloud Source Repositories repository. Which two configurations are needed?

Select 2 answers
A.A pull request trigger
B.A cloudbuild.yaml file in the repository
C.A scheduled trigger with cron
D.A manual trigger with webhook
E.A push trigger with a branch regex of '.*'
AnswersB, E

Cloud Build requires a build configuration file to define the steps.

Why this answer

A push trigger monitors branch pushes. To capture all branches, the trigger should use a regex pattern like '.*'. Additionally, the cloudbuild.yaml file must be present in the repository to define the build steps.

421
Multi-Selectmedium

A team uses Helm charts to deploy applications to GKE. They want to use Kustomize to manage environment-specific overlays for different clusters. Which two tools or approaches can they combine to achieve this?

Select 2 answers
A.Use Skaffold to run Helm and Kustomize in sequence
B.Use Config Sync to apply Kustomize overlays directly
C.Use 'kubectl apply -k' to apply Helm charts without overlays
D.Use Kustomize's 'helmCharts' plugin to render Helm charts and apply overlays
E.Use Cloud Build's built-in Helm support only
AnswersA, D

Skaffold can run a Helm deploy and then a Kustomize deploy, or vice versa, in a CI/CD pipeline.

Why this answer

Skaffold can orchestrate both Helm and Kustomize in a single pipeline, allowing you to first render Helm charts and then apply Kustomize overlays for environment-specific customizations. Option D is correct because Kustomize's 'helmCharts' plugin can directly render Helm charts and apply overlays in one step, providing an alternative approach. Both methods enable combining Helm's templating with Kustomize's overlays.

Exam trap

A common trap is assuming that Kustomize cannot work with Helm charts. The 'helmCharts' plugin (Option D) is a valid, though experimental, feature that allows direct integration. Additionally, candidates may overlook Skaffold's orchestration capability (Option A) as a stable alternative.

422
Multi-Selecthard

Which TWO actions should be taken to enable layer caching for Docker builds using Kaniko in Cloud Build? (Choose two.)

Select 2 answers
A.Add `--cache-repo` specifying an Artifact Registry repository
B.Use the `docker` builder instead of Kaniko
C.Set the `CACHE_LAYERS` substitution variable
D.Add `--cache=true` to the Kaniko builder arguments
E.Enable Cloud Build's built-in caching by adding `cache: true`
AnswersA, D

Specifies where to store cache layers.

Why this answer

Kaniko requires the `--cache-repo` flag to specify an Artifact Registry repository where cached layers will be stored and retrieved. This enables layer caching across builds, reducing build time by reusing unchanged layers. Without this flag, Kaniko does not know where to push or pull cached layers from.

Exam trap

A common pitfall is confusing Cloud Build's built-in caching (which caches the final image) with Kaniko's layer caching (which caches intermediate layers). Candidates may incorrectly select `cache: true` thinking it enables layer caching, but that is not how Kaniko works.

423
MCQmedium

A company has a BigQuery table partitioned by ingestion time. They want to create a BI report showing month-over-month revenue growth. To minimize query cost, what should they do?

A.Use a WHERE clause with _PARTITIONDATE >= DATE_SUB(CURRENT_DATE(), INTERVAL 13 MONTH) and LAG
B.Use DATE_TRUNC on the ingestion timestamp without filtering partitions
C.Use LAG without a partition filter
D.Use a wildcard table with UNION ALL over monthly tables
AnswerA

This filters to only the necessary partitions for the last 13 months (to compute month-over-month) and uses LAG for growth.

Why this answer

It uses a WHERE clause with _PARTITIONDATE >= DATE_SUB(CURRENT_DATE(), INTERVAL 13 MONTH) to prune partitions, ensuring BigQuery scans only the necessary 13 months of data. The LAG function then computes month-over-month revenue growth efficiently. This minimizes query cost by reducing the amount of data processed, which is critical for ingestion-time partitioned tables.

Exam trap

Google Cloud often tests the misconception that any date function or window function alone reduces cost, but without explicit partition pruning (e.g., _PARTITIONDATE filter), BigQuery still scans all partitions, negating cost benefits.

How to eliminate wrong answers

Option B is wrong because DATE_TRUNC on the ingestion timestamp without a partition filter does not prune partitions; BigQuery would still scan all partitions, leading to higher costs. Option C is wrong because using LAG without a partition filter forces a full table scan, negating any cost savings from partitioning. Option D is wrong because using a wildcard table with UNION ALL over monthly tables is an anti-pattern; it requires manual table management and does not leverage BigQuery's native partitioning, often resulting in higher costs and complexity.

424
Multi-Selecthard

A company uses Firestore to power a live sports score app. Scores are updated frequently, and many clients listen to real-time updates on specific games. Which two design decisions will minimize the number of reads and reduce costs? (Choose two.)

Select 2 answers
A.Use a collection group query to listen to all games at once
B.Store an aggregate score summary document per game and listen to it
C.Use a separate document per game and listeners filter by game ID
D.Use a single document for all games with nested fields
E.Use a subcollection of periods (quarters) to spread writes
AnswersB, C

Reduces write operations and read frequency; clients get updates from a single summary document.

Why this answer

Storing an aggregate score summary document per game and listening to it reduces reads by consolidating frequently updated fields into a single document, minimizing the number of document reads per update. Option C is correct because using a separate document per game with listeners filtered by game ID ensures each client only listens to the specific game they care about, avoiding unnecessary reads from irrelevant documents.

Exam trap

Avoid the misconception that spreading writes across many documents (e.g., subcollections) reduces costs. In Firestore, reads are charged per document read. Consolidating frequently updated scores into a single summary document per game and having clients listen only to specific game IDs minimizes document reads and reduces costs.

425
MCQmedium

A Cloud Spanner application experiences high write latency on a table with a monotonically increasing primary key. Which schema change will most effectively reduce latency?

A.Convert the table to an interleaved table
B.Add a secondary index on the existing key
C.Modify the primary key to include a hash of the original key as a leading column
D.Increase the number of nodes in the instance
AnswerC

Hash prefix distributes writes uniformly across splits.

Why this answer

Monotonically increasing primary keys in Cloud Spanner cause writes to be concentrated on a single split (hotspotting), leading to high write latency. By modifying the primary key to include a hash of the original key as a leading column, writes are distributed uniformly across all nodes, eliminating the hotspot. Option A (interleaved tables) is a table organization pattern that does not address hotspotting.

Option B (secondary index on existing key) does not change the write pattern; writes still go to the same primary key range. Option D (increasing nodes) can improve overall throughput but does not fix the hotspotting; writes remain concentrated on one split, so latency may not improve significantly.

426
Multi-Selecthard

A company is designing a Cloud Spanner database for a global supply chain application. The schema includes a table 'Shipments' with columns: shipment_id (INT64), created_at (TIMESTAMP), origin (STRING), destination (STRING), status (STRING). The application frequently queries for shipments by origin and status. Which three design choices optimize query performance? (Choose THREE.)

Select 3 answers
A.Partition the table by region to limit scans.
B.Use the STORING clause in the index to include frequently accessed columns.
C.Interleave an 'OrderItems' table under 'Shipments' for join performance.
D.Create a secondary index on (origin, status) for efficient filtering.
E.Use a monotonically increasing integer primary key for high write throughput.
AnswersB, C, D

Reduces additional reads.

Why this answer

The STORING clause in a Cloud Spanner secondary index allows you to include additional columns (such as 'destination' or 'status') in the index storage, enabling index-only scans that avoid fetching rows from the base table. This reduces read latency and resource consumption for queries that frequently access those columns along with the indexed keys. Option C is correct because interleaving an 'OrderItems' table under 'Shipments' places child rows physically close to parent rows, improving join performance by reducing round trips and allowing efficient row scans.

Option D is correct because a secondary index on (origin, status) directly supports the frequent queries filtering on those columns, enabling fast lookups without scanning the entire table. Options A and E are incorrect: Cloud Spanner does not support traditional partitioning by region, and monotonically increasing primary keys cause hotspotting at the leader, reducing write throughput.

Exam trap

Google Cloud often tests the misconception that Cloud Spanner supports traditional partitioning or that monotonically increasing keys are safe for distributed databases, leading candidates to select options that would actually degrade performance.

427
MCQmedium

An organization wants to enforce that Compute Engine instances cannot have public IP addresses. Which organization policy constraint should be applied?

A.compute.requireOsLogin
B.compute.disableSerialPortAccess
C.compute.vmExternalIpAccess
D.iam.disableServiceAccountKeyCreation
AnswerC

This constraint controls external IP access for VMs.

Why this answer

The `compute.vmExternalIpAccess` constraint restricts which VM instances are allowed to have external IP addresses. When enforced as a list deny, it can block all external IPs.

428
MCQmedium

A Cloud Pub/Sub subscription is processing a high volume of messages, but the subscriber frequently receives messages that have already been processed (duplicates). The subscriber's processing time varies from 100 ms to 10 seconds. Which parameter should be adjusted to reduce duplicates while maintaining throughput?

A.Increase the acknowledgement deadline to 60 seconds
B.Enable flow control with a max outstanding message count
C.Use ordering keys on the subscription
D.Increase the number of puller clients
AnswerA

A longer deadline ensures that messages are not redelivered before processing completes, reducing duplicates.

Why this answer

Pub/Sub redelivers messages if the acknowledgement deadline expires before the subscriber acknowledges. Setting a longer acknowledgement deadline (e.g., 60 seconds) gives the subscriber more time to process and acknowledge, reducing duplicates. Flow control limits outstanding messages but does not prevent duplicates.

Using ordering keys ensures order but can increase duplicates due to head-of-line blocking. Increasing the number of pullers increases throughput but not directly reduce duplicates.

429
MCQhard

A global gaming company uses Cloud Spanner for player profiles and game state. The schema includes a table 'PlayerStats' with a primary key (PlayerId, GameId, Timestamp). The table stores millions of rows per player. The application frequently runs a query to fetch the most recent stats for a given player across all games, using ORDER BY Timestamp DESC LIMIT 10. This query is slow, taking several seconds. The team adds a secondary index on (PlayerId, Timestamp) but still sees high CPU usage and latency. They need to redesign the schema to optimize this query without changing the application logic significantly. What should they do?

A.Migrate the PlayerStats table to Cloud Bigtable for better time-series performance.
B.Change the primary key to (PlayerId, Timestamp, GameId) and drop the secondary index.
C.Create a stored procedure that aggregates data per player and caches results.
D.Add a materialized view that pre-computes the latest stats per player.
AnswerB

This allows efficient range scans for a player’s stats ordered by time.

Why this answer

The correct answer. By reordering the primary key to (PlayerId, Timestamp, GameId), Spanner can efficiently perform a range scan for a given PlayerId with results sorted by Timestamp because the primary key order determines the storage order. This eliminates the need for a secondary index and reduces CPU usage and latency.

Option A is incorrect because migrating to Bigtable is a different database technology and not a schema redesign. Option C is incorrect because stored procedures are not a schema change and may not integrate well with the existing application logic. Option D is incorrect because Spanner does not natively support materialized views.

430
Multi-Selectmedium

An organization is migrating a large on-premises MySQL database to Cloud SQL using DMS. They want to minimize downtime. Which TWO configurations should they implement? (Choose 2)

Select 2 answers
A.Enable continuous migration with CDC.
B.Use parallel dump in the migration job.
C.Disable binary logging on the source.
D.Use a one-time migration job.
E.Use mysqldump and import manually.
AnswersA, B

Allows ongoing replication, reducing downtime.

Why this answer

Continuous migration enables CDC. Parallel dump speeds up the initial sync.

431
MCQeasy

What is the maximum backup retention period for Cloud Spanner backups?

A.365 days
B.730 days
C.90 days
D.30 days
AnswerA

Correct: maximum retention is 365 days.

Why this answer

Cloud Spanner allows backups to be retained for up to 365 days.

432
MCQmedium

A company is migrating a 10 TB Teradata data warehouse to BigQuery. They need to convert Teradata DDL and BTEQ scripts to BigQuery SQL. Which Google Cloud service should they use?

A.BigQuery Data Transfer Service
B.Database Migration Service (DMS)
C.Schema Conversion Tool (SCTS)
D.gcloud bigquery load
AnswerC

The Schema Conversion Tool (SCTS) automates the translation of Teradata DDL and BTEQ scripts into BigQuery-compatible SQL, directly addressing the 10 TB migration volume by eliminating manual script rewriting. Its parser maps Teradata-specific syntax—such as `CREATE SET TABLE` and `QUALIFY`—to BigQuery equivalents, satisfying the constraint of converting legacy ETL logic without requiring intermediate staging.

Why this answer

Schema Conversion Tool (SCTS) is designed to convert DDL and SQL scripts from sources like Teradata to BigQuery-compatible format.

433
MCQmedium

An engineer is configuring a Cloud Build trigger for a Java application. The build step uses Maven to compile and test, then builds a Docker image. Which cloudbuild.yaml step configuration is CORRECT for specifying the Maven command?

A.steps: - name: 'maven:3' args: ['mvn', 'clean', 'package']
B.steps: - name: 'maven:3' entrypoint: 'bash' args: ['mvn', 'clean', 'package']
C.steps: - name: 'maven:3' script: 'mvn clean package'
D.steps: - name: 'maven:3' entrypoint: 'mvn' args: ['clean', 'package']
AnswerD

Correct: by setting entrypoint: 'mvn' and args: ['clean', 'package'], the step runs 'mvn clean package' as intended.

Why this answer

The official Maven Docker image (maven:3) has 'mvn' as its default entrypoint. Therefore, args provided are passed directly to mvn. Option A adds 'mvn' in args, resulting in the command 'mvn mvn clean package', which is invalid.

Option D correctly sets entrypoint to 'mvn' and args to ['clean', 'package'], producing the intended 'mvn clean package'. Option B uses bash as entrypoint, which would treat the args as a bash script, likely resulting in an error. Option C uses a nonexistent 'script' field in cloudbuild.yaml steps.

Exam trap

Candidates often assume the maven:3 image's default entrypoint is a shell, leading them to include the command in args. In reality, the default entrypoint is 'mvn', so args should only contain mvn arguments. The correct approach is to either set entrypoint: 'mvn' with args: ['clean', 'package'], or rely on the default entrypoint and use args: ['clean', 'package'] (without 'mvn').

How to eliminate wrong answers

Option B is wrong because it overrides the default entrypoint with `bash`, which would interpret `args: ['mvn', 'clean', 'package']` as a command to run a script named `mvn` rather than the Maven binary, causing a failure. Option C is wrong because the `script` field is not a valid field in `cloudbuild.yaml`; Cloud Build uses `args` or `entrypoint` with `args` to specify commands. Option D is wrong because it redundantly sets `entrypoint: 'mvn'` when the image already uses `mvn` as the default entrypoint, and the `args` array omits the `mvn` command itself, resulting in only `['clean', 'package']` being passed as arguments to `mvn`, which would fail as `mvn clean package` expects the `mvn` binary to be invoked first.

434
MCQhard

A gaming company uses Cloud Bigtable for player state data with two clusters in different regions (us-central1 and us-west1) for disaster recovery. They need to ensure that read traffic automatically fails over to the secondary cluster if the primary cluster becomes unhealthy. They currently have a weighted DNS routing policy. Which additional configuration is required?

A.Use a Cloud DNS health check that updates a routing policy in Bigtable
B.Set the Bigtable cluster routing policy to 'read-failover'
C.Enable multi-cluster routing by setting 'any-replica' policy
D.Configure a Cloud Load Balancer with a backend service pointing to the Bigtable clusters
AnswerB

The read-failover routing policy ensures that if the primary cluster is unhealthy, reads are automatically directed to the next healthy cluster.

Why this answer

Cloud Bigtable with multi-cluster replication can use routing policies. The 'read-failover' routing policy directs reads to the nearest healthy cluster. To handle unhealthy clusters, you can use Cloud DNS with a health check that updates the routing policy, but the simplest approach is to configure the Bigtable routing policy to 'read-failover'.

This policy automatically shifts reads away from unhealthy clusters.

435
MCQmedium

Refer to the exhibit. You receive an alert from this policy for a Cloud Spanner instance. Which action should you take first?

A.Identify and remove unused indexes
B.Add more nodes to the instance
C.Review the top queries by CPU usage in the Spanner console
D.Split large tables into smaller ones
AnswerB

Directly reduces per-node CPU utilization.

Why this answer

The alert from the policy indicates that the Cloud Spanner instance is experiencing high CPU utilization, which is a sign of resource saturation. Adding more nodes increases the total compute and I/O capacity of the instance, directly alleviating the CPU bottleneck and improving throughput. This is the first and most immediate corrective action because Spanner's performance scales linearly with nodes, and other optimizations (like index or query tuning) are secondary to ensuring sufficient capacity.

Exam trap

Google PCDE often tests the misconception that query optimization or schema changes are the first step to resolve performance alerts, when in fact capacity scaling (adding nodes) is the immediate corrective action for resource saturation in a managed service like Cloud Spanner.

How to eliminate wrong answers

Option A is wrong because removing unused indexes can reduce storage and write overhead, but it does not directly address high CPU usage caused by insufficient node capacity; indexes are a query optimization tool, not a scaling solution. Option C is wrong because reviewing top queries by CPU usage is a diagnostic step that helps identify inefficient queries, but it is not the first action to take when the instance is already saturated—capacity must be added first to prevent further performance degradation. Option D is wrong because splitting large tables into smaller ones can improve query performance and reduce hotspots, but it does not increase the overall CPU capacity of the instance; node scaling is the primary mechanism for handling sustained high CPU load.

436
MCQhard

Refer to the exhibit. A data engineer created a materialized view on a table that receives streaming inserts. When they query the materialized view, they get this error. What is the most likely cause?

A.The materialized view definition includes a JOIN that is not supported.
B.The materialized view has reached its maximum size limit.
C.The materialized view cannot read data from the streaming buffer.
D.The base table has a schema change that the materialized view cannot adapt to.
AnswerC

Materialized views require data to be committed; streaming buffer data is not yet readable by materialized views.

Why this answer

The error occurs because materialized views in BigQuery cannot directly read data from the streaming buffer. When a base table receives streaming inserts, the data resides in the streaming buffer for up to 90 minutes before being committed to storage. Materialized views only reflect committed data, so querying them during this window returns an error indicating that the view cannot access the streaming buffer.

Exam trap

Google Cloud often tests the misconception that materialized views can access all data in the base table immediately, including uncommitted streaming data, when in reality they only reflect committed data and cannot read from the streaming buffer.

How to eliminate wrong answers

Option A is wrong because materialized views in BigQuery support JOINs, including with other materialized views, as long as they meet the documented limitations (e.g., no self-joins, no cross-join of non-partitioned tables). Option B is wrong because materialized views in BigQuery do not have a fixed maximum size limit; they are managed storage objects that scale with the underlying base table. Option D is wrong because schema changes to the base table (e.g., adding or dropping columns) are automatically propagated to the materialized view, and the view will adapt as long as the change does not break the view definition (e.g., dropping a column used in the SELECT list).

437
MCQeasy

A startup is building a mobile app backend with high-concurrency user authentication and profile updates. They need strong consistency and ACID transactions. Which database service should they choose?

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

Cloud SQL (MySQL/PostgreSQL) supports ACID, strong consistency, and high concurrency for OLTP.

Why this answer

Cloud SQL provides fully managed relational databases with ACID compliance, suitable for high-concurrency OLTP workloads like user authentication and profile updates.

438
Multi-Selectmedium

You are designing a Spanner schema for a global inventory system. The table Products has primary key (ProductId STRING). The table Inventory has primary key (ProductId STRING, WarehouseId INT64) and is interleaved in Products. You expect high write throughput on Inventory. Which TWO design choices will help avoid hotspots?

Select 2 answers
A.Use UUID for ProductId
B.Use a hash prefix of ProductId as the first key part in Inventory
C.Reverse the timestamp in the row key
D.Use a monotonically increasing sequence for ProductId
E.Create a secondary index on WarehouseId with STORING
AnswersA, B

UUIDs are random and help distribute writes.

Why this answer

To avoid hotspots in Spanner, avoid monotonically increasing keys. ProductId should be a UUID or hash. Also, using a hash prefix on ProductId as the first part of the key can help distribute writes.

Interleaving is fine. Secondary indexes with STORING are for reads. Reverse timestamps are for Bigtable.

The correct choices are using UUID and adding a hash prefix.

439
MCQeasy

A company runs a BigQuery data warehouse. They notice that query performance has degraded over time. The data is loaded daily from Cloud Storage using batch loads. Which action is most likely to improve query performance?

A.Partition and cluster tables based on common query filters.
B.Increase the number of slots in the reservation.
C.Create materialized views for all frequent queries.
D.Migrate the data to Cloud SQL for better performance.
AnswerA

Partitioning and clustering reduce data scanned, improving performance.

Why this answer

Partitioning and clustering tables based on common query filters directly reduces the amount of data scanned per query by organizing data into physical segments. In BigQuery, this allows the query engine to prune entire partitions and clusters, significantly lowering I/O and improving performance without additional cost or complexity.

Exam trap

Google Cloud often tests the misconception that adding more compute resources (slots) is the default fix for slow queries, when in reality data organization techniques like partitioning and clustering are the first-line optimization for scan-heavy workloads.

How to eliminate wrong answers

Option B is wrong because increasing slot count only addresses concurrency and resource contention, not the root cause of performance degradation from growing data volumes and unoptimized table structures. Option C is wrong because materialized views add storage and maintenance overhead, and while they can speed up specific queries, they do not fix the underlying issue of full table scans on the base tables. Option D is wrong because Cloud SQL is a relational OLTP database not designed for analytical workloads; migrating there would likely worsen performance and increase latency for large-scale aggregation queries.

440
MCQmedium

During cutover of a Database Migration Service continuous migration job, the engineer observes that the source database still receives writes after promoting the destination Cloud SQL instance. What should the engineer do to complete the migration?

A.Adjust the DMS job to ignore further changes.
B.Promote the destination again; this will force a stop of writes.
C.Stop the application that writes to the source, then confirm DMS lag is zero before promoting.
D.Delete the source database to force the cutover.
AnswerC

Proper cutover sequence: quiesce writes, verify lag is zero, promote destination, then update connection strings.

Why this answer

Cutover requires quiescing writes to the source to ensure no new changes are generated. The application should be stopped or switched to read-only first.

441
MCQeasy

A data warehouse in BigQuery stores event logs with nested and repeated fields (e.g., page views within a session). Which schema type is optimal for storing this data?

A.Use RECORD type columns for each nested level
B.Normalize into separate tables and join
C.Use ARRAY<STRUCT<...>> columns for nested repeated data
D.Store as JSON strings and parse at query time
AnswerC

Arrays of structs are the native way to represent nested repeated data in BigQuery.

Why this answer

Using ARRAY<STRUCT<...>> columns allows storing nested repeated data natively in BigQuery, enabling efficient querying without joins. Option A (RECORD type columns) is a legacy approach not optimized for repeated data; arrays of structs are preferred. Option B (normalizing into separate tables) would require costly joins.

Option D (storing as JSON strings) loses schema enforcement and query performance.

442
Drag & Dropmedium

Arrange the steps to import data from Cloud Storage into Cloud Firestore using a managed import.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

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

Why this order

Import needs properly formatted files; use gcloud command, then monitor and verify.

443
MCQeasy

Your company runs a global e-commerce platform on Google Cloud Spanner. The database schema includes an 'Orders' table with primary key (OrderId, CustomerId) and an 'OrderItems' table with primary key (OrderId, CustomerId, ItemId), interleaved in parent Orders on delete cascade. During peak shopping hours, you notice that queries retrieving all items for a specific order are performing full table scans on the OrderItems table, leading to increased latency and higher CPU utilization. The queries use the OrderId as the filter condition. The database administrators have already checked that the query plans show table scans instead of using the interleaved index. You are tasked with resolving this performance issue. Which of the following actions should you take?

A.Remove CustomerId from the Orders primary key (making it just OrderId) and update OrderItems to have primary key (OrderId, ItemId), maintaining interleaving.
B.Change the primary key of Orders to (OrderId, CustomerId) and update OrderItems accordingly.
C.Create a secondary index on OrderItems(OrderId).
D.Increase the number of Spanner nodes to improve throughput.
AnswerA

This allows efficient lookup using only OrderId and leverages interleaving.

Why this answer

The interleaved index in Cloud Spanner requires that the parent table's primary key columns be a prefix of the child table's primary key. With the original schema, queries filtering only on OrderId cannot use the interleaved index because CustomerId is missing from the filter, forcing a full table scan. By removing CustomerId from the primary key of Orders and OrderItems, OrderId becomes the leading column, allowing the interleaved index to be used for efficient point lookups.

Exam trap

Google Cloud often tests the misconception that secondary indexes are the default fix for query performance issues, when in fact the schema design—specifically the primary key structure for interleaved tables—is the root cause and must be corrected first.

How to eliminate wrong answers

Option B is wrong because it keeps CustomerId in the primary key, which does not fix the issue—queries filtering only on OrderId still cannot use the interleaved index. Option C is wrong because creating a secondary index on OrderItems(OrderId) would add storage and write overhead, and while it could help, it is not the optimal solution; the correct fix is to adjust the primary key to leverage the interleaved index directly. Option D is wrong because increasing Spanner nodes improves throughput but does not address the root cause of full table scans caused by an inefficient schema design.

444
Multi-Selectmedium

You are building a dashboard in Cloud Monitoring to display CPU utilization of Compute Engine instances. Which TWO chart types are appropriate for showing trends over time? (Select 2)

Select 2 answers
A.Stacked bar
B.Line
C.Scatter
D.Scorecard
E.Heatmap
AnswersA, B

Stacked bar charts can show contributions over time.

Why this answer

Line charts and stacked bar charts are commonly used to show trends over time. Heatmaps show distributions, scatter plots show correlations, and scorecards show a single value.

445
MCQhard

Your company runs a global gaming platform using Cloud Spanner as the backend database. The platform has millions of users who play concurrently. You receive reports that during peak hours (7-10 PM UTC), some users experience 'DEADLINE_EXCEEDED' errors and high latency on write operations. You have already verified that there are no hot keys and that the schema uses primary keys with hash prefixes. Monitoring shows CPU utilization averages 60% but spikes to 80% during the peak. The average commit latency is 50ms during peak, and the transaction rate is 10,000 writes per second. The instance currently has 100 nodes. The application team indicates that writes are primarily player score updates. What should you do to resolve the performance issue?

A.Enable Fine-Grained Latency & Replication (FLLR) to improve write latency.
B.Disable client-side buffering for write operations.
C.Increase the number of Spanner nodes to 150.
D.Reduce the size of write transactions by batching fewer mutations per transaction.
AnswerC

More nodes add capacity, reducing CPU pressure and latency.

Why this answer

Increasing the number of Spanner nodes from 100 to 150 directly adds more compute and storage capacity, reducing CPU utilization from the 80% spike and lowering write latency. The 60-80% CPU range with 50ms commit latency indicates the instance is nearing its throughput limit, and adding nodes distributes the write load (10,000 writes/sec) more evenly, alleviating 'DEADLINE_EXCEEDED' errors without requiring schema or application changes.

Exam trap

Google Cloud often tests the misconception that reducing transaction size or disabling buffering always improves performance, but in Spanner, CPU saturation from high write throughput is best resolved by horizontal scaling (adding nodes), not by reducing batch sizes or tweaking client settings.

How to eliminate wrong answers

Option A is wrong because Fine-Grained Latency & Replication (FLLR) is a feature for reducing read latency by placing replicas closer to users, not for improving write throughput or CPU-bound write latency; writes still require a quorum across all replicas. Option B is wrong because disabling client-side buffering would increase the number of round trips and likely worsen latency, as buffering helps batch writes and reduce overhead; the issue is server-side CPU saturation, not client-side batching. Option D is wrong because reducing transaction size by batching fewer mutations per transaction would increase the total number of transactions, potentially raising CPU overhead and commit latency further, and the current 50ms commit latency is already high for small score updates.

446
MCQhard

A migration from Oracle to PostgreSQL using Ora2Pg is complete. The team wants to run unit tests on the converted stored procedures to ensure they produce correct results. Which tool is most suitable for this purpose?

A.pgTAP
B.pgAdmin
C.pg_dump
D.pg_stat_statements
AnswerA

pgTAP is the standard unit testing framework for PostgreSQL.

Why this answer

pgTAP is a unit testing framework for PostgreSQL that allows writing tests for functions, procedures, and other database objects. It is commonly used to validate converted PL/pgSQL code.

447
MCQhard

An SRE team implements error budget alerting using Cloud Monitoring. They want to set a 'fast burn' alert that triggers when the error budget burn rate exceeds 14x over a 1-hour window. What is the purpose of this alert?

A.To detect gradual, long-term trends in error budget consumption
B.To alert when the error budget is completely exhausted
C.To alert immediately when error budget is being consumed at a rate that would exhaust the budget in approximately 51 hours (14x faster than allowed)
D.To trigger a page for on-call engineers when the service is likely to exceed SLO within the next 6 hours
AnswerC

Correct: 14x burn rate means the budget would be consumed in (30 days / 14) ≈ 51 hours. Fast burn alerts trigger within 1 hour.

Why this answer

Fast burn alerts (e.g., 14x burn rate over 1h) are designed to detect severe, rapid consumption of error budget, prompting immediate investigation. They complement slow burn alerts (5x over 6h) which catch gradual budget erosion.

448
MCQmedium

A company wants to set up an alert that fires if any Compute Engine instance has a CPU utilization above 80% for more than 5 minutes. They have thousands of instances. Which alerting condition type and configuration is most efficient?

A.Use a logs-based alert on CPU logs
B.Use a metric-threshold condition with resource group filter set to 'gce_instance' and a threshold of 80%
C.Create a separate alert for each instance using instance-specific conditions
D.Use a metric-absent condition to detect when CPU metric stops reporting
AnswerB

A single alert can monitor all instances by using a resource group filter.

Why this answer

A metric-threshold condition using a policy with multiple conditions (one per instance) would be cumbersome. Instead, use a grouped alert with a threshold on the metric and apply to all instances via a monitored resource filter.

449
MCQhard

You are managing a Memorystore for Redis cluster with standard tier (persistence disabled). The application experiences occasional latency spikes while performing SET operations. You observe that the 'evicted_keys' metric spikes during the spikes. What is the most effective solution?

A.Enable AOF persistence with fsync every second
B.Change the maxmemory-policy to 'volatile-lru'
C.Increase the maximum memory size of the instance
D.Configure a read replica to offload read traffic
AnswerC

More memory reduces evictions, stabilizing write latency.

Why this answer

The evicted_keys metric spikes during SET operations indicate that the Redis instance has reached its maxmemory limit and is evicting keys to accommodate new writes. Increasing the maximum memory size directly addresses the root cause by providing more headroom for data, reducing the need for eviction and the associated latency spikes.

Exam trap

Google Cloud often tests the misconception that changing the eviction policy (Option B) solves memory pressure, when in fact the policy only controls which keys are evicted, not whether eviction occurs at all.

How to eliminate wrong answers

Option A is wrong because enabling AOF persistence with fsync every second adds disk I/O overhead, which can increase latency rather than reduce it, and does not address the memory pressure causing evictions. Option B is wrong because changing the maxmemory-policy to 'volatile-lru' only affects which keys are evicted (those with TTL set), but does not prevent evictions from occurring when memory is full; the problem is insufficient memory, not the eviction policy. Option D is wrong because configuring a read replica offloads read traffic, but the latency spikes occur during SET (write) operations, and replicas do not handle writes; this does not reduce memory pressure on the primary instance.

450
MCQmedium

An engineer is configuring a cloudbuild.yaml file. They want two build steps (unit tests and linting) to run simultaneously, and after both complete, a third step (package) should run. How should they configure waitFor in the package step?

A.Set waitFor: ['-'] on the unit tests and linting steps, and waitFor: ['unit-tests', 'linting'] on the package step.
B.Do not set waitFor on any step.
C.Set waitFor: ['-'] on the package step.
D.Set waitFor: ['unit-tests', 'linting'] on all three steps.
AnswerA

This correctly runs unit tests and linting in parallel, then package after both complete.

Why this answer

In Cloud Build, steps run sequentially by default. To run unit tests and linting in parallel, you set `waitFor: ['-']` on each of those steps, which tells Cloud Build they have no dependencies and can start immediately. Then, setting `waitFor: ['unit-tests', 'linting']` on the package step ensures it only runs after both parallel steps have completed successfully.

Exam trap

Google Cloud often tests the misconception that `waitFor: ['-']` is used to make a step wait for nothing, but candidates confuse it with making a step wait for all previous steps, or they think omitting `waitFor` enables parallelism.

How to eliminate wrong answers

Option B is wrong because if you do not set `waitFor` on any step, all steps will run sequentially in the order they are defined, not in parallel. Option C is wrong because setting `waitFor: ['-']` on the package step would cause it to start immediately, without waiting for the unit tests and linting steps to finish. Option D is wrong because setting `waitFor: ['unit-tests', 'linting']` on all three steps would create a circular dependency (each step waiting for the other two), causing the build to hang or fail.

Page 5

Page 6 of 20

Page 7