Courseiva

Google Professional Cloud Developer (PCD) — Questions 226300

964 questions total · 13pages · All types, answers revealed

Page 3

Page 4 of 13

Page 5
226
MCQmedium

An organization is migrating from Amazon Redshift to BigQuery. They have large datasets stored in Amazon S3. What is the most efficient method to migrate the data?

A.Create a VPN between AWS and GCP and use federated query in BigQuery to read from Redshift directly.
B.Use Cloud Data Fusion to read from Redshift directly and write to BigQuery.
C.Use AWS Database Migration Service (DMS) to replicate data to Cloud SQL and then use BigQuery federated query.
D.Export Redshift data to S3, copy to Cloud Storage using Storage Transfer Service, then load into BigQuery.
AnswerD

This is efficient and leverages Google's transfer services.

Why this answer

The recommended approach is to export Redshift data to S3, then use BigQuery Data Transfer Service for Redshift to load data directly into BigQuery, or use Cloud Storage as intermediate. The most efficient is to use the BigQuery Data Transfer Service which can read from S3 directly (via a transfer config) or use Cloud Storage as a staging area.

227
MCQmedium

A financial services company is building a global payment system that requires strong ACID transactions across multiple regions, with 99.999% availability and automatic failover. Which Google Cloud database should they choose?

A.Cloud Spanner
B.AlloyDB with cross-region replicas
C.Cloud SQL with cross-region replicas
D.Firestore in Native mode
AnswerA

Spanner provides global ACID transactions, 99.999% SLA, and automatic failover across regions.

Why this answer

Cloud Spanner is the only Google Cloud database that provides strong ACID transactions across multiple regions with 99.999% availability and automatic failover. It uses a globally distributed architecture with synchronous replication and the TrueTime API to ensure external consistency, making it ideal for a global payment system that requires strict consistency and high availability.

Exam trap

Google often tests the misconception that cross-region replicas in relational databases like AlloyDB or Cloud SQL can provide strong ACID transactions and 99.999% availability, but these solutions use asynchronous replication and lack the global consistency and automatic failover capabilities of Cloud Spanner.

How to eliminate wrong answers

Option B is wrong because AlloyDB with cross-region replicas uses asynchronous replication, which cannot guarantee strong ACID transactions across regions and may lead to data inconsistency during failover. Option C is wrong because Cloud SQL with cross-region replicas also relies on asynchronous replication and does not provide automatic failover with 99.999% availability; it is designed for regional rather than global deployments. Option D is wrong because Firestore in Native mode is a NoSQL database that does not support strong ACID transactions across multiple regions; it offers eventual consistency for multi-region configurations, which is unsuitable for a payment system requiring strict transactional guarantees.

228
MCQmedium

A team is migrating a Teradata data warehouse to BigQuery using the BigQuery Data Transfer Service. They need to schedule regular incremental transfers. What is the correct configuration for the transfer?

A.Export Teradata data to Cloud Storage and use BigQuery load jobs scheduled via Cloud Scheduler.
B.Use Cloud Data Fusion to create a batch pipeline from Teradata to BigQuery.
C.Create a transfer config with source type 'Teradata', target dataset, and schedule frequency.
D.Use a BigQuery scheduled query to SELECT * FROM Teradata via federated query.
AnswerC

This is the correct way to set up periodic incremental transfers from Teradata to BigQuery.

Why this answer

BigQuery Data Transfer Service for Teradata supports scheduled transfers. The correct setup is to configure a transfer config with a schedule (e.g., daily) and specify the dataset and table mappings. The service handles incremental loads based on a watermark column.

229
MCQeasy

A development team is using Cloud Monitoring to set up an alerting policy for a Compute Engine instance. They want to be notified when the instance's CPU utilization exceeds 80% for at least 5 minutes. Which alerting policy configuration should they use?

A.Condition type: Metric Threshold, Trigger: For 5 minutes, Threshold: 80%
B.Condition type: Metric Threshold, Trigger: For most recent value, Threshold: 80%
C.Condition type: Change Rate, Trigger: For 5 minutes, Threshold: 80%
D.Condition type: Metric Absence, Duration: 5 minutes
AnswerA

Triggers when condition holds for 5 minutes.

Why this answer

Cloud Monitoring alerting policies use a Metric Threshold condition type to evaluate a metric against a static threshold. Setting the trigger to 'For 5 minutes' ensures the condition is met only when the CPU utilization exceeds 80% consistently over the specified duration, preventing false alarms from transient spikes.

Exam trap

The PCD exam often tests the distinction between 'For most recent value' and 'For X minutes' triggers, where candidates mistakenly choose the single-point trigger thinking it's simpler, missing the requirement for sustained threshold crossing.

How to eliminate wrong answers

Option B is wrong because 'For most recent value' triggers an alert based on a single data point, which would fire on any momentary spike above 80% rather than requiring sustained high utilization for 5 minutes. Option C is wrong because 'Change Rate' condition type measures the rate of change of a metric over time, not a static threshold; it is used for detecting anomalies in trends, not for fixed CPU utilization limits. Option D is wrong because 'Metric Absence' condition type triggers when data is missing for a specified duration, not when a metric exceeds a threshold; it is designed for detecting data gaps, not high CPU usage.

230
Multi-Selecteasy

A company needs to store and analyze large amounts of log data with flexible schema and support for real-time analytics. They want to use a fully managed, serverless solution. Which THREE Google Cloud services could meet their needs? (Choose three.)

Select 3 answers
A.Cloud Logging
B.Cloud SQL for PostgreSQL
C.Firestore
D.Cloud Spanner
E.BigQuery
AnswersA, C, E

Cloud Logging is a fully managed service for storing and querying log data.

Why this answer

BigQuery is a serverless data warehouse ideal for analyzing large volumes of log data with SQL-based analytics. Cloud Logging is a fully managed service for storing, querying, and analyzing log data in real time. Firestore is a serverless NoSQL document database with flexible schema and real-time listeners, suitable for storing semi-structured log data and enabling real-time dashboards.

Cloud SQL for PostgreSQL is relational and not serverless, making it less suitable for log analytics. Cloud Spanner is a globally distributed relational database but is not serverless and is overkill for log storage and analysis. Therefore, the correct combination is Cloud Logging (A), Firestore (C), and BigQuery (E).

231
Multi-Selectmedium

Which TWO Google Cloud services can be used to build a data pipeline that transforms and moves data between different databases? (Select 2)

Select 2 answers
A.Dataflow
B.Cloud Scheduler
C.Dataproc
D.Memorystore
E.Cloud SQL Proxy
AnswersA, C

Dataflow can perform complex transformations between databases.

Why this answer

Dataflow is a serverless, fully managed service for executing Apache Beam pipelines, which can read from and write to various databases (e.g., Cloud Spanner, BigQuery, Cloud SQL) while performing transformations in a unified streaming or batch model. It is specifically designed for data movement and transformation between different data sources and sinks, making it a correct choice for building a data pipeline that transforms and moves data between databases.

Exam trap

Candidates often confuse services that are purely for connectivity or scheduling (Cloud Scheduler, Cloud SQL Proxy) with actual data processing engines (Dataflow, Dataproc). They mistakenly select Cloud SQL Proxy thinking it moves data because it 'connects' databases.

232
Multi-Selectmedium

A company is using Cloud Run for a stateless API. They want to ensure that the service can handle sudden traffic spikes. Which two features should they configure?

Select 2 answers
A.Enable container concurrency.
B.Use Cloud Load Balancing.
C.Enable CPU always on allocation.
D.Set max instances to a high value.
E.Set min instances to zero to save cost.
AnswersA, D

Container concurrency allows multiple requests per container, increasing throughput.

Why this answer

Enabling container concurrency allows a single Cloud Run container instance to handle multiple requests simultaneously, up to the configured concurrency limit (default 80, max 1000). This improves throughput and resource utilization during traffic spikes without requiring additional instances. Option D is correct because setting max instances to a high value ensures the service can scale out to handle sudden load by creating more container instances, up to the configured maximum, preventing cold starts and request queuing.

Exam trap

The PCD exam often tests the misconception that Cloud Load Balancing is required for scaling Cloud Run, but Cloud Run's built-in autoscaling and managed HTTPS load balancer already handle traffic spikes; the trap is that candidates confuse external load balancing with internal scaling mechanisms.

233
MCQeasy

A startup is building a REST API on Cloud Run. They expect unpredictable traffic spikes and want to ensure the service can scale from 0 to many instances automatically. What scaling configuration should they use?

A.Set max instances to 1 to control costs.
B.Set min instances to 0 and max instances to 1000.
C.Use manual scaling with a fixed number of instances.
D.Set min instances to 5 and max to 100.
AnswerB

This configuration allows the service to scale from zero to a high number as needed, handling spikes while minimizing cost during idle periods.

Why this answer

Cloud Run's autoscaling allows min instances to be set to 0, enabling the service to scale down to zero when idle (cost-efficient), and max instances to 1000 to handle unpredictable traffic spikes by scaling out horizontally. This configuration ensures the service can start from zero and automatically add instances up to the maximum limit as demand increases, which is ideal for unpredictable workloads.

Exam trap

The trap here is that candidates often confuse 'min instances' with 'max instances' or assume that setting min instances to 0 will cause the service to be unavailable during cold starts, but Cloud Run handles cold starts transparently, and the question specifically asks for scaling from 0 to many instances, which requires min=0 and a high max limit.

How to eliminate wrong answers

Option A is wrong because setting max instances to 1 prevents the service from scaling out beyond a single instance, which cannot handle traffic spikes and defeats the purpose of autoscaling. Option C is wrong because manual scaling with a fixed number of instances does not allow dynamic scaling from 0 or to many instances; it requires manual intervention to adjust capacity, which is unsuitable for unpredictable spikes. Option D is wrong because setting min instances to 5 forces at least 5 instances to run continuously, incurring cost even when there is no traffic, and does not allow scaling down to zero, which contradicts the requirement to scale from 0.

