Courseiva

Google Professional Cloud Developer (PCD) — Questions 901964

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

Page 12

Page 13 of 13

901
Multi-Selectmedium

A company is deploying a microservices application on Google Cloud. They need a database for each service: one for user profiles (relational, high availability), one for product catalog (NoSQL, low latency), and one for session caching. Which THREE services should they use? (Select 3 answers)

Select 3 answers
A.Firestore
B.Cloud Spanner
C.Bigtable
D.Memorystore
E.Cloud SQL
AnswersA, D, E

NoSQL document database with low latency for product catalog.

Why this answer

Cloud SQL for relational user profiles with HA, Firestore for NoSQL product catalog with low latency, Memorystore for session caching.

902
MCQeasy

A developer deploys a containerized application on Cloud Run. The application needs to access a Cloud SQL instance securely without exposing it to the internet. What is the best practice?

A.Whitelist the Cloud Run IP range in Cloud SQL authorized networks.
B.Use Cloud Run's VPC connector and configure private IP for Cloud SQL.
C.Use a Cloud SQL proxy sidecar container in the same pod.
D.Use Cloud NAT to route traffic.
AnswerB

This is the best practice for secure access.

Why this answer

Cloud Run services cannot directly connect to Cloud SQL using private IP without a VPC connector. The VPC connector allows Cloud Run to send traffic to a VPC network, where the Cloud SQL instance with a private IP resides, ensuring traffic never traverses the public internet. This is the recommended pattern for secure, low-latency access to Cloud SQL from serverless environments.

Exam trap

The PCD exam often tests the misconception that Cloud SQL proxy can be run as a sidecar in Cloud Run, but Cloud Run's single-container-per-instance model means the proxy must be bundled into the same container image or deployed as a separate service, not as a sidecar in the Kubernetes sense.

How to eliminate wrong answers

Option A is wrong because Cloud Run does not have a static, whitelistable IP range; its egress IPs are ephemeral and shared, making IP-based allowlisting unreliable and insecure. Option C is wrong because Cloud Run does not support sidecar containers in the same pod; it runs a single container per instance, and the Cloud SQL proxy must be deployed as a separate service or within the same container image, not as a sidecar. Option D is wrong because Cloud NAT is used for outbound internet access from private VMs, not for routing traffic to Cloud SQL private IP; it does not enable connectivity from serverless services like Cloud Run to a VPC.

903
MCQmedium

You are building a data pipeline that ingests streaming data from thousands of IoT devices. The devices send JSON payloads to a Cloud Pub/Sub topic. You want to process the data in near real-time and store the results in BigQuery for analytics. You also need to handle occasional schema changes in the incoming data (new fields added) without manual intervention. You have set up a Dataflow streaming pipeline using Apache Beam to read from Pub/Sub and write to BigQuery. The pipeline uses the `WriteToBigQuery` transform with `createDisposition=CREATE_NEVER` and `writeDisposition=WRITE_APPEND`. Recently, a batch of devices started sending a new field `temperature_celsius` that does not exist in the BigQuery schema. The pipeline logs errors and the data is not written. You need to modify the pipeline to automatically handle such schema evolution. What should you do?

A.Change `createDisposition` to `CREATE_IF_NEEDED` and ensure the BigQuery table schema has `autodetect=true` or is updated to allow new fields.
B.Manually update the BigQuery table schema to include the new field and then restart the pipeline.
C.Write the raw JSON payloads to Cloud Storage and use a Cloud Function to load them into BigQuery every 10 minutes with schema autodetect.
D.Use a `ParDo` transform to flatten all JSON fields into a fixed schema by ignoring unknown fields.
AnswerA

`CREATE_IF_NEEDED` will add new columns automatically if the schema is flexible.

Why this answer

With `createDisposition=CREATE_IF_NEEDED`, BigQuery will automatically add new fields if the schema allows updates. This is the simplest approach. Option B is wrong because manually updating the schema and restarting the pipeline defeats the purpose of automation and requires manual intervention.

Option C is wrong because storing raw data in Cloud Storage and using Cloud Functions loses real-time capability and adds complexity. Option D is wrong because using a `ParDo` to flatten or ignore unknown fields discards data and does not handle schema evolution properly.

904
MCQhard

What conclusion can be drawn from these traces?

A.The overall request latency is 300ms.
B.The sendConfirmation span is failing.
C.The processPayment span is the bottleneck.
D.The validateCart span has errors.
AnswerC

It accounts for half the total latency, making it the primary contributor.

Why this answer

The trace shows that the 'processPayment' span has the longest duration (300ms) compared to the other spans, indicating it is the primary contributor to the overall latency. In distributed tracing, the span with the highest execution time is typically the bottleneck, as it delays the completion of the entire request. The other spans complete quickly, so optimizing 'processPayment' would yield the greatest performance improvement.

Exam trap

The PCD exam often tests the misconception that the longest span in a trace is always the bottleneck, but the trap here is that candidates might confuse total request latency with span duration or overlook parallel execution, leading them to pick the overall latency value (Option A) instead of identifying the specific slow span.

How to eliminate wrong answers

Option A is wrong because the overall request latency is the sum of the spans' durations, but the trace shows overlapping spans (e.g., 'validateCart' and 'sendConfirmation' run in parallel), so the total latency is not simply 300ms; it is the end-to-end time from the root span start to finish, which is 300ms in this case, but the question asks for a conclusion about bottlenecks, not a direct latency value. Option B is wrong because the 'sendConfirmation' span completes successfully with no error status or exception logged; a failing span would show an error tag or a non-zero status code. Option D is wrong because the 'validateCart' span has no error indicators (e.g., no error tag, no exception, and its duration is normal), so there is no evidence of errors in that span.

905
MCQhard

During an Oracle to Cloud SQL for PostgreSQL migration using DMS, the full dump phase completes successfully, but the CDC phase fails with a 'missing table' error. What is the most likely cause?

A.The source Oracle database does not have archivelog enabled.
B.The Cloud SQL instance does not have enough storage to accommodate CDC logs.
C.The DMS connection profile for the source is misconfigured.
D.Some tables in the source database lack primary keys or a valid replica identity.
AnswerD

CDC requires a primary key or replica identity to track changes; without it, DMS cannot replicate changes.

Why this answer

CDC typically requires a primary key or replica identity on each table to track changes. If tables lack these, CDC may fail. DMS expects tables to have primary keys or a valid replica identity for logging.

906
MCQmedium

You are designing a CI/CD pipeline using Cloud Build. You want to automatically trigger a build when code is pushed to a specific branch in Cloud Source Repositories. What is the correct configuration?

A.Create a Cloud Function that invokes Cloud Build via API when a push event occurs.
B.Add a build step in cloudbuild.yaml that polls the repository.
C.Configure a Cloud Pub/Sub topic to notify Cloud Build on push events.
D.Create a build trigger in Cloud Build with a regex pattern for the branch name.
AnswerD

Build triggers with branch patterns are the correct approach.

Why this answer

Cloud Build natively supports build triggers that can be configured to automatically start a build when code is pushed to a specific branch in Cloud Source Repositories. The trigger uses a regex pattern to match the branch name, and Cloud Build listens for repository push events directly without requiring additional services.

Exam trap

The PCD exam often tests the misconception that Cloud Pub/Sub is always required for event-driven triggers, but Cloud Build has a native trigger integration with Cloud Source Repositories that bypasses Pub/Sub entirely.

How to eliminate wrong answers

Option A is wrong because creating a Cloud Function to invoke Cloud Build via API is an unnecessary workaround; Cloud Build already has built-in trigger functionality for Cloud Source Repositories. Option B is wrong because adding a build step that polls the repository is inefficient and violates the event-driven design of CI/CD; Cloud Build triggers are event-driven, not polling-based. Option C is wrong because while Cloud Pub/Sub can be used with Cloud Build, it is not required for Cloud Source Repositories; Cloud Build directly integrates with Cloud Source Repositories via its own trigger system without needing a Pub/Sub topic.

907
MCQmedium

A company needs to run AlloyDB for PostgreSQL with a read pool that can automatically scale based on load. They also need to run a local instance on-premises for disaster recovery. Which features should they use?

A.Use AlloyDB with read replicas in the same region and Cloud SQL for on-premises
B.Use AlloyDB with a single instance and use Bigtable for on-premises
C.Use AlloyDB with cross-region replication to another cloud region
D.Use AlloyDB with auto-scaling read pool and AlloyDB Omni for on-premises
AnswerD

AlloyDB read pools auto-scale, and AlloyDB Omni can replicate to on-premises.

Why this answer

AlloyDB read pools support auto-scaling. For on-premises disaster recovery, AlloyDB Omni provides a downloadable version that can run on-premises and replicate from the cloud. Cross-region replication is for cloud-to-cloud, not on-premises.

908
MCQmedium

A gaming company uses Cloud Spanner for its global leaderboard. The leaderboard is updated frequently by millions of users. They notice that write latency spikes during peak hours due to hotspotting on the leaderboard table. Which schema change would best mitigate this?