234
Multi-Selectmedium

A developer is building a serverless application that processes user-uploaded images. The images are stored in Cloud Storage, and each upload should trigger a Cloud Function that performs image analysis and stores the result in Firestore. Which TWO Google Cloud services are essential for this integration? (Choose 2)

Select 2 answers
A.Cloud Pub/Sub
B.Cloud Storage
C.Cloud Tasks
D.Eventarc
E.Cloud Scheduler
AnswersA, B

Cloud Pub/Sub receives storage notifications and triggers the Cloud Function.

Why this answer

Cloud Storage is the source of events (uploaded images). Cloud Pub/Sub is used to deliver notifications from Cloud Storage to the Cloud Function. Cloud Tasks, Cloud Scheduler, and Eventarc are not required for this pattern.

235
Multi-Selectmedium

Which THREE of the following are best practices for building secure applications on Google Cloud?

Select 3 answers
A.Use Secret Manager to manage sensitive configuration values.
B.Disable authentication on a test Cloud Run service for end-user testing.
C.Use a single service account for all Cloud Functions to simplify permissions.
D.Enable VPC Service Controls to prevent data exfiltration.
E.Store source code in Cloud Source Repositories with IAM restrictions.
AnswersA, D, E

Secret Manager securely stores and accesses secrets.

Why this answer

Secret Manager provides a centralized and secure way to store and manage sensitive configuration values such as API keys, database passwords, and certificates. By using Secret Manager, you avoid hardcoding secrets in source code or configuration files, reducing the risk of exposure. It integrates with IAM for fine-grained access control and supports automatic rotation, ensuring that secrets are protected at rest and in transit.

Exam trap

The PCD exam often tests the principle of least privilege and the misconception that simplifying permissions by using a single service account is acceptable, when in fact it creates a single point of failure and broad attack surface.

236
Multi-Selecthard

A company is deploying a microservices architecture on Google Cloud using Cloud Run. They need to ensure that services can communicate securely with each other and with other Google Cloud services, such as Cloud Storage and Secret Manager. Which three steps should they take? (Choose three.)

Select 3 answers
A.Enable Cloud Service Mesh for sidecar proxy injection.
B.Configure Cloud Run services to use internal load balancing.
C.Use Cloud Run's direct VPC egress to access resources in a VPC network.
D.Use service accounts with least privilege permissions for each service.
E.Enable VPC Connector for each Cloud Run service.
AnswersC, D, E

Direct VPC egress allows Cloud Run services to send traffic to VPC networks.

Why this answer

To securely communicate with other Google Cloud services like Cloud Storage and Secret Manager, Cloud Run services can use direct VPC egress to route traffic through your VPC. Additionally, to access resources in a VPC, you can use a VPC connector. Using service accounts with least privilege ensures secure access control.

These three steps together provide secure communication.

Exam trap

The trap in this question is that candidates may believe only one method (direct VPC egress or VPC connector) is correct, but on Google Cloud both are valid options for achieving secure communication with VPC resources. Additionally, candidates might mistakenly think that sidecar proxies (Cloud Service Mesh) or internal load balancing are required for secure communication between Cloud Run services and other Google Cloud services.

237
MCQeasy

During a rolling update, the new pods are failing to start because they require more memory than available on nodes. What is the most likely cause?

A.The maxSurge value is too low.
B.The resource requests and limits are misconfigured.
C.The replicas count is too high.
D.The strategy type is wrong.
AnswerB

The requests are too high for the available node memory, causing the new pods to fail to schedule.

Why this answer

The most likely cause of pods failing to start due to insufficient memory is misconfigured resource requests and limits. If the memory request (spec.containers[].resources.requests.memory) is set too high, the scheduler cannot find a node with enough allocatable memory, leaving pods in a Pending state. Similarly, if the limit is set too low, the pod may be OOMKilled after starting, but the question specifically states 'failing to start,' pointing to a scheduling failure due to requests exceeding node capacity.

Exam trap

A common pitfall in Kubernetes rolling updates is confusing resource requests (used for scheduling) with limits (used for enforcement). Candidates often attribute the failure to a high replicas count or an insufficient maxSurge value, but the actual issue is that the pod's memory request exceeds the available capacity on any node in the cluster.

How to eliminate wrong answers

Option A is wrong because maxSurge controls how many extra pods can be created above the desired replicas during a rolling update; a low maxSurge might slow the rollout but does not cause pods to fail starting due to memory constraints. Option C is wrong because the replicas count being too high would affect the total number of pods, but the issue is per-pod memory requirements, not the count; the scheduler would still attempt to place each pod individually. Option D is wrong because the strategy type (RollingUpdate vs.

Recreate) affects how pods are replaced, not the resource requirements of the new pods; a wrong strategy type would not cause memory-related startup failures.

238
MCQeasy

A team is planning to migrate a 500 GB MySQL database to Cloud SQL. The application can tolerate up to 2 hours of downtime. Which migration method should they choose?

A.Use mysqldump to export and import manually.
B.Use Cloud SQL replication to set up a read replica, then promote.
C.Use a one-time migration job with Database Migration Service.
D.Use Database Migration Service with a continuous migration job.
AnswerC

A one-time migration is appropriate given the 2-hour downtime tolerance and moderate size.

Why this answer

For a 500 GB database with a 2-hour downtime window, a one-time migration (offline) is sufficient because the dump and restore can complete within the window. Continuous migration is used for minimal downtime but adds complexity. Database Migration Service supports both one-time and continuous jobs.

239
MCQmedium

A startup is building a mobile app with Firestore. They need to ensure that only authenticated users can read and write their own data. Which Firestore security rule pattern should they use?

A.Allow read/write if request.auth != null
B.Allow read/write only if the document path contains the user's uid
C.Allow read/write if resource.data.userId == request.auth.uid
D.Allow read/write only if request.resource.data.userId == request.auth.uid
AnswerC

This rule ensures that users can only read/write documents where the userId field matches their uid.

Why this answer

Using request.auth.uid to match the document owner ensures users can only access their own data.

240
MCQmedium

A company is deploying a new financial application on Google Cloud that requires strong consistency, global scale, and the ability to handle millions of transactions per second across multiple regions. The application data has a relational structure. Which database service should they choose?

A.Firestore
B.Cloud SQL for MySQL
C.Cloud Bigtable
D.Cloud Spanner
AnswerD

Spanner provides global strong consistency, horizontal scaling, and full relational SQL support, ideal for high-throughput financial applications.

Why this answer

Cloud Spanner is the only Google Cloud database that provides global strong consistency, horizontal scaling, and relational schema support at massive transaction volumes. Cloud SQL is limited to a single region, Bigtable does not support relational data, and Firestore is document-based with limited transaction support.

241
Multi-Selectmedium

A company is designing a Cloud Bigtable schema for a time-series application. The application writes data from millions of devices and reads recent data by device ID and time range. Which TWO design patterns should they implement to optimize performance? (Select TWO.)

Select 2 answers
A.Use a single table with a row key that combines device_id and reversed timestamp
B.Use a row key format that starts with device_id followed by a reversed timestamp
C.Use multiple tables, one per device
D.Use a salting prefix to distribute writes
E.Store frequently accessed columns in a separate column family from rarely accessed ones
AnswersA, B

Same as A; this is the recommended pattern.

Why this answer

To optimize reads by device ID and time range, promote device_id to the start of the row key for efficient scans. Reverse the timestamp to avoid hotspotting on recent writes. Column families separate access patterns but don't affect read efficiency directly.

A single table is fine.

242
MCQeasy

A mobile app developer wants a serverless NoSQL database that automatically syncs data offline and provides security rules for access control. Which Google Cloud database should they choose?

A.Firestore
B.Cloud Bigtable
C.Cloud Spanner
D.Memorystore for Redis
AnswerA

Firestore is serverless, document-oriented, offers offline persistence, and Security Rules for granular access control.

Why this answer

Firestore is the correct choice: it is serverless, document-based, provides offline sync for mobile apps, and has Security Rules for access control.

243
MCQeasy

A company wants to migrate their data warehouse from Teradata to BigQuery. They need to automate the loading of data on a regular schedule. Which Google Cloud service should they use?

A.Dataproc
B.BigQuery Data Transfer Service
C.Cloud Data Fusion
D.Cloud Composer
AnswerB

It provides automated, scheduled data loads from Teradata to BigQuery.

Why this answer

BigQuery Data Transfer Service supports scheduled transfers from Teradata (and other sources) to BigQuery.

244
MCQhard

You are designing a monitoring strategy for a microservices architecture running on GKE. Each service emits custom business metrics (e.g., order processing time). You want to create a dashboard that shows the 99th percentile latency for each service over the last 7 days. Which approach should you take?

A.Export logs to Cloud Logging and use Log Analytics to compute percentiles.
B.Write custom metrics to Cloud Monitoring and create a dashboard with the 99th percentile aligner.
C.Use Metrics Explorer to view the metrics and manually compute percentiles.
D.Use Prometheus monitoring built into GKE and query the avg() function.
AnswerB

Cloud Monitoring custom metrics support percentile aligners like 99th.

Why this answer

Cloud Monitoring supports custom metrics and provides built-in aligners, including a 99th percentile aligner, which can be applied directly in a dashboard chart. This allows you to compute the 99th percentile latency for each service over the last 7 days without manual calculation or exporting logs. Custom metrics are the appropriate mechanism for business metrics like order processing time, as they are designed for numeric time-series data.

Exam trap

The PCD exam often tests the distinction between logs and metrics, and the trap here is that candidates may think exporting logs to Cloud Logging is a valid way to compute percentiles, overlooking that Cloud Monitoring is the correct service for numeric time-series data and provides native percentile computation.

How to eliminate wrong answers

Option A is wrong because Cloud Logging is designed for log data, not numeric time-series metrics; computing percentiles from logs requires parsing and aggregation, which is inefficient and not the intended use case. Option C is wrong because Metrics Explorer allows you to view and chart metrics, but it does not provide a built-in function to compute percentiles; you would have to export the data and calculate manually, which is not a scalable or recommended approach. Option D is wrong because Prometheus's avg() function computes the average, not the 99th percentile, and while Prometheus can be used with GKE, the question specifies using Cloud Monitoring's native capabilities for a dashboard.

245
Multi-Selecthard

A DevOps team wants to set up custom metrics for a serverless application running on Cloud Run. The application emits metrics using OpenTelemetry. They need to collect these metrics and create an alerting policy that triggers when the 99th percentile latency exceeds 500ms for 5 minutes. Which TWO actions must they take? (Choose two.)

Select 2 answers
A.Create a custom distribution metric for the latency data and set up a metric threshold alert using the 99th percentile value.
B.Deploy the OpenTelemetry Collector as a sidecar or external service and configure it to export metrics to Cloud Monitoring using the Cloud Monitoring exporter.
C.Install the Cloud Monitoring agent on the Cloud Run instance to collect custom metrics.
D.Define a log-based metric from the application logs that captures latency entries.
E.Configure the Cloud Monitoring dashboard to query the metrics using PromQL.
AnswersA, B

Distribution metrics support percentile calculations in alert policies.

Why this answer

To alert on the 99th percentile of latency, you must create a custom distribution metric, which stores a histogram of values and allows percentile calculations. A metric-threshold alert policy can then be configured to evaluate the 99th percentile value against the 500ms threshold over a 5-minute window.

Exam trap

The PCD exam often tests the misconception that log-based metrics can replace custom distribution metrics for percentile alerts, but logs lack the histogram structure required for precise percentile calculations.

246
MCQmedium

An organization needs a globally distributed relational database with strong consistency across regions and the ability to scale horizontally without manual sharding. Which Google Cloud database should they choose?

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

Spanner provides global distribution, strong consistency, and horizontal scaling without manual sharding.

Why this answer

Cloud Spanner is a globally distributed, strongly consistent relational database that scales horizontally. It supports multiple regional configurations and auto-scaling. Bigtable is not relational, Cloud SQL does not scale horizontally, and Firestore is not relational.

247
Multi-Selectmedium

A developer is deploying a new version of a microservice to Cloud Run. The developer wants to ensure that the new revision is tested with a small percentage of traffic before rolling out to all users. Which TWO approaches can the developer use?

Select 2 answers
A.Use the 'gcloud run deploy' command with '--no-traffic' and then use 'gcloud run services update-traffic --to-revisions=REVISION=5' to send 5% of traffic.
B.Use the 'gcloud run deploy' command with '--no-traffic' to deploy without serving traffic, then use 'gcloud run services update-traffic' to gradually increase traffic.
C.Set the 'max-instances' parameter to limit the number of instances handling requests.
D.Use the 'gcloud run deploy' command with '--tag' to assign a tag to the new revision, then direct test traffic to that tag.
E.Deploy the new revision with the same revision name as the old one to overwrite it, then roll back if issues occur.
AnswersA, B

This directly sets a specific percentage of traffic to the new revision.

Why this answer

The '--no-traffic' flag deploys the new revision without serving any traffic, and then 'gcloud run services update-traffic --to-revisions=REVISION=5' allows you to send exactly 5% of traffic to that revision for canary testing. Option B is also correct because it describes the same two-step process: deploy with '--no-traffic' to avoid immediate traffic, then use 'update-traffic' to gradually increase the percentage, which is the standard canary deployment pattern on Cloud Run.

Exam trap

Google Cloud often tests the distinction between traffic splitting (percentage-based routing) and direct access via tags; candidates mistakenly think tagging alone can serve a percentage of production traffic, but tags only provide a separate URL for testing without affecting the main service's traffic distribution.

248
MCQmedium

You want to migrate an on-premises MySQL database to Cloud SQL with minimal downtime. The source database is 500 GB. Which approach is recommended?

A.Use BigQuery Data Transfer Service to migrate the data
B.Create a Cloud SQL read replica from the on-premises source using Database Migration Service
C.Copy the data files to a Cloud Storage bucket and use the Cloud SQL import
D.Export the database using mysqldump and import to Cloud SQL using gcloud sql import
AnswerB

DMS can perform continuous replication, then promote the replica to primary, minimizing downtime.

Why this answer

Database Migration Service (DMS) is specifically designed for minimal-downtime migrations from on-premises MySQL to Cloud SQL. It uses continuous replication (CDC) to keep the source and target synchronized, allowing a short cutover window after the initial 500 GB data load. This approach avoids the downtime required by export/import or file-copy methods.

Exam trap

Google Cloud often tests the distinction between offline migration methods (mysqldump, file copy) and online replication-based methods (Database Migration Service), expecting candidates to recognize that 'minimal downtime' requires continuous change data capture, not a single bulk transfer.

How to eliminate wrong answers

Option A is wrong because BigQuery Data Transfer Service is for loading data into BigQuery, not for migrating databases to Cloud SQL. Option C is wrong because copying data files to Cloud Storage and importing requires the source database to be stopped or made read-only to ensure consistency, causing significant downtime. Option D is wrong because mysqldump and gcloud sql import are offline methods that require the source database to be unavailable during the entire export and import process, which for 500 GB would result in hours of downtime.

249
MCQhard

An organization is planning a re-architect migration of a monolithic Oracle database to a microservices architecture using Cloud SQL for PostgreSQL and Cloud Spanner. They need to split the schema into multiple databases while maintaining data consistency across services. Which approach should they use?

A.Use a single Cloud SQL for PostgreSQL instance with different schemas per service.
B.Use BigQuery to store all data and query across services.
C.Use Cloud SQL for PostgreSQL for each service and implement sagas to handle distributed transactions.
D.Use Cloud Spanner for all services to maintain ACID transactions across databases.
AnswerC

Sagas are the recommended pattern for maintaining data consistency across microservices.

Why this answer

For microservices, each service should own its database. To maintain consistency across services, they should implement compensating transactions (sagas) rather than distributed transactions. Cloud Spanner can be used if strong consistency is required across global scales, but for microservices, the pattern is to use eventual consistency with sagas.

250
MCQhard

A developer deployed the Kubernetes Deployment shown. The application takes about 45 seconds to fully initialize and respond on the /healthz endpoint. What problem will occur with this configuration?

A.The readiness probe will never succeed, and the pod will be removed from service.
B.The deployment will not create any pods because of a syntax error.
C.The liveness probe will start too early and cause the pod to be restarted before it becomes ready.
D.The pod will be marked ready immediately because the readiness probe uses the same endpoint as liveness.
AnswerC

Correct: Liveness probe at 30s will fail, and after three failures the pod restarts, preventing it from ever becoming ready.

Why this answer

The liveness probe has an initialDelaySeconds of 30 seconds, which is less than the application's initialization time of 45 seconds. Therefore, the liveness probe will start checking the /healthz endpoint at 30 seconds, fail, and Kubernetes will restart the pod before it becomes ready. The readiness probe does not prevent the liveness probe from running and causing restarts.

Exam trap

Google Cloud often tests the distinction between liveness and readiness probes in GKE. The trap here is that candidates assume both probes behave the same way or that a failing readiness probe prevents the liveness probe from running, when in fact liveness probes operate independently and can restart the pod before readiness succeeds.

How to eliminate wrong answers

Option A is wrong because the readiness probe will eventually succeed after the 45-second initialization period, as it uses the same /healthz endpoint; the problem is not that it never succeeds, but that the liveness probe restarts the pod first. Option B is wrong because there is no syntax error in the Deployment manifest; the configuration is syntactically valid, and pods will be created. Option D is wrong because the pod will not be marked ready immediately; the readiness probe must succeed before the pod is considered ready, and it takes 45 seconds to succeed, so the pod will remain in a not-ready state until then.

251
Multi-Selectmedium

A company uses Cloud Spanner for a global application. They want to improve read performance for point-reads (individual row lookups). Which TWO strategies should they adopt?

Select 2 answers
A.Use read replicas
B.Create secondary indexes
C.Partition the table by time
D.Use batch reads
E.Use interleaved tables
AnswersB, E

Secondary indexes enable efficient point reads on columns other than the primary key.

Why this answer

Secondary indexes in Cloud Spanner allow point-reads to be served directly from the index table, avoiding a full table scan and reducing latency. Interleaved tables store child rows physically adjacent to their parent row, enabling efficient single-row lookups without cross-node coordination.

Exam trap

The PCD exam often tests the misconception that read replicas or batch operations improve point-read latency, when in fact they address throughput or bulk retrieval, not the speed of individual row lookups.

252
MCQmedium

During a MySQL to Cloud SQL migration using DMS, the migration job completes the full dump and CDC phases, but the cutover step fails. The error says 'Source database write operations still occurring'. What should the engineer do to complete cutover?

A.Restart the DMS job from the beginning.
B.Manually apply remaining changes to Cloud SQL using a SQL script.
C.Increase the source database's binary log retention period.
D.Stop all write operations to the source database, then promote the Cloud SQL replica.
AnswerD

Stopping writes allows CDC to catch up; then promote the replica to become the new primary.

Why this answer

For a zero-downtime cutover, you must first stop writes to the source database, then promote the Cloud SQL replica. The error indicates writes are still happening; stopping them allows the CDC to catch up and then cutover.

253
MCQhard

A company wants to create an SLO for their API with a target of 99.9% availability over a 30-day rolling window. They are using Cloud Monitoring. Which combination of resources and techniques should they use?

A.Manually compute availability using external monitoring tools.
B.Use the Cloud Monitoring SLO service with a request latency SLI.
C.Create an uptime check and a log-based metric for errors. Use the SLI formula: (successful requests / total requests).
D.Use Cloud Trace to measure latency and create a custom metric.
AnswerC