A.Prefix the primary key with a server ID or hash of the user ID
B.Use UUID as the primary key
C.Add a secondary index on the rank column
D.Enable leaderboard caching with Memorystore
AnswerA

This distributes writes across multiple splits, reducing contention.

Why this answer

Using a composite primary key with a hash prefix (e.g., server_id) as the first part distributes writes across splits, reducing hotspots. A monotonically increasing key (like rank) causes hotspotting.

909
MCQeasy

A company is migrating from Snowflake to BigQuery. They have a large amount of historical data. What is the recommended service to automate the data transfer?

A.Database Migration Service
B.Cloud Storage Transfer Service
C.Cloud Data Fusion
D.BigQuery Data Transfer Service
AnswerD

DTS for Snowflake is the native service for this migration.

Why this answer

BigQuery Data Transfer Service supports Snowflake as a source, allowing scheduled and automated transfers of data to BigQuery.

910
Multi-Selectmedium

Your company is migrating a 2 TB Oracle database to Cloud SQL for PostgreSQL using Database Migration Service (DMS). The source database is behind a firewall and only allows connections from specific IP ranges. The migration must have minimal downtime. Which TWO actions should you take? (Choose 2 options.)

Select 2 answers
A.Set up a Compute Engine VM as a proxy and whitelist its static IP in the source firewall.
B.Create a continuous migration job in Database Migration Service.
C.Use Cloud SQL Auth Proxy to connect DMS to the source database.
D.Expose the source database on a public IP with SSL.
E.Configure Database Migration Service to use a one-time migration job.
AnswersA, B

This allows DMS to connect via the proxy with a known IP.

Why this answer

For minimal downtime, continuous migration is needed. To connect to the source behind a firewall, you need either VPC peering with a VPN or a Compute Engine forwarding proxy with a whitelisted IP. Cloud SQL Auth Proxy is for connecting to Cloud SQL, not for source connectivity.

A one-time migration would cause downtime.

911
MCQeasy

An engineer needs to create a Cloud SQL instance with SSD storage. Which storage type should they select for best performance?

A.HDD (hard disk drive)
B.Local SSD
C.Persistent disk standard
D.SSD (solid-state drive)
AnswerD

SSD provides the best performance for databases.

Why this answer

SSD (solid-state drive) is the recommended storage type for Cloud SQL instances when best performance is required. SSD provides lower latency and higher IOPS compared to HDD, making it suitable for transactional workloads and real-time applications. Cloud SQL supports both SSD and HDD, but SSD is the default and optimal choice for production databases.

Exam trap

Google often tests the misconception that Local SSD is available for Cloud SQL, but it is only an option for Compute Engine instances, not for managed database services like Cloud SQL.

How to eliminate wrong answers

Option A is wrong because HDD (hard disk drive) offers significantly lower IOPS and higher latency than SSD, making it unsuitable for performance-sensitive database workloads in Cloud SQL. Option B is wrong because Local SSD is not supported as a storage type for Cloud SQL instances; it is used with Compute Engine instances for ephemeral, high-performance scratch storage. Option C is wrong because Persistent disk standard is a general-purpose block storage option for Compute Engine, but Cloud SQL does not offer it as a selectable storage type; Cloud SQL only provides SSD and HDD options.

912
MCQmedium

A company plans to migrate a 200 GB Oracle database to Cloud SQL for PostgreSQL with minimal downtime. The source database has complex stored procedures and triggers. Which approach should the company use?

A.Use DMS with a one-time migration job and schedule downtime.
B.Export the Oracle database to a dump file and import into Cloud SQL using pg_restore.
C.Use DMS with continuous migration but skip Ora2Pg; DMS automatically converts PL/SQL to PL/pgSQL.
D.Use DMS with a continuous migration job, use Ora2Pg for schema conversion, and connect via Cloud SQL Auth Proxy.
AnswerD

Continuous migration with CDC achieves minimal downtime; Ora2Pg converts schema; Cloud SQL Auth Proxy connects securely.

Why this answer

Database Migration Service supports continuous migration with CDC for minimal downtime. Ora2Pg is used for schema conversion including stored procedures. Cloud SQL Auth Proxy provides secure connectivity without VPC peering.

913
MCQmedium

You need to back up a Cloud Spanner database and store it in a different region for disaster recovery. The backup should be a full database export. What is the recommended method?

A.Use the gcloud command to export the database to Cloud Storage as Avro
B.Use pg_dump to export Spanner data
C.Use Bigtable managed backups
D.Use Cloud SQL automated backups
AnswerA

gcloud spanner databases export exports to Avro in GCS; can be restored in another region.

Why this answer

The recommended method for backing up a Cloud Spanner database for disaster recovery is to use the `gcloud` command to export the database to Cloud Storage in Avro format. This creates a full database export that can be stored in a different region, enabling restoration in case of a regional failure. Cloud Spanner does not support native backup to other regions; instead, you must export the data to Cloud Storage and then import it into a new instance in the target region.

Exam trap

Google often tests the distinction between database services by presenting backup methods from other Google Cloud databases (Cloud SQL, Bigtable) as plausible options, exploiting the candidate's confusion about which tool applies to Cloud Spanner.

How to eliminate wrong answers

Option B is wrong because pg_dump is a PostgreSQL utility and Cloud Spanner is not PostgreSQL-based; it uses Google's proprietary distributed SQL engine, so pg_dump cannot connect to or export Spanner data. Option C is wrong because Bigtable managed backups are designed for Cloud Bigtable, a NoSQL wide-column database, not for Cloud Spanner's relational SQL database. Option D is wrong because Cloud SQL automated backups are for Cloud SQL (MySQL, PostgreSQL, SQL Server), not for Cloud Spanner, which has its own export/import mechanism via gcloud or the console.

914
Multi-Selectmedium

A company is building a data processing pipeline that needs to ingest events from multiple sources, process them in order, and handle failures with retry. They also need to schedule periodic tasks. Which THREE services should they use? (Choose 3)

Select 3 answers
A.Cloud Scheduler
B.Cloud Tasks
C.Cloud Workflows
D.Cloud Pub/Sub
E.Cloud Logging
AnswersA, B, D

Cloud Scheduler can trigger periodic tasks.

Why this answer

Cloud Pub/Sub for ingesting events with ordering, Cloud Tasks for retry handling, and Cloud Scheduler for scheduling periodic tasks. Cloud Workflows is for orchestration, Cloud Logging is for logs.

915
MCQmedium

A team created the instance template above and used it in a managed instance group. However, instances fail to serve web traffic. What is the most likely cause?

A.The startup script does not configure a firewall rule to allow HTTP traffic.
B.The image family debian-11 does not have the necessary packages.
C.The machine type e2-medium is too small for Nginx.
D.The instance template is missing a service account.
AnswerA

The default VPC firewall rules only allow SSH and ICMP. An ingress rule for HTTP (port 80) is needed for Nginx to serve traffic.

Why this answer

The instance template likely includes a startup script that installs and starts Nginx, but does not configure a firewall rule (e.g., via `gcloud compute firewall-rules create` or `iptables`) to allow inbound HTTP traffic on port 80. By default, GCP VPC firewall rules deny all ingress traffic unless explicitly allowed, so even if Nginx is running, external requests will be blocked. This is the most common reason why a managed instance group fails to serve web traffic despite the application being installed.

Exam trap

The PCD exam often tests the misconception that installing and starting a web server (like Nginx) is sufficient to serve traffic, ignoring the separate requirement for network-level firewall rules to allow inbound connections.

How to eliminate wrong answers

Option B is wrong because the Debian 11 image family includes all necessary packages to install Nginx via `apt-get`, and the startup script can install them; the image itself does not need to have Nginx pre-installed. Option C is wrong because e2-medium (2 vCPUs, 4 GB memory) is more than sufficient to run Nginx, which has minimal resource requirements. Option D is wrong because a service account is not required for a startup script to install and run Nginx; it is only needed if the script needs to call GCP APIs (e.g., to create firewall rules), but the failure to serve traffic is due to missing firewall rules, not the absence of a service account.

916
Multi-Selectmedium

You are designing a globally distributed ecommerce platform that uses Cloud Spanner for order processing. The platform needs to support high read throughput with low latency for product catalog queries. Which two features should you use? (Choose TWO.)

Select 2 answers
A.Stale reads with bounded staleness
B.Global secondary indexes
C.Interleaved tables
D.Local secondary indexes
E.Strong reads
AnswersA, D

Stale reads can be served by read-only replicas, improving read throughput and latency for non-critical queries.

Why this answer

Stale reads with bounded staleness (Option A) allow Cloud Spanner to serve read requests from any replica within a configurable time window (e.g., up to 15 seconds), avoiding the latency of contacting the leader replica. This dramatically increases read throughput for product catalog queries where near-real-time data is acceptable. Local secondary indexes (Option D) are co-located with the base table data in the same split, enabling efficient, low-latency queries on attributes within a single region without cross-node coordination.