This leverages native Cloud Monitoring SLO capabilities, defining availability as the fraction of successful probes or requests, and automatically tracks the SLO over a rolling window.

Why this answer

It combines an uptime check (to measure total requests) with a log-based metric for errors (to count failed requests), allowing the SLI formula (successful requests / total requests) to compute availability. This approach directly aligns with the 99.9% availability target over a 30-day rolling window, using Cloud Monitoring's native capabilities without external tools or irrelevant latency metrics.

Exam trap

The PCD exam often tests the distinction between availability and latency SLIs, so the trap here is assuming that any monitoring metric (like latency) can be used for an availability SLO, when in fact availability requires a success/failure ratio, not a performance threshold.

How to eliminate wrong answers

Option A is wrong because manually computing availability using external monitoring tools bypasses Cloud Monitoring's built-in SLO service, which is designed to automate SLI calculation and alerting, and introduces unnecessary manual effort and potential inconsistency. Option B is wrong because a request latency SLI measures response time, not availability; availability is about whether requests succeed or fail, not how fast they respond, so this SLI does not match the 99.9% availability target. Option D is wrong because Cloud Trace is a distributed tracing tool for analyzing latency and request flows, not for counting successful vs. total requests; using it to create a custom metric for availability would be inefficient and misaligned with the purpose of the service.

254
MCQeasy

Which Google Cloud database service should be used to implement a low-latency session store for a web application that requires pub/sub capabilities and rate limiting?

A.Firestore
B.Cloud Spanner
C.Memorystore for Memcached
D.Memorystore for Redis
AnswerD

Redis supports session storage, pub/sub messaging, and rate limiting via sorted sets or patterns.

Why this answer

Memorystore for Redis provides low-latency in-memory data storage with support for pub/sub and rate limiting patterns. It is ideal for session stores.

255
MCQmedium

A company runs a global e-commerce platform on GKE. They need to serve users with low latency from multiple regions. Which load balancing solution should they use?

A.Regional external HTTP(S) Load Balancer
B.Global external HTTP(S) Load Balancer
C.Internal TCP/UDP Load Balancer
D.SSL Proxy Load Balancer
AnswerB

Global load balancer routes users to the nearest region, minimizing latency.

Why this answer

A global external HTTP(S) Load Balancer is the correct choice because it provides a single anycast IP address that routes traffic from users worldwide to the nearest GKE backend, minimizing latency. It supports cross-regional failover and integrates with Cloud CDN for caching static content, making it ideal for a global e-commerce platform. Regional load balancers cannot serve traffic across multiple regions with a single IP, which is required for global low-latency access.

Exam trap

The PCD exam often tests the misconception that a Regional external HTTP(S) Load Balancer can be used for global traffic by simply deploying it in one region, but the trap is that it lacks anycast IP and cannot route users to the nearest region, causing higher latency for distant users.

How to eliminate wrong answers

Option A is wrong because a Regional external HTTP(S) Load Balancer only distributes traffic within a single GCP region, so it cannot serve users globally with low latency from multiple regions. Option C is wrong because an Internal TCP/UDP Load Balancer is designed for private VPC traffic within a region and does not expose a public endpoint for external users. Option D is wrong because an SSL Proxy Load Balancer terminates SSL/TLS connections but does not provide global anycast IP or HTTP(S) content-based routing; it is limited to TCP traffic and lacks the global scope needed for multi-region user distribution.

256
MCQeasy

A company is designing a global e-commerce platform on Google Cloud. The application requires low-latency access for users worldwide and must be highly available. Which load balancing solution should they use?

A.External TCP/UDP Network Load Balancer
B.External HTTP(S) Load Balancer
C.Cloud CDN
D.Internal TCP/UDP Load Balancer
AnswerB

External HTTP(S) Load Balancer is a global load balancer that provides low latency and high availability for web applications.

Why this answer

The External HTTP(S) Load Balancer is the correct choice because it is a global, proxy-based Layer 7 load balancer that terminates HTTP/HTTPS traffic at Google's edge points of presence (PoPs) and routes requests to the nearest healthy backend. This provides low-latency access for users worldwide by leveraging Google's global network and anycast IPs, while also offering built-in high availability, SSL offloading, and content-based routing.

Exam trap

The PCD exam often tests the misconception that a Layer 4 load balancer (like External TCP/UDP Network Load Balancer) is sufficient for global low-latency access, but candidates must remember that only Layer 7 global load balancers provide anycast IPs and cross-region routing for worldwide users.

How to eliminate wrong answers

Option A is wrong because the External TCP/UDP Network Load Balancer is a regional, Layer 4 load balancer that does not provide global anycast IP or cross-region failover, so it cannot deliver low-latency access for users worldwide. Option C is wrong because Cloud CDN is a content delivery network that caches static content at edge locations, not a load balancer; it can be used in conjunction with a load balancer but does not itself handle traffic distribution or high availability for dynamic requests. Option D is wrong because the Internal TCP/UDP Load Balancer is a regional, private load balancer designed for internal traffic within a VPC, not for global external user access.

257
Multi-Selectmedium

A company is designing a polyglot persistence architecture. They need to store (1) customer profiles with complex relationships and ACID transactions, (2) high-volume time-series IoT sensor data, and (3) interactive analytics dashboards. Which TWO Google Cloud databases should they choose for these workloads? (Choose 2 options.)

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

Cloud SQL provides ACID transactions for relational data.

Why this answer

Cloud SQL (or Spanner) for relational ACID, Bigtable for time-series, BigQuery for analytics. The question asks for two, but three are mentioned; the best pair for the first two requirements is Cloud SQL and Bigtable. However, since it asks for TWO, we select Cloud SQL for transactions and Bigtable for time-series.

258
MCQmedium

A financial services company is migrating a critical PostgreSQL database to AlloyDB using Database Migration Service (DMS). They want to minimize downtime by using continuous change data capture (CDC). After the initial full dump, what phase must be completed before promoting the replica to primary?

A.Perform a final manual sync
B.Take a new full dump
C.Delete all existing data in AlloyDB
D.Complete the CDC phase
AnswerD

CDC phase must complete and the replica must be up-to-date before promotion.

Why this answer

DMS provides a CDC phase that continuously replicates changes from the source to the destination. Only after the replica catches up and the application can be stopped can you promote the replica. The full dump is the first step, then CDC ensures consistency.

259
Multi-Selecthard

A healthcare company uses Cloud SQL for PostgreSQL to store patient records. They need to implement a disaster recovery plan with cross-region failover capability and minimal data loss. Which TWO steps should they take? (Choose two)

Select 2 answers
A.Migrate to Cloud Spanner for multi-region support
B.Use Cloud SQL HA instance in the primary region
C.Enable cross-region replication using Cloud SQL's built-in feature
D.Enable automated backups and point-in-time recovery
E.Create a cross-region read replica
AnswersD, E

Backups allow recovery to a specific point in time, minimizing data loss after a disaster.

Why this answer

Cross-region read replicas can be promoted in a disaster, but they may have data loss. To minimize loss, use Cloud SQL HA in the primary region plus a cross-region read replica. Automated backups provide point-in-time recovery but not automatic failover.

260
MCQeasy

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

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

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

Why this answer

Cloud Bigtable is a fully managed, scalable NoSQL database designed for large analytical and operational workloads, handling petabytes of data with consistent single-digit millisecond latency at high throughput. Its key-value and wide-column architecture, combined with native time-series optimization via row key design (e.g., inverted timestamps), makes it the ideal choice for IoT sensor data requiring millions of reads per second.

Exam trap

A common misconception is that Cloud Spanner is the universal solution for any high-throughput database need, but candidates must recognize that Spanner's relational model and global consistency overhead make it unsuitable for simple key-value time-series workloads at petabyte scale with millions of reads per second.

How to eliminate wrong answers

Option B (Cloud Spanner) is wrong because it is a globally distributed relational database with strong consistency and SQL support, optimized for transactional workloads rather than high-throughput time-series key-value access; its latency and cost profile are not suited for millions of reads per second on petabyte-scale IoT data. Option C (Firestore) is wrong because it is a mobile and web document database with limited throughput (up to 10,000 writes/second per database) and is not designed for petabyte-scale time-series data or single-digit millisecond latency at millions of reads per second. Option D (BigQuery) is wrong because it is a serverless data warehouse optimized for analytical SQL queries on large datasets, not for real-time key-value lookups with single-digit millisecond latency; it typically incurs seconds of latency for interactive queries.

261
MCQeasy

A company runs a batch job that processes large files from Cloud Storage every night. The job must complete within a 2-hour window. If the job fails, it should retry automatically. Which Google Cloud service should they use to orchestrate this job?

A.Compute Engine with startup script
B.Cloud Run
C.App Engine Cron
D.Cloud Composer
AnswerD

Cloud Composer is a managed workflow orchestration service that supports scheduling, retries, and complex dependencies, ideal for batch jobs.

Why this answer

Cloud Composer (D) is the correct choice because it is a fully managed workflow orchestration service built on Apache Airflow, designed to schedule, monitor, and retry batch jobs with complex dependencies. It can trigger a Cloud Storage file processing job, enforce a 2-hour execution window, and automatically retry on failure using Airflow's built-in retry mechanisms and SLA monitoring.

Exam trap

The PCD exam often tests the distinction between simple scheduling (App Engine Cron) and full orchestration with retry and dependency management (Cloud Composer), leading candidates to pick App Engine Cron because they overlook the requirement for automatic retry and time-window enforcement.

How to eliminate wrong answers

Option A is wrong because Compute Engine with a startup script is a manual, single-instance solution that lacks built-in scheduling, retry logic, and orchestration capabilities; it would require custom scripting and external cron to handle failures and time windows. Option B is wrong because Cloud Run is a serverless container platform for request-driven or event-driven workloads, not designed for long-running batch orchestration with retry policies and time-window enforcement; it lacks native workflow sequencing and retry orchestration. Option C is wrong because App Engine Cron is a simple scheduling service that triggers HTTP endpoints at fixed intervals, but it does not provide retry logic, dependency management, or execution time-window enforcement; it cannot automatically retry a failed job or ensure completion within a 2-hour window.

262
Multi-Selecthard

An organization is migrating an Oracle database to Cloud SQL for PostgreSQL using Database Migration Service. The source has many PL/SQL packages, sequences, and data types (NUMBER, VARCHAR2, DATE, CLOB, RAW). Which FOUR conversions are correct?

Select 4 answers
A.Map Oracle RAW to PostgreSQL BYTEA.
B.Map Oracle DATE to PostgreSQL DATE.
C.Map Oracle NUMBER to PostgreSQL NUMERIC.
D.Map Oracle CLOB to PostgreSQL TEXT.
E.Convert Oracle packages to PostgreSQL schemas containing functions.
AnswersA, C, D, E

While RAW maps to BYTEA, this conversion is not among the three correct answers for this question; the correct set is C, D, E.

Why this answer

During migration from Oracle to Cloud SQL for PostgreSQL using DMS, the following mappings are correct: RAW maps to BYTEA (A), NUMBER maps to NUMERIC (C), CLOB maps to TEXT (D), and Oracle packages are converted to PostgreSQL schemas containing functions (E). Option B is incorrect because Oracle DATE includes time components and should map to TIMESTAMP, not DATE.

263
MCQmedium

A company needs a database for an e-commerce application that requires strong consistency and the ability to scale horizontally across multiple regions. They expect high write throughput and need to support SQL queries. Which database should they choose?

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

Spanner meets all requirements: global, strongly consistent, scalable, SQL.

Why this answer

Cloud Spanner is a globally distributed, strongly consistent relational database that scales horizontally and supports SQL. Bigtable is NoSQL and eventually consistent. Cloud SQL is regional and does not scale horizontally.

Firestore is NoSQL and eventually consistent across regions.

264
MCQeasy

You need to migrate an on-premises PostgreSQL database to Cloud SQL using Database Migration Service. The source database is behind a firewall without a public IP. Which connectivity option should you configure?

A.Use a Cloud SQL proxy container on-premises to forward connections.
B.Expose the source database on a public IP with SSL.
C.Use VPC peering with a VPN tunnel between on-premises and Google Cloud.
D.Use Cloud SQL Auth Proxy to connect to the source database.
AnswerC

DMS supports VPC peering for source connection; VPN extends the VPC to on-premises.

Why this answer

For source databases without public IP and behind a firewall, DMS supports connectivity via VPC peering (if the source is in a VPC) or using Cloud SQL Auth Proxy. However, if the source is on-premises, you need to establish connectivity via VPN or Interconnect and then use VPC peering. Cloud SQL Auth Proxy is not for source connectivity in DMS.

The correct option is to use VPC peering with a VPN.

265
Multi-Selecthard

You are designing a Bigtable data model for an ad-tech platform that tracks user impressions. Which TWO row key design practices should you implement to avoid hotspots and ensure even distribution?

Select 2 answers
A.Use monotonically increasing integers as the row key
B.Use field promotion to place high-cardinality fields first
C.Use a reversed timestamp as the first component
D.Use a hash prefix (salted key) to distribute writes
E.Use a low-cardinality field as the row key prefix
AnswersB, D

Field promotion ensures even distribution by using high-cardinality field as the first part of the row key.

Why this answer

Field promotion places the highest-cardinality field first in the row key, which spreads writes across many tablet servers. In Bigtable, rows are sorted lexicographically by row key, so a high-cardinality prefix ensures that successive writes do not concentrate on a single tablet, avoiding hotspots.

Exam trap

Google often tests the misconception that monotonically increasing keys are acceptable for Bigtable, when in fact they cause severe hotspots; candidates must remember that Bigtable's sorted storage requires random or high-cardinality prefixes for even distribution.

266
MCQmedium

A manufacturing company collects time-series data from thousands of sensors and wants to store it in Cloud Bigtable. They need to design a row key that avoids hotspots and ensures even distribution of writes across tablets. Which row key design strategy is BEST?

A.Use an inverted timestamp as the row key
B.Use the sensor ID as the first component of the row key
C.Prefix the timestamp with a hash of the sensor ID
D.Use a single row key for all data from the same day
AnswerC

Hashing distributes writes evenly across the key space.

Why this answer

To avoid hotspots, the row key should start with a field that has high cardinality and even distribution. A common approach is to prepend a hash or a nonce derived from the timestamp or sensor ID to spread writes across tablets.

267
MCQmedium

A company uses Cloud Bigtable for time-series data and wants backups that can be restored in a different region for disaster recovery. Which backup method meets this requirement?

A.Use Bigtable managed backups, which are stored in the same region and can be restored to any cluster
B.Export tables to Avro files in GCS, then import in the new region
C.Enable replication between Bigtable clusters
D.Use BigQuery federated queries to export data to GCS
AnswerA

Managed backups can be restored to a different region via cross-cluster restore.

Why this answer

Bigtable managed backups are cluster-level and support cross-cluster restore, including to a different region.

268
Multi-Selectmedium

A developer is building an event-driven system using Cloud Pub/Sub. They need to ensure reliable message delivery and processing. Which three practices should they follow?

Select 3 answers
A.Set a minimum number of delivery attempts.
B.Use pull subscriptions with synchronous acknowledgment.
C.Use message ordering.
D.Configure a dead-letter topic.
E.Use exponential backoff for pull subscriptions.
AnswersB, D, E

Sync ack allows you to acknowledge after processing, preventing loss.

Why this answer

Pull subscriptions with synchronous acknowledgment (option B) ensure that a message is not acknowledged until the subscriber has successfully processed it. This prevents premature acknowledgment and message loss, because Cloud Pub/Sub will redeliver the message if the acknowledgment deadline expires without a synchronous ack. This is a core pattern for reliable processing.

Exam trap

The trap here is confusing reliability features with ordering or delivery attempt counts; The PCD exam often tests that reliable processing relies on synchronous acknowledgment and dead-letter topics, not on setting a minimum delivery attempts or enabling ordering.

269
MCQmedium

A company is migrating an on-premises PostgreSQL database to Cloud SQL for PostgreSQL. They require automatic failover within 60 seconds in case of a zonal failure. The database must be available in the same region for low latency. Which configuration should they choose?

A.Create a Cloud SQL for PostgreSQL zonal instance with one standby replica in the same zone.
B.Create a Cloud SQL for PostgreSQL regional instance with HA configuration.
C.Create a Cloud SQL for PostgreSQL instance with a local SSD and enable automatic storage increase.
D.Create a Cloud SQL for PostgreSQL zonal instance and add a cross-region read replica.
AnswerB

Regional HA configuration provides a synchronous standby in a different zone within the same region, with automatic failover within 60 seconds.

Why this answer

Cloud SQL HA configuration uses a regional instance with a standby in a different zone within the same region. Automatic failover occurs within 60 seconds. Zonal instances do not provide HA.

Cross-region replicas are for disaster recovery, not automatic failover within the region.

270
MCQhard

Your company runs a multi-tier application on Compute Engine with a Cloud SQL backend. Recently, during peak hours, users report slow page loads. Cloud Monitoring shows high CPU on the app servers, but no memory pressure. Cloud Trace shows that the application spends most of its time waiting for database queries. The Cloud SQL instance is a high-memory machine type with 16 vCPUs and 64 GB RAM, but CPU utilization on the database is only 30%. There are no slow query alerts. What is the most likely cause and what should you do?

A.The database lacks indexes. Use Cloud SQL Query Insights to identify missing indexes.
B.The application is performing unnecessary queries. Add caching with Memorystore.
C.The database connection pool is exhausted. Increase the maximum number of connections.
D.The Cloud SQL instance is under-provisioned. Upgrade to a larger machine type.
AnswerA

Missing indexes force full table scans, causing slow queries. Query Insights can reveal the specific slow queries and suggest indexes.

Why this answer

The symptoms—high app server CPU, low database CPU, and queries consuming most of the application’s wait time—point to inefficient queries due to missing indexes. Cloud SQL Query Insights can identify these missing indexes by analyzing query execution plans and wait events. Adding appropriate indexes reduces query execution time, lowering app server CPU usage and resolving the slow page loads.

Option A is correct because the database lacks indexes; Query Insights helps find them.

Exam trap

The PCD exam often tests the misconception that high app server CPU always means the app server is the bottleneck, when in fact the CPU is consumed waiting for slow database queries caused by missing indexes.

How to eliminate wrong answers

Option B is wrong because the application is already waiting on database queries, not performing unnecessary queries; caching would mask the underlying indexing issue but not fix the root cause. Option C is wrong because connection pool exhaustion would cause connection timeouts or errors, not high app server CPU and low database CPU; Cloud SQL’s 30% CPU utilization indicates connections are not saturated. Option D is wrong because the database CPU is only 30% utilized, so the instance is not under-provisioned; upgrading would not address the query performance bottleneck.

271
MCQeasy

A developer wants to receive notifications when the error rate of their application exceeds 1% over a 5-minute window. What should they create in Cloud Monitoring?

A.Alerting policy with metric threshold condition
B.Log-based metric
C.Dashboard with error rate chart
D.Uptime check
AnswerA

Alerting policies evaluate metrics and send notifications.

Why this answer

An alerting policy with a metric threshold condition is the correct approach because Cloud Monitoring evaluates a metric (e.g., error rate) against a threshold (1%) over a specified window (5 minutes) and triggers a notification when the condition is met. This directly fulfills the requirement to be notified when the error rate exceeds the threshold, as alerting policies are designed for proactive notification based on metric data.

Exam trap

The PCD exam often tests the distinction between alerting policies (which trigger notifications) and other monitoring components like dashboards or log-based metrics, so candidates mistakenly choose a log-based metric or dashboard because they confuse data collection with alerting.