Exam trap

A common misconception is that all secondary indexes are global and that strong reads are always required for consistency, but the trap here is that for high-throughput, low-latency catalog queries, stale reads and local secondary indexes are the correct choices because they avoid leader bottlenecks and cross-split coordination.

917
MCQmedium

A team notices that a Cloud Run service occasionally returns HTTP 500 errors. They have enabled Cloud Error Reporting. What is the best way to rapidly diagnose the root cause of these errors?

A.Search Cloud Logging manually for '500' events.
B.View the Cloud Trace dashboard for error traces.
C.Create a Cloud Monitoring dashboard for 5xx metrics.
D.Examine the error group details in Cloud Error Reporting.
AnswerD

Error Reporting aggregates errors and links to Stackdriver.

Why this answer

Cloud Error Reporting automatically groups similar errors (like HTTP 500s) into error groups, providing stack traces, request details, and occurrence timelines. Examining the error group details is the fastest path to root cause because it surfaces the exact exception and context without requiring manual log filtering or metric setup.

Exam trap

The PCD exam often tests the distinction between monitoring (Cloud Monitoring metrics) and error diagnosis (Cloud Error Reporting), tempting candidates to choose a metric dashboard when the question explicitly asks for rapid root cause diagnosis.

How to eliminate wrong answers

Option A is wrong because manually searching Cloud Logging for '500' events is time-consuming and lacks automatic grouping, stack traces, and deduplication that Error Reporting provides. Option B is wrong because Cloud Trace focuses on latency and distributed tracing for requests, not on aggregating or diagnosing HTTP 500 error details. Option C is wrong because a Cloud Monitoring dashboard for 5xx metrics shows trends and alerting but does not provide the specific error messages, stack traces, or request context needed to identify the root cause.

918
MCQmedium

A team plans to migrate an Oracle database to Cloud SQL for PostgreSQL. They have identified complex PL/SQL packages that need conversion. Which open-source tool is specifically designed to assist with schema conversion from Oracle to PostgreSQL?

A.Ora2Pg
B.Database Migration Service
C.pgloader
D.Liquibase
AnswerA

Ora2Pg converts Oracle schemas to PostgreSQL, including PL/SQL to PL/pgSQL.

Why this answer

Ora2Pg is an open-source tool specifically designed to automate the migration of Oracle databases to PostgreSQL. It converts Oracle PL/SQL code, including complex packages, procedures, and functions, into PostgreSQL-compatible PL/pgSQL, and also handles schema objects like tables, views, sequences, and indexes. This makes it the correct choice for the team's need to convert complex PL/SQL packages.

Exam trap

The trap here is that candidates may confuse pgloader's data loading capabilities with schema conversion, or assume Database Migration Service is open-source, when in fact the question specifically asks for an open-source tool designed for schema conversion from Oracle to PostgreSQL.

How to eliminate wrong answers

Option B is wrong because Database Migration Service (DMS) is a fully managed service for migrating databases to Google Cloud, but it is not an open-source tool; it is a proprietary Google Cloud service. Option C is wrong because pgloader is an open-source tool for loading data into PostgreSQL, but it focuses on data migration from sources like MySQL, SQLite, and MS SQL Server, not on converting Oracle PL/SQL packages or schema objects. Option D is wrong because Liquibase is an open-source database schema change management tool that uses changelogs to track and apply schema modifications, but it does not specialize in converting Oracle PL/SQL to PostgreSQL syntax.

919
MCQhard

You need to migrate an Oracle database to Cloud SQL for PostgreSQL. The schema must be converted using Oracle to PostgreSQL migration tools. Which tool should you use to automate schema conversion?

A.Cloud Dataflow
B.pg_dump
C.Ora2Pg
D.Database Migration Service (DMS)
AnswerC

Ora2Pg is the standard tool for converting Oracle schemas to PostgreSQL.

Why this answer

Ora2Pg is an open-source tool for converting Oracle schemas, data, and procedures to PostgreSQL.

920
MCQhard

A financial trading application uses Cloud Spanner for order processing. To reduce latency for read-heavy operations, the team wants to allow stale reads with a bounded staleness of 10 seconds. Which Spanner API or method should they use to achieve this?

A.Set the session to read-only mode
B.Use the `timestamp_bound` parameter with `max_staleness` set to 10 seconds
C.Configure an index with the `STORING` clause to avoid index joins
D.Use mutations API instead of DML for writes
AnswerB

Spanner's API allows setting `max_staleness` for bounded stale reads, reducing latency.

Why this answer

Spanner supports stale reads (bounded staleness) by setting a read timestamp. The read timestamp can be set to a past time within the maximum staleness. The `max_staleness` option in the client libraries or the `read_timestamp` parameter in gRPC API allow bounded staleness.

921
MCQhard

You are building a data pipeline using Cloud Dataflow (Apache Beam). The pipeline reads from Pub/Sub, performs aggregations, and writes to BigQuery. Occasionally, you see duplicates in the BigQuery output, even though the pipeline uses .withInsertId() in the BigQuery write transform. What could be causing these duplicates?

A.You are not using the exactly-once sink option for BigQuery
B.You have set .withOutputParallelization() to false
C.The pipeline is using at-least-once mode and bundles are being retried, but the insertId is not being reused across retry attempts
D.You need to enable Dataflow's built-in deduplication using the .withIdAttribute() in Pub/Sub read
AnswerC

If the insertId is generated per element per attempt, duplicates can occur on retry.

Why this answer

Cloud Dataflow (Apache Beam) operates in at-least-once mode by default, meaning bundles may be retried during processing. When a bundle is retried, the insertId set via .withInsertId() must be reused across retry attempts to enable BigQuery's deduplication. If the insertId is not reused (e.g., because it's generated per attempt or not properly propagated), BigQuery treats each write as a separate row, resulting in duplicates.

Exam trap

The PCD exam often tests the misconception that .withInsertId() alone guarantees exactly-once delivery, when in fact it requires the insertId to be stable across retries, and candidates may overlook the default at-least-once processing mode of Dataflow.

How to eliminate wrong answers

Option A is wrong because BigQuery's exactly-once sink is not a configurable option; BigQuery uses insertId-based deduplication for streaming inserts, and there is no separate 'exactly-once sink' toggle. Option B is wrong because .withOutputParallelization() controls whether output is parallelized across workers, not retry behavior or deduplication; setting it to false would not cause duplicates. Option D is wrong because .withIdAttribute() in Pub/Sub read is used to extract a unique message ID for deduplication within the pipeline, but the question specifically states duplicates appear in BigQuery output despite using .withInsertId(), indicating the issue is with insertId reuse across retries, not with Pub/Sub message deduplication.

922
MCQeasy

A development team needs a serverless NoSQL document database for a new mobile application that requires offline synchronization for users. The database should scale automatically and integrate with Firebase Authentication. Which Google Cloud database meets these requirements?

A.Memorystore for Redis
B.Cloud SQL
C.Firestore
D.Cloud Bigtable
AnswerC

Firestore is the correct choice: serverless, document-based, with offline sync and FirebaseAuth integration.

Why this answer

Firestore provides serverless NoSQL document storage, automatic scaling, offline sync, and integration with Firebase Authentication.

923
MCQmedium

A team is investigating increased latency in a web application deployed on Google Kubernetes Engine (GKE). They want to identify which specific service calls are slow. Which Google Cloud tool should they use?

A.Cloud Trace
B.Cloud Monitoring dashboards
C.Cloud Profiler
D.Cloud Logging
AnswerA

Trace enables end-to-end latency analysis across services.

Why this answer

Cloud Trace is the correct tool because it provides end-to-end latency tracking for requests in distributed systems, including GKE. It captures detailed spans for each service call, allowing the team to pinpoint which specific microservice or API call is causing the increased latency. This aligns directly with the need to identify slow service calls in a web application.

Exam trap

The trap here is that candidates confuse Cloud Monitoring dashboards (which show aggregate metrics) with Cloud Trace (which provides per-request latency breakdowns), leading them to choose a tool that cannot isolate specific slow service calls.

How to eliminate wrong answers

Option B is wrong because Cloud Monitoring dashboards aggregate metrics like CPU, memory, and request counts but do not provide per-request trace data or identify which specific service calls are slow. Option C is wrong because Cloud Profiler focuses on identifying CPU and memory hotspots within application code, not on tracing the latency of individual service calls across distributed services. Option D is wrong because Cloud Logging collects and stores log entries but lacks the distributed tracing capability to correlate latency across service boundaries.

924
MCQmedium

An engineer notices high CPU utilization on a Cloud Spanner instance and wants to identify the queries consuming the most resources. Which tool should they use?

A.Cloud Monitoring (Stackdriver) dashboards for Spanner.
B.Key Visualizer for Bigtable.
C.Cloud Logging with query logs.
D.Query Insights for Spanner.
AnswerD