How to eliminate wrong answers

Option B is wrong because a log-based metric is used to extract quantitative data from logs (e.g., count of error log entries) but does not itself trigger notifications; it must be used within an alerting policy to generate alerts. Option C is wrong because a dashboard with an error rate chart provides a visual representation of the metric but does not generate notifications or alerts; it is a passive monitoring tool. Option D is wrong because an uptime check monitors the availability and responsiveness of a resource (e.g., HTTP response codes) and is not designed to track application error rates or trigger alerts based on a percentage threshold over a time window.

272
Multi-Selecthard

A company is migrating a PostgreSQL database to AlloyDB using Database Migration Service. They need to ensure the migration has minimal downtime and can be tested before cutover. Which THREE steps should they include in their migration plan?

Select 3 answers
A.Create a migration job with 'Full dump + CDC' to enable continuous replication.
B.Enable logical replication on the source PostgreSQL database.
C.Test the migration by promoting a replica in a non-production environment before final cutover.
D.Create a connection profile for the source PostgreSQL database.
E.Use pg_dump to take a manual backup and restore it to AlloyDB before setting up DMS.
AnswersA, B, D

Full dump + CDC provides continuous replication for minimal downtime.

273
MCQhard

A company uses Cloud Storage for backups. They need to comply with a regulation requiring immutable storage for 7 years. Which bucket configuration should they use?

A.Use a bucket with a retention policy (not locked)
B.Set a lifecycle rule to archive to Coldline
C.Enable Object Versioning
D.Set a retention policy and lock the bucket
AnswerD

Locking the retention policy makes it permanent, ensuring objects cannot be deleted or overwritten for the specified duration.

Why this answer

Locking a retention policy in Cloud Storage enforces immutable storage for the specified duration (7 years). Once locked, the retention policy cannot be removed or shortened, ensuring compliance with regulations that require data to be preserved in its original state and not modifiable or deletable until the retention period expires.

Exam trap

The trap here is that candidates confuse a simple retention policy (which can be removed) with a locked retention policy (which is immutable), or they assume Object Versioning alone provides sufficient protection against deletion.

How to eliminate wrong answers

Option A is wrong because a retention policy that is not locked can be removed or shortened, which does not provide the immutable guarantee required by regulation. Option B is wrong because a lifecycle rule to archive to Coldline only moves data to a lower-cost storage class; it does not prevent deletion or modification of objects. Option C is wrong because Object Versioning alone does not prevent deletion of object versions; it only preserves previous versions when objects are overwritten or deleted, but versions can still be deleted manually or by lifecycle rules.

274
MCQeasy

A company runs a stateless application on Compute Engine behind a load balancer. They want to monitor the number of active requests per instance without adding custom instrumentation. What is the most straightforward approach?

A.Configure the Cloud Monitoring agent to collect request metrics.
B.Install the Cloud Logging agent and parse access logs.
C.Deploy Prometheus and instrument the application.
D.Use the load balancer's built-in 'request_count' metric.
AnswerD

This metric is available without additional agents.

Why this answer

The load balancer's built-in 'request_count' metric directly provides the number of active requests per instance without requiring any additional instrumentation or agents. This metric is automatically collected by Cloud Monitoring for Google Cloud HTTP(S) load balancers, making it the most straightforward approach for a stateless application on Compute Engine.

Exam trap

The PCD exam often tests the distinction between agent-based monitoring (Cloud Monitoring agent) and built-in managed service metrics (load balancer metrics), where candidates mistakenly assume an agent is required for any application-level metric, ignoring that Google Cloud's managed services automatically expose relevant metrics.

How to eliminate wrong answers

Option A is wrong because the Cloud Monitoring agent collects system-level metrics (CPU, memory, disk) from VM instances, not application-level request counts; it cannot capture active request counts without custom instrumentation. Option B is wrong because installing the Cloud Logging agent and parsing access logs would require additional log-based metric configuration and processing, which is less straightforward than using the built-in load balancer metric. Option C is wrong because deploying Prometheus and instrumenting the application introduces significant complexity and custom code, which contradicts the requirement of 'without adding custom instrumentation'.

275
Multi-Selectmedium

A company is planning to migrate from MySQL to Cloud SQL for MySQL. They want to ensure the migrated database meets performance and security requirements. Which TWO configurations should they apply to Cloud SQL?

Select 2 answers
A.Configure the Cloud SQL instance to require SSL/TLS for all connections.
B.Migrate all tables to MyISAM storage engine for better performance.
C.Enable automated backups and point-in-time recovery (PITR).
D.Set the database flag 'skip_grant_tables' for faster migration.
E.Disable the query cache to improve concurrency.
AnswersA, C

Enforcing TLS ensures encrypted connections between the application and database, meeting security requirements.

Why this answer

Enabling point-in-time recovery is important for data protection. Enforcing TLS ensures encrypted connections. These are common security and operational requirements.

276
MCQmedium

A company needs to build a CI/CD pipeline for a microservices architecture. They want to run unit tests quickly by only testing code that has changed. Which approach should they use?

A.Use Cloud Build with a step that caches test results based on file hashes.
B.Use Cloud Build with a step that runs all tests in parallel.
C.Use Cloud Build with a step that uses `git log` to find changed files and run tests.
D.Use Cloud Build with a step that checks `git diff` against the previous commit and runs tests only on affected modules using a test runner that supports file-based filtering.
AnswerD

This approach directly targets changed files, minimizing test execution time.

Why this answer

It uses `git diff` to identify only the files that have changed and then runs tests on the affected modules, which is the most efficient approach for selective testing. Option A is not ideal because implementing a custom caching mechanism based on file hashes is complex and may not reliably skip tests when dependencies change. Option B runs all tests in parallel, but that does not reduce the test scope—it still runs the full test suite.

Option C uses `git log`, which provides commit history rather than a direct diff of the current changes, making it less precise than `git diff` for identifying changed files.

277
Drag & Dropmedium

Drag and drop the steps to set up a Cloud Build trigger for continuous deployment in the correct order.

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

A Cloud Build trigger is set up by connecting a repository and configuring the conditions for automatic builds.

278
MCQmedium

A team uses Cloud Source Repositories for version control and Cloud Build for CI. The build configuration file (cloudbuild.yaml) includes a step that runs unit tests. The team wants to ensure that the build fails if any test fails. What should the developer do?

A.Use Cloud Build's built-in test runner that automatically fails the build on test failure.
B.Ensure the test command in the build step returns a non-zero exit code when tests fail.
C.Create a custom builder that runs tests and emits a non-zero exit code on failure.
D.Add a pre-build step that checks test results and triggers a build failure if needed.
AnswerB

Cloud Build treats any non-zero exit code as a failure, causing the build to fail.

Why this answer

Cloud Build executes each step as a container, and the build step's success or failure is determined by the exit code of the command run inside that container. If the test command (e.g., `npm test` or `pytest`) returns a non-zero exit code when tests fail, Cloud Build will automatically mark that step as failed and stop the build. No special configuration or custom builder is required beyond ensuring the test command itself propagates the failure exit code.

Exam trap

The PCD exam often tests the misconception that Cloud Build has a built-in test runner or that you need a custom builder to handle test failures, when in fact the standard exit code mechanism is all that is required.

How to eliminate wrong answers

Option A is wrong because Cloud Build does not have a built-in test runner; it relies on the exit code of the command you specify in the step. Option C is wrong because creating a custom builder is unnecessary; the standard language images (e.g., node, python) already include test runners that return non-zero exit codes on failure. Option D is wrong because a pre-build step cannot check test results that haven't been generated yet; the test step itself must fail the build by returning a non-zero exit code.

279
MCQhard

During an Oracle to PostgreSQL migration using Ora2Pg, a developer notices that PL/SQL packages are not being converted correctly. What is the recommended strategy to handle Oracle packages in PostgreSQL?

A.Use pglogical to replicate Oracle data to PostgreSQL and rewrite application code to call PostgreSQL functions directly.
B.Keep the Oracle database as a read replica and use Oracle Foreign Data Wrapper for PostgreSQL.
C.Recreate each procedure/function as a separate function in a dedicated schema, and use temporary tables for package variables.
D.Use PostgreSQL's CREATE PACKAGE extension (available in some forks) to maintain package structure.
AnswerC

This is the standard pattern to mimic Oracle packages in PostgreSQL.

Why this answer

PostgreSQL does not have a direct equivalent of Oracle packages. The recommended approach is to convert package procedures and functions to individual functions in a schema, and package variables to session-level variables or temporary tables. Ora2Pg can attempt conversion but often requires manual adjustments.

280
MCQeasy

A startup is deploying a stateless web app on Compute Engine. They expect traffic spikes. What is the most cost-effective way to handle scaling?

A.Use App Engine Standard.
B.Use a single large VM with more cores.
C.Use managed instance groups with autoscaling based on CPU utilization.
D.Use Cloud Functions.
AnswerC

MIG with autoscaling scales horizontally and cost-effectively.

Why this answer

Managed instance groups (MIGs) with autoscaling based on CPU utilization are the most cost-effective solution for a stateless web app with traffic spikes because they automatically add or remove VM instances in response to real-time CPU load, ensuring you only pay for the compute resources you actually use. This approach directly matches the stateless nature of the app, allowing instances to be created and destroyed without data loss, and avoids over-provisioning or under-utilizing resources.

Exam trap

The PCD exam often tests the misconception that serverless options like App Engine or Cloud Functions are always the most cost-effective for any web app, but the trap here is that for a stateless web app with traffic spikes, managed instance groups with autoscaling provide finer control over scaling behavior and can be more cost-effective than paying for always-on App Engine instances or the per-invocation cost of Cloud Functions for sustained HTTP traffic.

How to eliminate wrong answers