Query Insights provides detailed per-query metrics including CPU and latency.

Why this answer

Cloud Spanner's Query Insights provides query performance statistics, including CPU usage, latency, and execution counts. It helps identify problematic queries. Stackdriver (Cloud Monitoring) shows overall metrics but not per-query details.

Key Visualizer is for Bigtable. Cloud Logging can show logs but not specific query resource consumption.

925
MCQeasy

A data engineering team needs to migrate a 10 TB Teradata data warehouse to BigQuery. They want to automate the migration of historical data and ongoing changes. Which Google Cloud service should they use?

A.Dataproc
B.Cloud Data Fusion
C.BigQuery Data Transfer Service
D.Cloud SQL for PostgreSQL
AnswerC

BigQuery Data Transfer Service supports scheduled transfers from Teradata, including incremental loads.

Why this answer

BigQuery Data Transfer Service can automate data transfers from Teradata (and other sources) into BigQuery. It handles both historical and incremental loads.

926
MCQmedium

An organization is migrating a Teradata data warehouse to BigQuery. They want to minimize manual SQL rewriting. Which approach is most effective for converting Teradata SQL to BigQuery-compatible SQL?

A.Use BigQuery Data Transfer Service for Teradata to automate migration.
B.Use gcloud command-line tool to export Teradata data and import into BigQuery.
C.Manually rewrite all Teradata SQL queries to BigQuery syntax.
D.Use Cloud SQL to create a linked server to Teradata.
AnswerC

Manual rewriting directly addresses SQL conversion, though some tools can assist, manual effort is often needed for dialect differences.

Why this answer

BigQuery Data Transfer Service for Teradata only migrates data and schema, not SQL queries. To convert Teradata SQL to BigQuery-compatible syntax, manual rewriting is required or use of a dedicated SQL conversion tool. Option C correctly identifies this approach, as manual rewriting directly addresses SQL conversion challenges.

927
MCQhard

A DevOps engineer is designing a row key for a Bigtable table storing user activity logs. The pattern is: user_id (UUID) + timestamp. On a cluster with 10 nodes, they observe severe hotspotting on a single node during peak writes. Which row key design change would likely resolve this issue?

A.Use a hash of the user_id as the prefix
B.Use a single table with no row key change
C.Increase the number of nodes to 20
D.Use a composite key: timestamp + user_id
AnswerA

Correct. Hashing the user_id as the prefix randomizes row keys, distributing writes evenly across tablets and eliminating hotspotting.

Why this answer

The correct approach to mitigate hotspotting in Bigtable. Using a hash of the user_id as the row key prefix ensures uniform distribution of writes across tablets because the hash function randomizes the prefix, eliminating sequential patterns. Option D (timestamp + user_id) can still cause hotspotting if timestamps are strictly monotonically increasing, as all writes would target the same tablet at any given moment.

While timestamps from multiple distributed sources may vary, this design is less robust than hashing and not a guaranteed solution. Therefore, only Option A reliably resolves the hotspotting issue.

Exam trap

A common misconception is that reversing the key order (timestamp + user_id) always resolves hotspotting. In reality, if timestamps are monotonically increasing, this design still causes all writes to hit the same tablet temporarily. Hashing the user_id prefix is the more reliable and recommended approach.

How to eliminate wrong answers

Option B is wrong because keeping the same row key pattern (user_id + timestamp) does not address the hotspotting; if user_ids are sequential or timestamp-heavy, writes still concentrate on one tablet server. Option C is wrong because increasing nodes to 20 does not fix the root cause—hotspotting is a data distribution problem, not a capacity issue; more nodes will still see skewed load if the row key design is poor. Option D is wrong because swapping to timestamp + user_id makes the timestamp the prefix, which causes all writes at the same time to hit the same tablet, worsening hotspotting rather than resolving it.

928
MCQeasy

A company is migrating a stateful application to Google Cloud. They need high availability with automatic failover across zones within a region. Which compute option should they choose?

A.App Engine Standard Environment
B.Cloud Run
C.Google Kubernetes Engine with Regional Persistent Disk
D.Compute Engine with standard persistent disk
AnswerC

Regional Persistent Disk provides synchronous replication across zones, enabling automatic failover for stateful workloads on GKE.

Why this answer

Google Kubernetes Engine (GKE) with Regional Persistent Disk is the correct choice because it provides synchronous replication of data across multiple zones within a region, enabling automatic failover for stateful applications. When a pod or node fails in one zone, the Regional Persistent Disk can be immediately attached to a pod in another zone, ensuring high availability without data loss. This meets the requirement for stateful workloads that need zone-level resilience.

Exam trap

The PCD exam often tests the misconception that any managed service (like Cloud Run or App Engine) inherently provides high availability for stateful workloads, but candidates must remember that stateful applications require persistent, zone-redundant storage, which only GKE with Regional Persistent Disk offers among these options.

How to eliminate wrong answers

Option A is wrong because App Engine Standard Environment is a fully managed, stateless platform that does not support persistent storage or automatic failover across zones for stateful applications. Option B is wrong because Cloud Run is a serverless compute platform designed for stateless containers; it lacks native support for persistent disks and automatic cross-zone failover for stateful data. Option D is wrong because Compute Engine with standard persistent disk stores data only within a single zone; if that zone fails, the disk becomes inaccessible, and there is no built-in automatic failover mechanism.

929
MCQmedium

A team is designing a Cloud Bigtable schema for a time-series application that records sensor readings every second. They need to avoid write hotspots. Which row key design is most appropriate?

A.Use a salted timestamp where salt is the sensor ID modulo a small number
B.Use a composite key with sensor ID followed by reversed timestamp
C.Use a UUID as the row key
D.Use a monotonically increasing timestamp as the row key
AnswerB

Sensor ID spreads data, and reversed timestamp avoids sequential writes to the same tablet.

Why this answer

To avoid hotspots, row keys should be designed to distribute writes across tablets. Using a composite key with sensor ID followed by reversed timestamp (e.g., `[sensor_id]#[reversed_timestamp]`) ensures that writes for different sensors go to different tablets, and even for the same sensor, the reversed timestamp spreads writes over multiple tablets rather than appending to the same tablet.

930
MCQmedium

A social media app uses Firestore in Native mode. The app has a feature that shows a user's recent posts. The query sorts by timestamp descending and limits to 10 results. As the user base grows, the queries become slow. Which optimization should you implement FIRST?

A.Increase the Firestore quota for reads
B.Create a composite index on (user_id, timestamp) for the posts collection
C.Use Cloud SQL for this query instead of Firestore
D.Denormalize the user’s recent posts into a subcollection
AnswerB

A composite index on (user_id, timestamp) allows Firestore to efficiently filter by user and order by timestamp.

Why this answer

The query filters by `user_id` and sorts by `timestamp` descending, which requires a composite index on `(user_id, timestamp DESC)` to avoid a full collection scan. Without this index, Firestone performs a sort in memory, which becomes slow as the dataset grows. Creating the composite index allows Firestore to serve the query directly from the index, dramatically improving performance.

Exam trap

The trap here is that candidates often assume Firestore automatically handles all sorting or that increasing quotas or denormalizing data will fix performance, when in fact the missing composite index is the single most impactful first optimization for this query pattern.

How to eliminate wrong answers

Option A is wrong because increasing the Firestore read quota does not address the root cause of slow queries; it only raises the limit on the number of reads, not the speed of index-based retrieval. Option C is wrong because migrating to Cloud SQL would introduce relational overhead and latency for a simple document-based query, and Firestore is designed for exactly this kind of real-time, sorted query when properly indexed. Option D is wrong because denormalizing recent posts into a subcollection would require maintaining duplicate data and still need an index on `(user_id, timestamp)` within that subcollection; it adds complexity without solving the missing index issue.

931
MCQmedium

An engineer is using Database Migration Service for a continuous migration from on-premises Oracle to Cloud SQL for PostgreSQL. The migration job has completed the full dump and is now in the CDC phase. The engineer wants to perform a zero-downtime cutover. What action should they take?

A.Promote the Cloud SQL replica to make it a standalone instance
B.Recreate the Cloud SQL instance and restart the migration
C.Stop the source database and then promote the Cloud SQL replica
D.Delete the migration job and manually import data
AnswerA

Promoting the replica stops replication and makes it a writable primary, achieving zero-downtime cutover.

Why this answer

Promoting the replica stops replication and makes the Cloud SQL instance writeable. This is the standard cutover procedure in DMS for continuous migration jobs.

932
MCQhard

A company is using Cloud Monitoring to track custom metrics published from an on-premises application using the Monitoring API. The metrics are published every 30 seconds. The team wants to create an alert that fires if the metric goes below a threshold for more than 1 minute. Which alert condition type should they use?

A.Metric type: custom.googleapis.com, condition: metric lower bound, duration: 60s
B.Metric type: custom.googleapis.com, condition: metric change, duration: 60s
C.Metric type: custom.googleapis.com, condition: metric absence, duration: 60s
D.Metric type: custom.googleapis.com, condition: metric threshold (below value), duration: 60s
AnswerD

Threshold condition with direction 'below' and duration 60s works for a value below threshold for 1 minute.

Why this answer

The requirement is to fire an alert when the metric value goes below a threshold for more than 1 minute. The 'metric threshold (below value)' condition type directly monitors a metric against a lower bound and evaluates the condition over the specified duration (60s) before triggering. This aligns with the need to detect sustained low values, not just a single data point.

Exam trap

The PCD exam often tests the distinction between 'metric absence' (no data) and 'metric threshold below' (data exists but is low), leading candidates to mistakenly choose absence when the scenario describes a value-based condition.

How to eliminate wrong answers

Option A is wrong because 'metric lower bound' is not a valid condition type in Cloud Monitoring; the correct term is 'metric threshold' with a 'below' or 'above' comparator. Option B is wrong because 'metric change' condition tracks the rate of change (increase or decrease) between data points, not a static threshold violation, and is used for anomaly detection rather than sustained low values. Option C is wrong because 'metric absence' fires when no data is received for the metric (i.e., missing time series), which is different from the metric value being below a threshold; the question explicitly states the metric is published every 30 seconds, so absence is not the issue.

933
Drag & Dropmedium

Drag and drop the steps to create a Cloud Run service 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

Creating a Cloud Run service involves selecting the container image and configuring settings before deployment.

934
MCQmedium

A media streaming company uses Cloud Storage to store video files. Users upload files through a web application, and the files are streamed directly from Cloud Storage. They want to reduce latency for users in different regions. Which configuration should they apply?

A.Enable Object Lifecycle Management to move objects to Nearline storage.
B.Configure Cloud Storage transfer service to replicate data to multiple buckets.
C.Use a multi-region Cloud Storage bucket and enable requester-pays.
D.Set up Cloud CDN with the Cloud Storage bucket as origin.
AnswerD

Cloud CDN caches content at edge locations worldwide, reducing latency for users regardless of their region.

Why this answer

Cloud CDN caches video content at edge locations worldwide, reducing latency for users by serving content from the nearest edge cache instead of the origin Cloud Storage bucket. This directly addresses the requirement to reduce latency for users in different regions without modifying the storage architecture.

Exam trap

The PCD exam often tests the misconception that multi-region buckets alone solve latency issues, but the trap here is that multi-region storage provides redundancy, not edge caching—only Cloud CDN delivers the low-latency performance needed for global streaming.

How to eliminate wrong answers

Option A is wrong because Object Lifecycle Management moves objects to Nearline storage (which has higher retrieval costs and lower availability for streaming) and does not reduce latency; it only optimizes storage costs for infrequently accessed data. Option B is wrong because Cloud Storage Transfer Service is designed for one-time or scheduled bulk data transfers between buckets, not for real-time replication to reduce latency; it does not provide automatic regional distribution for streaming. Option C is wrong because a multi-region bucket provides geo-redundant storage but does not cache content at edge locations, and enabling requester-pays shifts costs to the user without improving latency; the latency reduction from multi-region is minimal compared to CDN edge caching.

935
MCQmedium

A company is evaluating Cloud Bigtable for a high-throughput write workload. They need to monitor disk usage and request latency. Which metrics should they monitor? (Select the best combination.)

A.disk/bytes_used and request_latency
B.cpu/utilisation and database/queries
C.disk/bytes_used and rows_deleted
D.request_latency and database/memory/utilisation
AnswerA

These are the correct Bigtable metrics for disk usage and request latency.

Why this answer

Bigtable provides 'disk/bytes_used' for disk usage and 'request_latency' for latency. 'cpu/utilisation' is not a Bigtable metric; Bigtable uses 'cpu_load' and 'server_latency' but request latency is the key metric. 'database/queries' is a Cloud SQL metric. 'rows_deleted' is a Spanner metric.

936
Multi-Selectmedium

A company wants to migrate an on-premises MySQL database to Cloud SQL with minimal downtime. Which two steps should they take? (Choose two.)

Select 2 answers
A.Use Database Migration Service to create a continuous replication job
B.Set up a Cloud SQL proxy on the source database
C.Take a full backup and restore it to Cloud SQL before replication
D.Configure binary logging on the source MySQL database
E.Disable foreign key checks on the source database
AnswersA, D

DMS supports continuous migration with minimal downtime.

Why this answer

Database Migration Service (DMS) can be used for continuous replication. They also need to configure the source database for replication (binary logging). Cloud SQL proxy is for connecting applications, not migration.

937
MCQmedium

A company wants to achieve 0 RPO for a Cloud SQL for MySQL instance. Which configuration should they use?

A.Enable cross-region replication to a replica in another region
B.Enable automatic backups with point-in-time recovery
C.Use a read replica in the same zone
D.Configure a Cloud SQL HA instance
AnswerD

HA instance uses synchronous replication within the same region, providing 0 RPO.

Why this answer

Cloud SQL HA (high availability) instances use synchronous replication to a standby VM in a different zone within the same region, providing automatic failover with zero data loss (0 RPO). This configuration ensures that committed transactions are immediately replicated to the standby before acknowledging the commit, guaranteeing that no committed data is lost even if the primary zone fails.

Exam trap

Google often tests the distinction between synchronous and asynchronous replication, and the trap here is that candidates confuse cross-region replication or read replicas (both asynchronous) with the synchronous HA configuration, mistakenly believing they can achieve 0 RPO.

How to eliminate wrong answers

Option A is wrong because cross-region replication is asynchronous, meaning there is a replication lag that can result in data loss if the primary region fails before the replica catches up, thus it cannot guarantee 0 RPO. Option B is wrong because automatic backups with point-in-time recovery are taken at scheduled intervals (e.g., daily), so any data committed between the last backup and a failure is lost, making RPO non-zero. Option C is wrong because a read replica in the same zone is also asynchronous and does not provide automatic failover; it is designed for read scaling, not for high availability with zero data loss.

938
MCQeasy

An application running on Compute Engine needs to publish messages to a Pub/Sub topic. The VPC does not have external internet access. What must be configured to allow the instance to publish?

A.Cloud NAT
B.VPC Peering with Pub/Sub
C.Cloud Router with BGP
D.Private Google Access
AnswerD

Private Google Access allows VM instances to use Google APIs via internal IPs.

Why this answer

Private Google Access enables instances without external IP addresses to call Google APIs and services (including Pub/Sub) using internal IPs. Option A is for NAT to internet, option B is for peering, and option C is for dynamic routing.

939
MCQhard

A company runs a microservices application on Google Kubernetes Engine. They use Cloud SQL for persistent data. Recently, during a traffic spike, the application experienced increased latency and some requests failed with timeout errors. The team observed that the Cloud SQL CPU utilization spiked to 100%, and the GKE pods had high memory usage. They are using a standard Cloud SQL tier (db-n1-standard-2). Which course of action would best improve the application's performance and reliability?

A.Upgrade Cloud SQL to a higher tier with more CPU.
B.Increase the number of replicas in GKE to reduce load per pod.
C.Add read replicas to Cloud SQL.
D.Implement caching with Memorystore for frequently accessed data.
AnswerD

Caching reduces database read load, alleviating CPU pressure and latency.

Why this answer

The primary bottleneck is the Cloud SQL CPU spiking to 100% under heavy read traffic. Implementing Memorystore (Redis) caching offloads repeated read queries from the database, reducing CPU load and query latency. This directly addresses the root cause—database CPU exhaustion—without requiring a larger database instance or adding replicas that would still be limited by the same CPU.

Exam trap

The PCD exam often tests the misconception that scaling compute (pods or database tier) is the only solution to performance issues, when in reality caching is a more cost-effective and architecturally sound approach for read-heavy workloads with spiky traffic patterns.

How to eliminate wrong answers

Option A is wrong because upgrading to a higher Cloud SQL tier (more CPU) only scales the database vertically, which is costly and does not eliminate the underlying issue of repeated expensive queries; it also does not reduce latency for read-heavy workloads as effectively as caching. Option B is wrong because increasing GKE pod replicas distributes application load but does not reduce the number of database queries hitting Cloud SQL; in fact, more pods could increase concurrent connections, worsening CPU contention. Option C is wrong because adding read replicas helps distribute read traffic but does not reduce the CPU load on the primary instance for write-heavy or mixed workloads; the primary still handles all writes and CPU spikes from complex queries, and replicas add replication lag and cost.

940
MCQeasy

An organization wants to design a serverless data processing pipeline that is highly available and can automatically scale based on the number of incoming requests. The pipeline processes JSON messages from a Cloud Pub/Sub topic and writes results to BigQuery. Which service should be used as the compute component?

A.Cloud Dataflow
B.Cloud Run
C.Cloud Functions
D.Compute Engine with managed instance groups
AnswerB

Cloud Run provides automatic scaling, can be triggered via Pub/Sub push, and supports longer processing times.