Option A is wrong because App Engine Standard, while autoscaling, is a fully managed platform that can be more expensive for sustained traffic spikes due to its pricing model (per-instance-hour plus resource usage) and may introduce vendor lock-in or scaling limits (e.g., 10 concurrent requests per instance by default). Option B is wrong because a single large VM with more cores is a vertical scaling approach that has a hard upper limit (maximum machine size), creates a single point of failure, and is not cost-effective as you pay for idle capacity during low traffic. Option D is wrong because Cloud Functions is a serverless compute service designed for event-driven, short-lived tasks (max 9 minutes execution time, 60 minutes for HTTP functions) and is not suitable for running a persistent web app that requires continuous HTTP serving and state management across requests.

281
MCQeasy

You want to deploy a containerized application on Google Cloud that requires no server management and automatically scales based on HTTP traffic. Which service should you use?

A.Cloud Run.
B.Compute Engine.
C.Google Kubernetes Engine.
D.App Engine Flexible Environment.
AnswerA

Cloud Run is serverless and autoscales based on HTTP requests.

Why this answer

(Cloud Run) is correct because Cloud Run is a serverless platform that automatically scales based on HTTP traffic and requires no server management. Option B (Compute Engine) is incorrect because it requires you to manage virtual machines. Option C (Google Kubernetes Engine) is incorrect because it requires cluster management.

Option D (App Engine Flexible Environment) is incorrect because it still runs on VMs and requires more configuration than Cloud Run.

282
Multi-Selecthard

A company has a Cloud Spanner instance with 1000 processing units and wants to enable auto-scaling. Which three parameters must be configured? (Choose THREE.)

Select 3 answers
A.Maximum processing units
B.Minimum processing units
C.Target high-priority CPU utilization
D.Scaling increment (e.g., 100 units)
E.Instance type (regional or multi-region)
AnswersA, B, C

Defines the upper bound.

Why this answer

When enabling auto-scaling for Cloud Spanner, you must set the minimum and maximum processing units (or nodes) and the target high-priority CPU utilization. Scaling increments and scaling limits are not direct parameters. The instance type is fixed.

283
MCQhard

You are deploying a stateful application to GKE. The deployment fails with an error: 'pods failed to fit in any node due to insufficient CPU'. The cluster has 3 nodes with 4 vCPUs each. The deployment requests 2 vCPUs per pod with 5 replicas. What is the most likely issue?

A.The cluster autoscaler is not enabled.
B.The deployment does not specify resource limits.
C.Other workloads or system components are consuming CPU resources.
D.The nodes have taints that prevent pod scheduling.
AnswerC

Reserved CPU for system daemons reduces available capacity.

Why this answer

The cluster has 3 nodes × 4 vCPUs = 12 vCPUs total capacity. The deployment requests 5 pods × 2 vCPUs = 10 vCPUs, which is within the total capacity. However, the error indicates that the pods cannot be scheduled due to insufficient CPU.

This is most likely because other workloads (e.g., system components, DaemonSets, or other deployments) are consuming CPU on the nodes, reducing the available CPU below what is required. Option A is incorrect because the cluster autoscaler would only add nodes if there is insufficient total capacity, but here the capacity exists but is consumed. Option B is incorrect because missing resource limits would not cause CPU insufficiency; it would allow pods to consume more but not prevent scheduling.

Option D is incorrect because the error explicitly mentions insufficient CPU, not taints or tolerations. Therefore, option C is the most likely cause.

284
MCQmedium

A developer needs to deploy a Python application to App Engine flexible environment. The application requires a specific version of a system package (libssl-dev) that is not included in the default runtime image. How should the developer install this package?

A.Use a custom runtime that already includes the package.
B.Specify the package in the app.yaml file under the 'libraries' section.
C.Create a Dockerfile that uses the base runtime image and runs apt-get install.
D.Add the package name to the requirements.txt file.
AnswerC

A Dockerfile allows customizing the runtime, including system packages.

Why this answer

The App Engine flexible environment runs your application in a Docker container based on a Google-provided runtime image. To install system packages like libssl-dev that are not included in the default image, you must customize the container by creating a Dockerfile that starts FROM the base runtime image and then runs apt-get install. This is the standard method for adding OS-level dependencies in the flexible environment.

Exam trap

The trap here is that candidates confuse the 'libraries' section in app.yaml (which is for Python packages) with system package installation, or mistakenly think requirements.txt can handle OS-level dependencies, leading them to pick options B or D instead of the correct Dockerfile approach.

How to eliminate wrong answers

Option A is wrong because using a custom runtime that already includes the package is an overly complex and unnecessary approach; the flexible environment already supports custom Dockerfiles, so you can simply extend the base runtime image rather than building a completely separate runtime. Option B is wrong because the 'libraries' section in app.yaml is used to specify Python libraries (e.g., Flask, Django) that are installed via pip, not system packages like libssl-dev which require apt-get. Option D is wrong because requirements.txt is for Python package dependencies installed via pip, not for system-level packages that must be installed via the operating system's package manager.

285
MCQmedium

A company wants to deploy a database for a global application that requires strong consistency across continents, with the ability to handle millions of reads and writes per second. Which Google Cloud database should they choose?

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

Spanner provides global strong consistency and high throughput.

Why this answer

Cloud Spanner is the only globally distributed, strongly consistent relational database that can handle millions of operations per second across multiple continents.

286
MCQmedium

A retail company wants to run analytics queries across their Cloud SQL PostgreSQL database and BigQuery without moving data. They need to join sales data from Cloud SQL with customer demographics in BigQuery. Which approach should they use?

A.Use BigQuery Omni to query Cloud SQL
B.Create a BigQuery external table linked to Cloud SQL
C.Use Datastream to replicate Cloud SQL to BigQuery
D.Export Cloud SQL data to GCS and load into BigQuery
AnswerB

BigQuery federated queries allow external tables for Cloud SQL.

Why this answer

BigQuery federated queries can create an external table that references Cloud SQL PostgreSQL. This allows querying Cloud SQL data directly from BigQuery and joining with BigQuery tables.

287
Multi-Selecthard

A company uses Datastream to replicate changes from an on-premises Oracle database to BigQuery. They need to also send the same change events to a custom application for real-time processing. Which TWO actions should they take? (Choose 2)

Select 2 answers
A.Configure Datastream to write to a Pub/Sub topic
B.Use Datastream to write to Cloud Bigtable
C.Set up a Cloud Function to read from BigQuery and forward to the application
D.Use Dataflow to read from GCS and publish to Pub/Sub
E.Create a Pub/Sub subscription for the application to consume
AnswersA, E

Datastream can publish CDC events directly to Pub/Sub.

Why this answer

Datastream can write to Pub/Sub, which then can be consumed by the application. Alternatively, Datastream can write to GCS (Avro/JSON) and then Pub/Sub or Dataflow can be used. The direct approach is to stream to Pub/Sub.

288
MCQeasy

A startup wants to deploy a Python web application with low traffic and minimal operational overhead. They need to automatically scale down to zero when not in use. Which compute option should they choose?

A.App Engine Standard Environment.
B.Compute Engine with managed instance group and autoscaling.
C.Google Kubernetes Engine with cluster autoscaling.
D.Cloud Run.
AnswerA, D

App Engine Standard can scale to zero when not in use and supports Python, meeting all the startup's needs with minimal overhead.

Why this answer

Both App Engine Standard Environment and Cloud Run satisfy the requirements of low traffic, minimal operational overhead, and scaling to zero. App Engine Standard can scale to zero when no requests are incoming and supports Python, making it a valid choice. Cloud Run also scales to zero automatically and is fully managed, but for a simple Python web app, App Engine Standard offers even less configuration.

Therefore, both options are correct.

Exam trap

A common pitfall is thinking that App Engine Standard cannot scale to zero, but it actually can. Cloud Run is also valid, but both are correct for this scenario.

How to eliminate wrong answers

Option A is wrong because App Engine Standard Environment, while serverless, does not support scaling to zero instances; it always keeps at least one instance warm to handle traffic, which incurs ongoing costs. Option B is wrong because Compute Engine with managed instance groups and autoscaling can scale down, but the minimum number of instances is typically 1 (or more for high availability), and it cannot scale to zero instances, plus it requires managing virtual machines. Option C is wrong because Google Kubernetes Engine with cluster autoscaling can scale down nodes, but the cluster itself requires at least one node to run the control plane and system pods, and it cannot scale to zero nodes, leading to higher operational overhead and cost.

289
MCQhard

You are designing a multi-region disaster recovery strategy for a Cloud Spanner database. The application requires read-your-writes consistency globally after failover. Which configuration should you choose?

A.Multi-region placement with two read-write regions and a witness.
B.Enterprise edition with multi-region configuration and default leader optimization.
C.Single region with multiple zones.
D.Multi-region placement with one read-write region and two read-only replicas.
AnswerD

This is the standard multi-region configuration for strong consistency and disaster recovery.

Why this answer

A multi-region placement with one read-write region and two read-only replicas provides strong consistency and failover capability while maintaining read-your-writes consistency globally. Option A is incorrect because two read-write regions with a witness can lead to write conflicts and does not guarantee read-your-writes consistency after failover without additional configuration. Option B is incorrect because enterprise edition with default leader optimization is a performance feature, not a disaster recovery configuration.

Option C is incorrect because a single region with multiple zones does not provide multi-region disaster recovery; it only provides zone-level redundancy within one region.

290
Multi-Selectmedium

A company is building a real-time leaderboard for an online game using Memorystore for Redis. They need to support millions of concurrent users, update scores frequently, and retrieve top 100 players. Which TWO features should they use? (Choose 2.)

Select 2 answers
A.Pub/sub channels for score updates
B.Keyspace notifications to detect score changes
C.Redis Sentinel for automatic failover
D.Sorted sets with ZADD and ZREVRANGE commands
E.Redis Cluster for sharding across nodes
AnswersD, E

Sorted sets store scores and support range queries for leaderboard.

Why this answer