Why this answer

Cloud Run is the correct compute component because it is a fully managed serverless platform that automatically scales from zero based on incoming HTTP requests, supports event-driven processing via Pub/Sub push subscriptions, and integrates natively with BigQuery. It provides high availability by default across zones and can handle burst traffic without provisioning overhead, making it ideal for a serverless pipeline that processes JSON messages and writes results to BigQuery.

Exam trap

The PCD exam often tests the distinction between serverless compute services (Cloud Run vs Cloud Functions) by focusing on execution time limits and concurrency; the trap here is that candidates choose Cloud Functions for its simplicity, overlooking the 9-minute timeout and lack of support for long-running or high-concurrency workloads that Cloud Run handles natively.

How to eliminate wrong answers

Option A is wrong because Cloud Dataflow is a batch and stream processing service based on Apache Beam, not a serverless compute service that automatically scales per request; it is designed for complex data transformations and requires managing pipelines, not simple request-driven processing. Option C is wrong because Cloud Functions has a maximum timeout of 9 minutes (540 seconds) and limited memory (up to 32GB), which may not be sufficient for long-running or memory-intensive BigQuery write operations, and it lacks the ability to handle sustained high-throughput streaming from Pub/Sub as efficiently as Cloud Run. Option D is wrong because Compute Engine with managed instance groups is not serverless; it requires managing virtual machines, scaling policies, and infrastructure, which contradicts the requirement for a serverless design and adds operational overhead.

941
Multi-Selectmedium

A company is migrating a PostgreSQL database to AlloyDB using Database Migration Service. They want to ensure high availability during the migration with minimal risk. Which TWO practices should they follow? (Choose 2)

Select 2 answers
A.Promote the replica immediately after the initial load
B.Disable binary logging on the source to improve performance
C.Set up DMS with continuous CDC to keep AlloyDB in sync
D.Test the migration by cloning the AlloyDB instance before cutover
E.Use gcloud sql import command instead of DMS
AnswersC, D

CDC ensures near-zero downtime.

Why this answer

DMS supports continuous CDC, so you should enable CDC for minimal downtime. Testing with a clone avoids affecting production. Promoting the replica early would cause downtime.

942
MCQhard

A developer is designing a chat application using Cloud Firestore. They need to ensure that updates to messages are propagated to all clients in real-time. Which feature should they use?

A.Firestore indexes
B.Security rules
C.Real-time listeners
D.Offline persistence
AnswerC

Real-time listeners push updates to clients in real-time.

Why this answer

Real-time listeners (onSnapshot) in Cloud Firestore allow clients to subscribe to document or query changes, receiving updates immediately when data is modified. This ensures all connected clients see message updates in real-time without polling, which is essential for a chat application.

Exam trap

The PCD exam often tests the distinction between features that enable real-time data flow (listeners) versus features that manage data structure or access (indexes, rules, persistence), leading candidates to confuse offline persistence with real-time sync.

How to eliminate wrong answers

Option A is wrong because Firestore indexes are used to optimize query performance, not to propagate real-time updates. Option B is wrong because security rules control access and validation of data, not the delivery of updates to clients. Option D is wrong because offline persistence enables local caching and operation without connectivity, but does not provide real-time synchronization across clients.

943
MCQmedium

An organization uses Cloud SQL for MySQL and wants to set up a read replica in a different region to improve read latency for global users. What is the recommended way to configure network connectivity between the primary and replica?

A.Use a Cloud Interconnect
B.Use Cloud VPN with dynamic routing
C.Use VPC peering between the regions
D.Use Private Services Access
AnswerD

Private Services Access allows the Cloud SQL service producer VPC to be peered with the customer VPC.

Why this answer

Private Services Access. Cross-region Cloud SQL read replicas require Private Services Access to establish private connectivity between the peered VPC and the Cloud SQL service. Private Services Access allows the primary and replica to communicate privately without traversing the public internet.

Cloud Interconnect (A) provides dedicated connectivity but is unnecessary for this use case. Cloud VPN (B) is typically used for hybrid connectivity, not for Cloud SQL replication. VPC peering (C) is used for connecting VPCs directly but does not provide the service-level networking required for Cloud SQL.

944
Multi-Selectmedium

You need to select a Google Cloud database for a global e-commerce platform that requires strong consistency for inventory updates, but can tolerate eventual consistency for product reviews. Which THREE services would you consider appropriate for the different parts of the platform?

Select 3 answers
A.Bigtable for real-time user behavior tracking
B.BigQuery for storing product reviews
C.Firestore for product reviews
D.Cloud SQL for inventory
E.Cloud Spanner for inventory data
AnswersA, C, E

Bigtable can handle high-throughput write/read for real-time tracking with eventual consistency.

Why this answer

Bigtable is correct for real-time user behavior tracking as it is a fully managed, scalable NoSQL database designed for high-throughput, low-latency workloads, providing strong consistency for single-row operations. Firestore is suitable for product reviews because it supports eventual consistency for multi-region queries, meeting the tolerance requirement, while offering strong consistency within a single region. Cloud Spanner is ideal for inventory data because it provides global strong consistency and ACID transactions, crucial for inventory accuracy across regions.

Exam trap

Candidates often mistakenly think BigQuery can serve as an operational database for storing and querying product reviews in real time, when in fact it is a data warehouse for analytics and not designed for transactional or low-latency read/write operations.

945
MCQmedium

An e-commerce platform uses Cloud SQL for PostgreSQL. They need to reduce read load on the primary instance and provide low-latency reads for geographically distributed users. Which configuration should they implement?

A.Add read replicas in multiple regions
B.Use Cloud CDN to cache database responses
C.Enable cross-region replication using Cloud SQL's built-in failover replica
D.Migrate to Cloud Spanner
AnswerA

Read replicas in different regions can serve read traffic locally, reducing latency and load on the primary.

Why this answer

Cloud SQL read replicas are used to offload read traffic and provide low-latency reads from different regions. They are asynchronous replicas that can be promoted in case of failure.

946
Multi-Selecthard

An organization is migrating from Oracle to Cloud SQL for PostgreSQL. They need to convert Oracle packages (which use PL/SQL) into PostgreSQL equivalents. Which TWO approaches are correct for handling Oracle packages?

Select 2 answers
A.Rewrite PL/SQL code into PL/pgSQL syntax.
B.Use pgAgent to schedule package execution.
C.Use Oracle compatibility mode in PostgreSQL.
D.Convert each package into a PostgreSQL schema containing functions and procedures.
E.Install the Orafce extension for Oracle compatibility.
AnswersA, D

PL/SQL must be converted to PL/pgSQL for PostgreSQL.

Why this answer

Oracle packages group procedures/functions. In PostgreSQL, the equivalent is to use schemas to namespace them. Additionally, converting PL/SQL to PL/pgSQL is required.

947
MCQeasy

Refer to the exhibit. A developer notices that instance-3 is in TERMINATED state. What is the most likely reason?

A.The instance was deleted
B.The instance had automatic restart disabled
C.The instance was preempted
D.The instance's zone was unavailable
AnswerB

With automatic restart disabled, the instance does not restart after failure, resulting in TERMINATED state.

Why this answer

When an instance's 'automatic restart' is disabled, the instance will not be automatically restarted after a host maintenance event or a failure. If the underlying host experiences an issue, the instance transitions to TERMINATED state instead of being migrated or restarted. This is the most likely reason for instance-3 being in TERMINATED state while other instances remain running.

Exam trap

The PCD exam often tests the distinction between 'automatic restart' (failure recovery) and 'onHostMaintenance' (planned maintenance behavior), causing candidates to confuse preemption or zone unavailability with the actual reason for a TERMINATED state.

How to eliminate wrong answers

Option A is wrong because deleting an instance would remove it from the list entirely or show it as 'DELETED', not 'TERMINATED'. Option C is wrong because preempted instances transition to 'STOPPED' or 'TERMINATED' only if the preemption policy is set to terminate, but preemption is a specific Google Cloud concept for short-lived, low-cost instances, and the question does not indicate preemptible configuration. Option D is wrong because if the zone were unavailable, all instances in that zone would be affected, not just instance-3, and the state would likely be 'UNAVAILABLE' or 'STOPPED', not 'TERMINATED'.

948
MCQmedium

A team is designing a disaster recovery plan for a critical application on Google Cloud. The application runs on Compute Engine with a regional persistent disk. They want to minimize data loss in case of a regional outage. Which strategy should they use?

A.Use persistent disk snapshot replication to another region
B.Create a snapshot schedule and store snapshots in the same region
C.Use synchronous replication across regions
D.Configure a managed instance group with autohealing
AnswerA

Snapshot replication to another region provides off-site backups that can be used to restore the application in a different region.

Why this answer

Persistent disk snapshot replication to another region is the correct strategy because snapshots are stored in Cloud Storage and can be replicated across regions. This allows you to restore the disk from a snapshot in a different region if the primary region experiences an outage, minimizing data loss by ensuring the backup is geographically separate. Regional persistent disks are synchronous within a region but do not provide cross-region replication, so snapshots are the recommended approach for cross-region disaster recovery.

Exam trap

The trap here is that candidates may confuse regional persistent disks' synchronous replication within a region (which is for high availability, not disaster recovery) with cross-region replication, leading them to incorrectly choose synchronous replication across regions, which is not supported for persistent disks.

How to eliminate wrong answers

Option B is wrong because storing snapshots in the same region does not protect against a regional outage; if the entire region fails, both the disk and its snapshots become inaccessible. Option C is wrong because synchronous replication across regions is not supported for persistent disks; Google Cloud offers asynchronous replication via snapshots or disk replication services, but synchronous cross-region replication would introduce unacceptable latency and is not a native feature. Option D is wrong because a managed instance group with autohealing only recovers instances within the same region, not the persistent disk data, and does not address data loss or regional outage scenarios.

949
MCQhard

You have a Cloud Bigtable instance with a single table that stores user events. You need to ensure that data older than 30 days is automatically deleted. What should you configure?

A.Set a garbage collection policy on the default column family to delete cells older than 30 days
B.Set a time-to-live (TTL) on the table
C.Use a cron job to manually delete rows with timestamps older than 30 days
D.Enable compaction and set a TTL on the table
AnswerA

Garbage collection policies on column families can delete based on age, e.g., max_age = 30 days.

Why this answer

Bigtable garbage collection policies operate on column families and can delete cells older than a specified time or keep a max number of versions.

950
MCQmedium

During a migration from MySQL to Cloud SQL, an engineer notices that the source database uses MyISAM tables with full-text indexes. What must be done to successfully migrate these tables to Cloud SQL (which uses InnoDB by default)?

A.Migrate the tables to Cloud Storage and use external tables.
B.Use the MEMORY storage engine instead.
C.Create the tables as MyISAM in Cloud SQL.
D.Convert the tables to InnoDB and recreate full-text indexes.
AnswerD

InnoDB supports full-text indexes; conversion is required.

Why this answer

Cloud SQL for MySQL uses InnoDB as its default storage engine and does not support MyISAM. Therefore, MyISAM tables with full-text indexes must be converted to InnoDB, and the full-text indexes must be recreated because InnoDB supports full-text indexes natively. Option D correctly identifies this required conversion and index recreation process.

Exam trap

A common trap in Google Cloud exams is that candidates might assume Cloud SQL supports MyISAM because it is MySQL-compatible, but Cloud SQL for MySQL only supports InnoDB. Therefore, you must convert the storage engine and recreate any full-text indexes.

How to eliminate wrong answers

Option A is wrong because Cloud Storage external tables are used for querying data in object storage, not for migrating MyISAM tables; they do not solve the storage engine incompatibility. Option B is wrong because the MEMORY storage engine is volatile and unsuitable for persistent data, and it does not support full-text indexes, making it an invalid replacement for MyISAM tables with full-text indexes. Option C is wrong because Cloud SQL for MySQL does not support the MyISAM storage engine; attempting to create tables as MyISAM will fail or be silently converted to InnoDB, losing the full-text indexes.

951
MCQeasy

A data engineering team needs to replicate data from a PostgreSQL database to BigQuery in near real-time for analytics. Which Google Cloud service is most suitable for this task with minimal setup?

A.Cloud SQL for PostgreSQL
B.Cloud Data Fusion
C.Cloud Composer
D.Datastream
AnswerD

Datastream is designed for serverless CDC replication, with native destinations including BigQuery.

Why this answer

Datastream is a serverless CDC replication service specifically designed for replicating from sources like PostgreSQL, MySQL, and Oracle to BigQuery, Cloud Storage, or Pub/Sub. It handles schema mapping and initial backfill.

952
MCQmedium

A company is migrating from Snowflake to BigQuery. They have a large dataset with semi-structured data stored as VARIANT columns in Snowflake. How should they represent this data in BigQuery?

A.Store as STRING and use JSON_EXTRACT functions.
B.Store as ARRAY<STRUCT<...>> (RECORD type) with nested fields.
C.Store as JSON data type and use JSON functions for queries.
D.Store as BYTES and handle encoding in application.
AnswerB

RECORD type is the native way to represent semi-structured data in BigQuery and offers best performance.

Why this answer

Snowflake's VARIANT type is used for semi-structured data like JSON. BigQuery has the RECORD (STRUCT) and REPEATED modes for nested and repeated data, and supports JSON data type (in preview) or storing as a STRING. The best practice is to use the native RECORD type to represent the structure for query performance and ease of use.

953
MCQeasy

A developer wants to run a single test suite across multiple environments (dev, staging, prod) using Cloud Build. What is the best practice?

A.Use Cloud Deploy to run tests in each environment.
B.Use separate branches for each environment.
C.Use a single Cloud Build trigger with substitutions to parameterize the environment.
D.Create separate Cloud Build triggers for each environment.
AnswerC

Substitutions allow dynamic values for environment-specific variables.

Why this answer

Cloud Build triggers support substitutions (e.g., `$_ENV`) that allow a single trigger to parameterize the environment variable, enabling the same test suite to run across dev, staging, and prod without duplicating configuration. This aligns with Infrastructure as Code (IaC) principles and reduces maintenance overhead.

Exam trap

The PCD exam often tests the misconception that separate triggers or branches are required for environment isolation, when in fact Cloud Build's substitution mechanism is the recommended approach for parameterizing a single pipeline across multiple environments.

How to eliminate wrong answers