Sorted sets are ideal for leaderboards. Redis Cluster provides horizontal scaling for high throughput. Pub/sub is for messaging, not leaderboard.

Replication provides HA but not scaling.

291
MCQeasy

A company needs a managed Redis instance for caching and pub/sub messaging in their application. Which Google Cloud service should they use?

A.Firestore
B.Memorystore for Redis
C.Cloud SQL
D.Memorystore for Memcached
AnswerB

Redis supports both caching and pub/sub, and Memorystore provides a managed service.

Why this answer

Memorystore for Redis is a managed Redis service that supports caching and pub/sub. Memorystore for Memcached only supports caching. Cloud SQL and Firestore are not caching services.

292
MCQhard

A developer is deploying an application on Compute Engine and needs to automatically apply security patches without downtime. The application runs behind a TCP load balancer. What is the best deployment strategy?

A.Use a canary deployment with a separate instance group.
B.Stop all instances, apply patches, then restart them.
C.Use a managed instance group with autohealing.
D.Use a rolling update on the instance group.
AnswerD

Rolling update gradually replaces instances with new ones that have patches, minimizing downtime while behind a load balancer.

Why this answer

A rolling update on a managed instance group allows the developer to update instances incrementally, applying security patches without downtime. The TCP load balancer automatically distributes traffic only to healthy instances, so as each instance is updated and passes health checks, traffic is seamlessly redirected away from instances being patched.

Exam trap

The PCD exam often tests the distinction between reactive mechanisms like autohealing and proactive strategies like rolling updates, leading candidates to mistakenly choose autohealing for patching when it only handles failure recovery, not scheduled maintenance.

How to eliminate wrong answers

Option A is wrong because a canary deployment with a separate instance group is typically used for testing new application versions with a small subset of traffic, not for applying security patches across all instances; it introduces unnecessary complexity and does not guarantee all instances are patched. Option B is wrong because stopping all instances simultaneously causes downtime, as the TCP load balancer would have no healthy instances to serve traffic during the patch window. Option C is wrong because autohealing only replaces instances that fail health checks due to crashes or corruption, it does not proactively apply security patches; it reacts to failures rather than preventing them.

293
MCQmedium

A team is designing a Cloud Spanner schema for a global user directory. To avoid write hotspots, which key design strategy should they use?

A.Use a UUID as the primary key
B.Use a timestamp as the primary key
C.Use a monotonically increasing integer as the primary key
D.Use a composite primary key with a user ID and a hash prefix
AnswerD

A hash prefix distributes writes across splits, avoiding hotspots.

Why this answer

Monotonically increasing keys like UUIDs or timestamps cause hotspots. Using a composite key with a hash prefix or swapping columns to distribute writes is recommended.

294
MCQmedium

You need to continuously replicate change data from an on-premises Oracle database to BigQuery for real-time analytics. Which Google Cloud service is designed specifically for this purpose?

A.Database Migration Service (DMS)
B.Cloud Dataproc
C.Datastream
D.Dataflow
AnswerC

Datastream is built for serverless CDC to BigQuery and other targets.

Why this answer

Datastream is a Google Cloud serverless change data capture (CDC) and replication service specifically designed to continuously replicate data from sources like Oracle databases to BigQuery. It handles schema drift, supports log-based CDC, and provides low-latency streaming, making it the correct choice for real-time analytics.

Exam trap

The trap here is that candidates often confuse Dataflow's general-purpose stream processing capabilities with Datastream's purpose-built CDC replication, leading them to choose Dataflow when the question explicitly asks for a service 'designed specifically for this purpose.'

How to eliminate wrong answers

Option A is wrong because Database Migration Service (DMS) is designed for one-time or bulk migrations, not continuous replication of change data for real-time analytics. Option B is wrong because Cloud Dataproc is a managed Spark/Hadoop service for batch and stream processing, not a purpose-built CDC replication tool for Oracle to BigQuery. Option D is wrong because Dataflow is a unified stream and batch processing service that can be used for CDC but requires custom pipeline development and is not a dedicated, out-of-the-box replication service like Datastream.

295
Multi-Selecteasy

A company wants to query data across Cloud SQL, Cloud Spanner, and Bigtable without moving data. They need a solution that supports standard SQL and integrates with their existing business intelligence tools. Which TWO Google Cloud capabilities should they use?

Select 1 answer
A.BigQuery Omni
B.BigQuery federated queries
C.Datastream
D.Dataflow
E.Cloud SQL cross-database queries
AnswersB

BigQuery federated queries allow you to query Cloud SQL, Cloud Spanner, and Bigtable directly using standard SQL without moving data, making it ideal for the requirement.

Why this answer

BigQuery federated queries allow you to query Cloud SQL, Cloud Spanner, and Bigtable directly using standard SQL without data movement, making it the correct solution. BigQuery Omni is designed for querying data across AWS and Azure, not for in-GCP databases like Cloud SQL, Cloud Spanner, or Bigtable. Therefore, only option B is correct.

296
MCQhard

A company's Cloud Bigtable instance is experiencing high latency and increased error rates for write requests. The Key Visualiser shows that a single row key prefix receives the majority of writes, creating a hotspot. What is the BEST long-term solution to distribute writes more evenly?

A.Add more nodes to the Bigtable cluster
B.Switch from SSD to HDD storage
C.Redesign the row key by salting with a hash or a more distributed prefix
D.Create a secondary Bigtable cluster in another region
AnswerC

Salting distributes writes across different tablets, eliminating the hotspot.

Why this answer

To avoid hot spotting, row key design should incorporate a nonce or sharding prefix to distribute writes across tablets. Salting row keys with a calculated hash or a field with high cardinality spreads the load. The Key Visualiser confirms the hotspot; redesigning the key is the correct fix.

297
MCQmedium

During a deployment to App Engine flexible environment, the new version fails to start and the logs show 'Container failed to start: context deadline exceeded'. The previous version remains serving traffic. What is the most likely cause?

A.The health check is misconfigured, causing the instance to be considered unhealthy.
B.The app requires an environment variable that is not set.
C.The container startup time exceeds the 10-minute timeout.
D.The Dockerfile has a syntax error that prevents the container from building.
AnswerC

App Engine flexible environment has a 10-minute startup timeout; if the container takes longer, it fails with this error.

Why this answer

The error 'context deadline exceeded' in App Engine flexible environment indicates that the container did not start within the allowed startup timeout. The default timeout for container startup in App Engine flexible is 10 minutes, and if the application takes longer (e.g., due to slow initialization, large dependency downloads, or database migrations), the platform kills the container and logs this error. The previous version continues serving because the new version failed to become healthy.

Exam trap

The PCD exam often tests the distinction between container startup failures (timeout) and runtime failures (health check, missing env vars), so candidates mistakenly attribute the 'context deadline exceeded' error to health check misconfiguration or missing environment variables.

How to eliminate wrong answers

Option A is wrong because a misconfigured health check would cause the instance to be marked unhealthy after startup, not prevent the container from starting; the error 'context deadline exceeded' occurs before health checks are evaluated. Option B is wrong because a missing environment variable would cause the application to fail at runtime (e.g., crash loop), not produce a container startup timeout error; the container would still start and then fail. Option D is wrong because a Dockerfile syntax error would prevent the container from building entirely, resulting in a build failure error, not a startup timeout; the error message specifically references container startup, not build.

298
MCQhard

A team is using Cloud Spanner and needs to query a secondary index with a STORING clause. What is the benefit of using STORING?

A.It creates a global index
B.It reduces storage costs
C.It allows the index to be used for ordering
D.It avoids an index join (back to the base table)
AnswerD

STORING stores column values in the index, so the query can be satisfied from the index alone.

Why this answer

STORING allows storing additional columns in the index, enabling index-only scans and avoiding a join back to the base table, improving query performance.

299
MCQeasy

A developer is writing unit tests for a Python application that will run on Cloud Functions. The function makes HTTP requests to an external API. The developer wants to avoid making actual network calls during tests. What should the developer use?

A.Use a test double to replace the entire function.
B.Use dependency injection to pass a fallback URL.
C.Deploy the function to Cloud Functions and run integration tests.
D.Mock the HTTP requests using a library like unittest.mock.
AnswerD

Mocking prevents actual HTTP calls.

Why this answer

`unittest.mock` allows the developer to replace the actual HTTP request calls (e.g., `requests.get`) with mock objects that return controlled responses, preventing any real network traffic. This is essential for unit testing Cloud Functions where external API calls must be isolated to ensure tests are fast, deterministic, and do not depend on external services.

Exam trap

The trap here is that candidates may confuse integration testing (Option C) with unit testing, or think that dependency injection (Option B) inherently avoids network calls, when in fact it only changes the endpoint without eliminating the call itself.

How to eliminate wrong answers

Option A is wrong because replacing the entire function with a test double would defeat the purpose of unit testing the function's logic; it would test the double, not the actual code. Option B is wrong because dependency injection with a fallback URL still requires making an HTTP request to that URL, which does not avoid actual network calls. Option C is wrong because deploying to Cloud Functions and running integration tests involves real network calls and is the opposite of what the developer wants—unit tests should avoid external dependencies.

300
Multi-Selecthard

A company uses Cloud Spanner for a globally distributed application. They need to capture all changes from a Spanner table and send them to a BigQuery dataset for real-time analytics. Which THREE Google Cloud services or features should they use?

Select 3 answers
A.Dataflow
B.Spanner change streams
C.Datastream
D.Cloud Functions
E.BigQuery
AnswersA, B, E

Processes change stream data and writes to BigQuery.

Why this answer

Spanner change streams capture row-level changes. Dataflow can read from change streams and write to BigQuery. Pub/Sub can be an intermediary but is not required; Dataflow can directly write to BigQuery.

However, the typical architecture uses Pub/Sub for decoupling. The question expects the three core components: change streams, Dataflow, and BigQuery.

Page 3

Page 4 of 13

Page 5