Option A is wrong because Cloud Deploy is designed for continuous delivery (rolling out releases to target environments), not for running test suites; it does not execute Cloud Build steps or test commands. Option B is wrong because using separate branches for each environment violates Git-based best practices (e.g., GitFlow or trunk-based development) and introduces merge conflicts, drift, and manual overhead. Option D is wrong because creating separate triggers for each environment duplicates configuration, increases maintenance burden, and violates DRY (Don't Repeat Yourself) principles; substitutions achieve the same goal more efficiently.

954
Multi-Selectmedium

You are designing a Cloud Bigtable schema for a time-series application. To optimize performance and avoid hot spots, which THREE row key design practices should you follow? (Choose 3)

Select 3 answers
A.Place the highest cardinality field (e.g., device ID) first in the row key
B.Use a single table for all data
C.Use sequential integers as row keys
D.Reverse the timestamp so that recent data does not create hot spots
E.Salt the key with a random prefix to distribute writes
AnswersA, D, E

High cardinality field first distributes rows across tablets.

Why this answer

Reversing timestamps, salting keys, and promoting high-cardinality fields to the start of the row key are recommended to distribute writes evenly.

955
MCQmedium

A developer wants to enable IAM database authentication for Cloud SQL for PostgreSQL. Which IAM role must be granted to a user or service account to allow login?

A.Cloud SQL Admin
B.Cloud SQL Connect
C.Cloud SQL Instance User
D.Cloud SQL Client
AnswerC

This role allows a user to connect to Cloud SQL using IAM database authentication.

Why this answer

Cloud SQL IAM database authentication for PostgreSQL requires the Cloud SQL Instance User role (roles/cloudsql.instanceUser) to be granted to a user or service account. This role allows the principal to log in to the database instance using IAM credentials, while the Cloud SQL Admin, Connect, and Client roles do not grant the specific login privilege needed for IAM-based database authentication.

Exam trap

The trap here is that candidates often confuse the Cloud SQL Client or Cloud SQL Connect roles with the ability to log in to the database, but those roles only allow network-level connectivity (e.g., via Cloud SQL Proxy) and do not grant the IAM login permission required for database authentication.

How to eliminate wrong answers

Option A is wrong because Cloud SQL Admin (roles/cloudsql.admin) grants full administrative control over Cloud SQL instances (create, modify, delete) but does not include the permission to log in to the database via IAM authentication. Option B is wrong because Cloud SQL Connect (roles/cloudsql.connect) allows connecting to Cloud SQL instances using Cloud SQL Proxy or private IP, but it does not grant the cloudsql.instances.login permission required for IAM database authentication. Option D is wrong because Cloud SQL Client (roles/cloudsql.client) provides permissions to connect to Cloud SQL instances and use Cloud SQL Proxy, but it lacks the specific cloudsql.instances.login permission needed for IAM-based database login.

956
MCQhard

A company is using Cloud Bigtable to serve real-time analytics. They notice that some queries are slow, and the Key Visualizer shows a narrow row key range receiving the majority of reads and writes. What is the most likely cause and recommended action?

A.The cluster has too few nodes; add more nodes to the cluster
B.Enable replication to a secondary cluster to offload reads
C.The storage type is HDD; switch to SSD to improve latency
D.A single row key prefix is being accessed heavily, causing a hot spot; redesign the row key to distribute load
AnswerD

The Key Visualizer indicates a hot spot, so row key design should be improved.

Why this answer

Hot spotting occurs when a small range of row keys is heavily accessed, causing uneven load distribution. Using a well-distributed row key design (e.g., salting) is the recommended solution.

957
MCQmedium

A team uses Cloud Build to build and deploy a Node.js application to App Engine flexible environment. The build succeeds, but the deployment fails with 'ERROR: (gcloud.app.deploy) Error Response: [9] Application startup error!' The team checks logs and sees 'Error: Module not found: 'express''. What is the most likely cause?

A.The build step includes 'npm test' which fails.
B.The Node.js version specified in app.yaml is incompatible with the dependencies.
C.The app.yaml file is missing from the root of the repository.
D.The dependencies are not installed during the build step before deploying.
AnswerD

Dependencies must be installed (e.g., npm install) for the app to run.

Why this answer

The error 'Module not found: express' indicates that the Node.js dependencies (specifically the 'express' package) are not present in the deployed application. In Cloud Build, the build steps must explicitly install dependencies (e.g., via 'npm install') before the deploy step. If the build configuration does not include an 'npm install' step, the dependencies listed in package.json are not copied to the App Engine flexible environment, causing the startup error.

Exam trap

Google often tests the distinction between build-time and deployment-time errors, and the trap here is that candidates might confuse a missing app.yaml (a configuration error) with a missing dependency (a runtime error), or assume that npm install is automatically performed by Cloud Build when it is not.

How to eliminate wrong answers

Option A is wrong because 'npm test' failure would cause the build step to fail, not the deployment step; the error message specifically says the build succeeded but deployment failed. Option B is wrong because an incompatible Node.js version would typically cause a different error (e.g., syntax errors or runtime crashes), not a 'Module not found' error for a specific package. Option C is wrong because a missing app.yaml would cause a different error (e.g., 'ERROR: (gcloud.app.deploy) Could not find app.yaml') before the deployment even starts, not a startup error after deployment.

958
MCQmedium

An e-commerce company uses Cloud SQL for MySQL for transactional data and BigQuery for analytics. They need to replicate order data from Cloud SQL to BigQuery in near real-time with minimal latency. Which Google Cloud service should they use?

A.Cloud Dataflow
B.Cloud Pub/Sub
C.Datastream
D.Database Migration Service (DMS)
AnswerC

Datastream directly replicates CDC data from MySQL to BigQuery with low latency, serverless.

Why this answer

Datastream is a serverless CDC replication service that can stream changes from MySQL (including Cloud SQL) to BigQuery, GCS, or Pub/Sub with low latency. Dataflow requires building pipelines, DMS is for database migrations (not ongoing sync), and Pub/Sub alone doesn't load into BigQuery.

959
MCQeasy

You need a managed database service for a lift-and-shift migration of an on-premises SQL Server 2019 OLTP application with up to 64 TB of data. Which Google Cloud database should you choose?

A.Cloud Bigtable
B.AlloyDB
C.Cloud Spanner
D.Cloud SQL
AnswerD

Cloud SQL supports SQL Server 2019 and offers up to 64 TB storage.

Why this answer

Cloud SQL is the correct choice because it supports SQL Server 2019, provides managed database services with up to 64 TB of storage (via the Enterprise Plus tier with 64 TB SSD capacity), and is ideal for lift-and-shift migrations of OLTP workloads without requiring application changes. It offers high availability, automated backups, and compatibility with SQL Server features like T-SQL and linked servers, making it a direct replacement for on-premises SQL Server.

Exam trap

The trap here is that candidates often confuse Cloud Spanner's global scalability with a general-purpose relational database, but the question specifies a lift-and-shift migration of SQL Server 2019, which requires native SQL Server compatibility that only Cloud SQL provides among the options.

How to eliminate wrong answers

Option A is wrong because Cloud Bigtable is a NoSQL, wide-column database designed for large-scale analytical and operational workloads (e.g., time-series, IoT) with low-latency reads/writes, not for relational OLTP applications requiring SQL Server compatibility and ACID transactions. Option B is wrong because AlloyDB is a PostgreSQL-compatible database optimized for high-performance transactional and analytical workloads, but it does not support SQL Server T-SQL or the lift-and-shift of a SQL Server 2019 application without significant schema and query changes. Option C is wrong because Cloud Spanner is a globally distributed, horizontally scalable relational database with strong consistency, but it is not designed for lift-and-shift migrations of SQL Server workloads due to its proprietary SQL dialect, lack of SQL Server compatibility, and higher cost/complexity for a single-region OLTP application with up to 64 TB of data.

960
MCQeasy

A data engineer is migrating a Teradata data warehouse to BigQuery. They need to transfer historical data and set up continuous replication. Which service should they use?

A.Cloud Storage Transfer Service
B.Cloud Data Fusion
C.BigQuery Data Transfer Service
D.Database Migration Service
AnswerC

BigQuery Data Transfer Service has a Teradata connector that supports both historical backfill and continuous replication.

Why this answer

BigQuery Data Transfer Service supports scheduled and continuous transfers from Teradata to BigQuery, including incremental data loads.

961
MCQeasy

A developer wants to automatically deploy a new version of an application to App Engine Standard every time code is pushed to the main branch of a Cloud Source Repositories repository. Which service should be used?

A.Cloud Build
B.Cloud Run
C.Cloud Scheduler
D.Cloud Deploy
AnswerA

Cloud Build can automatically trigger on source repo pushes and deploy to App Engine.

Why this answer

Cloud Build is the correct service because it is a fully managed CI/CD platform that integrates natively with Cloud Source Repositories and App Engine Standard. You can configure a Cloud Build trigger to automatically build and deploy your application whenever code is pushed to the main branch, using a cloudbuild.yaml file that specifies the build steps and the `gcloud app deploy` command.

Exam trap

The trap here is that candidates confuse Cloud Deploy (which is for GKE/Cloud Run delivery pipelines) with Cloud Build (the actual CI/CD service that can deploy to App Engine), or they mistakenly think Cloud Run can deploy to App Engine Standard when it is a separate compute platform.

How to eliminate wrong answers

Option B (Cloud Run) is wrong because Cloud Run is a serverless compute platform for running containers, not a CI/CD service for building and deploying to App Engine Standard. Option C (Cloud Scheduler) is wrong because Cloud Scheduler is a cron job service for scheduling tasks, not a continuous deployment tool triggered by code pushes. Option D (Cloud Deploy) is wrong because Cloud Deploy is a delivery pipeline service for GKE and Cloud Run, not for App Engine Standard, and it does not directly integrate with Cloud Source Repositories triggers.

962
Drag & Dropmedium

Drag and drop the steps to grant a service account access to a Cloud Storage bucket 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

Granting access to a bucket involves adding the service account as a principal with a role.

963
MCQhard

An operations team is configuring a Cloud Monitoring alerting policy for a critical application. They want to ensure that alerts are only fired when an anomaly persists for at least 5 minutes to reduce noise. Which condition configuration should they use?

A.Configure 'Evaluation Missing Data' to '5 minutes'.
B.Use a 'Metric Threshold' condition and set the 'for' parameter to 300 seconds.
C.Set the condition type to 'Metric Absence' with a 5-minute duration.
D.Use 'Never retrigger' state with 5-minute window.
AnswerB

This ensures the alert fires only if condition holds for 5 minutes.

Why this answer

The 'for' parameter in a Metric Threshold condition specifies the duration (in seconds) that a metric must continuously violate the threshold before the alert fires. Setting it to 300 seconds ensures the anomaly persists for at least 5 minutes, reducing noise from transient spikes. This is the standard approach in Cloud Monitoring for sustained condition evaluation.

Exam trap

In Google Cloud Monitoring, a common mistake is confusing the 'for' parameter (which requires sustained violation) with 'Evaluation Missing Data' (which handles missing data points) or 'Metric Absence' (which fires when data stops arriving). The 'for' parameter is the correct way to reduce noise from transient spikes.

How to eliminate wrong answers

Option A is wrong because 'Evaluation Missing Data' controls how the system treats gaps in metric data (e.g., treat as 'no data' or 'not breaching'), not the duration a condition must hold before alerting. Option C is wrong because 'Metric Absence' triggers when data stops reporting for a specified duration, not when a metric exceeds a threshold persistently. Option D is wrong because 'Never retrigger' is a notification channel setting that prevents repeated alerts for the same incident, not a condition configuration for sustained anomaly detection.

964
MCQhard

A Cloud Spanner database has a table Orders with a child table OrderItems. Queries often join Orders and OrderItems on OrderID. Which schema design optimizes performance for these joins?

A.Define a secondary index on OrderItems.OrderID
B.Use a global index on Orders.OrderID
C.Denormalize OrderItems data into the Orders table
D.Make OrderItems an interleaved table under Orders
AnswerD

Interleaving stores child rows with parent rows in the same split, minimizing join latency.

Why this answer

Interleaved tables store child rows with their parent row in the same split, colocating related data and reducing cross-node communication. This is the correct optimization for parent-child joins.

Page 12

Page 13 of 13