Courseiva

Google Professional Cloud Developer (PCD) — Questions 175

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

Page 1 of 13

Page 2
1
MCQhard

An enterprise is migrating a 10 TB Teradata data warehouse to BigQuery with minimal downtime. They need to transform Teradata BTEQ scripts to equivalent BigQuery SQL. Which approach should the migration team take to handle the SQL dialect differences?

A.Use BigQuery Data Transfer Service for Teradata to automate the migration
B.Use gcloud bigquery command-line tool
C.Use Database Migration Service with Teradata connector
D.Use Cloud Data Fusion to transform BTEQ scripts
AnswerD

Cloud Data Fusion offers a visual design environment that can be used to transform Teradata BTEQ logic into equivalent BigQuery SQL, addressing the need for dialect conversion.

Why this answer

Cloud Data Fusion is a data integration service that provides a visual interface to design and execute data transformations. While it does not automatically convert BTEQ scripts, it can be used to manually rebuild the transformation logic into BigQuery SQL, making it the most suitable option for handling SQL dialect differences. BigQuery Data Transfer Service for Teradata only transfers data and schema, not SQL scripts.

2
MCQhard

Based on the Cloud Trace exhibit, which service is the primary contributor to the overall request latency?

A.The productcatalog service
B.The frontend service itself
C.The auth service
D.The recommendations service
AnswerC

Auth service has the longest child span duration (800ms).

Why this answer

The Cloud Trace exhibit shows that the auth service accounts for the largest segment of the overall request latency, as indicated by the longest span duration in the trace waterfall. In Google Cloud Trace, each span represents a service's contribution to the total latency, and the service with the highest cumulative span time is the primary contributor. Since the auth service span is the longest, it is the correct answer.

Exam trap

Google Cloud often tests the misconception that the frontend service (the entry point) is the primary latency contributor, but the trace waterfall clearly shows that downstream service spans, not the root span, account for the majority of the latency.

How to eliminate wrong answers

Option A is wrong because the productcatalog service span shows a shorter duration than the auth service span, indicating it contributes less to the overall latency. Option B is wrong because the frontend service itself is the entry point and its own span duration is minimal compared to the downstream auth service call; the frontend's latency is dominated by waiting for the auth service response. Option D is wrong because the recommendations service span is either absent or has a negligible duration in the trace, meaning it is not a significant contributor to the total request latency.

3
MCQhard

An organization uses Cloud Build to deploy multiple microservices to GKE. They want to ensure that the deployment process can be audited and that each deployment can be rolled back to a previous version. What is the recommended approach?

A.Use Kubernetes Deployment history to rollback by specifying a revision.
B.Use Cloud Deploy to manage deployments with rollback capabilities and audit logs.
C.Store each manifest version in Artifact Registry and manually apply kubectl.
D.Use Cloud Build to redeploy a previous image tag when rollback is needed.
AnswerB

Cloud Deploy provides automated rollback and deployment history.

Why this answer

Cloud Deploy is the recommended service for managing progressive deliveries and rollbacks on GKE, as it provides built-in rollback capabilities, audit logging, and delivery pipeline management. Unlike raw Kubernetes Deployment history, Cloud Deploy integrates with Cloud Build and offers a controlled, auditable deployment process with the ability to roll back to any previous release revision.

Exam trap

The PCD exam often tests the misconception that Kubernetes native rollback mechanisms (like `kubectl rollout undo`) are sufficient for enterprise audit requirements, but the exam expects candidates to recognize that Cloud Deploy provides the necessary audit logs and structured rollback workflows for production environments.

How to eliminate wrong answers

Option A is wrong because Kubernetes Deployment history only supports rollback via `kubectl rollout undo` to a specific revision, but it lacks native audit logging and does not provide a centralized, auditable deployment pipeline across multiple microservices. Option C is wrong because manually applying manifests from Artifact Registry bypasses automated deployment pipelines, introduces human error, and does not provide rollback capabilities or audit trails. Option D is wrong because using Cloud Build to redeploy a previous image tag is a manual workaround that does not offer structured rollback management, release tracking, or audit logs; it also requires rebuilding or re-tagging, which can lead to inconsistencies.

4
Multi-Selecteasy

A company is using Cloud Storage to store sensitive customer data. They need to ensure data is encrypted at rest and access is controlled. Which TWO statements are true regarding data protection in Cloud Storage? (Choose two.)

Select 2 answers
A.By default, data in Cloud Storage is encrypted at rest using Google-managed encryption keys.
B.Using a signed URL revokes the underlying object's ACL.
C.Enabling uniform bucket-level access disables encryption at rest.
D.Customer-managed encryption keys (CMEK) can be used to control the encryption keys used to protect data.
E.Bucket-level policies can restrict access to only compute instances with specific service accounts.
AnswersA, D

Cloud Storage automatically encrypts all data at rest with Google-managed keys.

Why this answer

Cloud Storage automatically encrypts all data at rest using server-side encryption with Google-managed encryption keys by default, without any additional configuration. This ensures that data is protected before it is written to disk and remains encrypted throughout its lifecycle.

Exam trap

The PCD exam often tests the misconception that uniform bucket-level access affects encryption or that signed URLs modify ACLs, when in fact these features operate on separate layers of the security model.

5
Multi-Selecthard

A team is designing a globally distributed application on Google Cloud that requires strong consistency for writes but can tolerate eventual consistency for reads. The application expects millions of concurrent users. Which two strategies should they implement? (Choose two.)

Select 2 answers
A.Use Cloud Spanner for write operations requiring strong consistency.
B.Use Firestore in multi-region mode for all operations.
C.Use global HTTP(S) Load Balancer with Cloud CDN for read-heavy traffic.
D.Deploy Cloud SQL with cross-region replication for read scalability.
E.Use Cloud Bigtable for reading data with strong consistency.
AnswersA, C

Cloud Spanner provides externally consistent reads and writes across global regions using TrueTime and atomic clocks, satisfying the strong consistency requirement for write operations in the stem. Its synchronous replication ensures that all writes are immediately visible to subsequent reads, directly addressing the need for write consistency despite eventual read tolerance.

Why this answer

Cloud Spanner provides strongly consistent writes globally through synchronous replication using the TrueTime API and Paxos-based consensus. This ensures that all write operations are immediately consistent across regions, meeting the requirement for strong consistency on writes.

Exam trap

The PCD exam often tests the misconception that a single database can handle both strong consistency and high scalability for reads and writes, leading candidates to choose Firestore or Bigtable without considering the specific consistency requirements for writes versus reads.

6
Multi-Selectmedium

Which three are valid ways to authenticate a service account when using the Google Cloud client libraries? (Choose three.)

Select 3 answers
A.Attaching a service account to a Compute Engine instance and letting the metadata server provide credentials.
B.Setting the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to a service account key file.
C.Using OAuth 2.0 client IDs for web applications.
D.Using the gcloud CLI default application credentials.
E.Using an API key in the client library initialization.
AnswersA, B, D

This is the automatic method on Compute Engine.

Why this answer

Options A, B, and D are correct. These are standard methods for Application Default Credentials (ADC). Attaching a service account to a Compute Engine instance allows the metadata server to provide credentials (A).

Setting the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to a service account key file is another valid method (B). Using the gcloud CLI default application credentials is also a valid approach (D). Option C is incorrect because OAuth 2.0 client IDs for web applications are used for user authentication, not service account authentication.

Option E is incorrect because API keys are not used for service account authentication; they are used for simple API access without a service account.

7
MCQeasy

A team deploys a containerized web application on Google Kubernetes Engine (GKE) using a Deployment. They need to expose the application externally via a stable IP address and enable SSL termination. Which resource should they use?

A.HorizontalPodAutoscaler
B.Ingress with Google-managed SSL certificate
C.Service type NodePort
D.Service type LoadBalancer
AnswerB

Provides SSL termination and a stable IP via the load balancer.

Why this answer

An Ingress with a Google-managed SSL certificate is the correct choice because it provides a single stable IP address via a global forwarding rule, terminates SSL at the Google Cloud HTTP(S) load balancer, and routes traffic to the GKE Deployment. This approach offloads SSL decryption from the application pods and uses a managed certificate that auto-renews, meeting both the stable IP and SSL termination requirements.

Exam trap

In the Google Cloud PCD exam, candidates often mistakenly believe a Service type LoadBalancer handles SSL termination. However, it provides only L4 load balancing with a stable IP. SSL termination requires an L7 Ingress with a Google-managed SSL certificate or a dedicated SSL proxy instance.

How to eliminate wrong answers

Option A is wrong because a HorizontalPodAutoscaler only adjusts the number of pod replicas based on CPU/memory metrics and does not expose the application externally or handle SSL termination. Option C is wrong because a Service type NodePort exposes the application on a high-port on each node's IP, which is not a stable IP address and does not provide SSL termination. Option D is wrong because a Service type LoadBalancer creates a regional TCP/UDP load balancer with an ephemeral external IP (unless static IP is manually reserved) and does not natively terminate SSL; it would require additional configuration like a separate SSL proxy or an Ingress.

8
MCQhard

Refer to the exhibit. The function returns 'Error' even though the document exists. What is the most likely reason?

A.The document ID in the query parameter is URL-encoded and needs to be decoded using `decodeURIComponent`.
B.The function has insufficient IAM permissions for Firestore.
C.The Firestore emulator is not running.
D.The `update` method requires that the document exists.
AnswerA

Spaces and special characters in query strings are encoded; decoding is necessary to form the correct document path.

Why this answer

The most likely reason is that the document ID in the query parameter is URL-encoded, and the function does not decode it before using it as a Firestore document reference. Firestore document IDs are case-sensitive and must match exactly; a URL-encoded string like 'doc%20name' will not match the actual document 'doc name', causing the update to fail and return 'Error'. Using `decodeURIComponent` on the parameter before passing it to Firestore resolves this.

Exam trap

The PCD exam often tests the subtle distinction between a document not existing and a document ID mismatch due to encoding, leading candidates to incorrectly choose the 'document must exist' option (D) when the real issue is a URL-encoded ID not being decoded.

How to eliminate wrong answers

Option B is wrong because insufficient IAM permissions would typically result in a permission-denied error (HTTP 403) or an exception, not a generic 'Error' return from the function, and the question states the document exists, implying the function can access Firestore. Option C is wrong because if the Firestore emulator were not running, the function would fail to connect entirely, throwing a network or connection error, not a conditional 'Error' after checking document existence. Option D is wrong because the `update` method in Firestore does require the document to exist, but the question explicitly states the document exists, so this is not the cause of the error; the issue is the mismatch due to URL encoding.

9
MCQmedium

A company runs an e-commerce application with a relational database (PostgreSQL) for orders and inventory. They need to store clickstream data for real-time personalization, with a flexible schema and sub-second read latency. Which database best suits the clickstream workload?

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

Firestore is a flexible, scalable NoSQL document database with real-time capabilities and sub-second latency, ideal for clickstream personalization.

10
Multi-Selectmedium

A company is designing a cloud-native application on Google Kubernetes Engine. They want to ensure high availability and scalability for their microservices. Which two best practices should they follow?

Select 2 answers
A.Use a single cluster per region.
B.Use a single replica for each service to reduce cost.
C.Use horizontal pod autoscaling based on custom metrics.
D.Use stateful sets for all services.
E.Deploy services across multiple zones.
AnswersC, E

HPA allows scaling based on application-specific metrics.

Why this answer

Horizontal Pod Autoscaling (HPA) based on custom metrics allows the application to automatically scale the number of pod replicas in response to application-specific signals (e.g., requests per second, queue depth) rather than just CPU/memory. This ensures that each microservice can handle varying load efficiently, maintaining high availability and scalability without over-provisioning.

Exam trap

The PCD exam often tests the misconception that high availability requires a single cluster per region, but the trap is that true resilience demands multi-zone or multi-region deployment to survive zonal failures, not just cluster redundancy.

11
Multi-Selecthard

Which TWO actions should a developer take to ensure that a Cloud Run service can access a Cloud SQL instance securely?

Select 2 answers
A.Use a Cloud NAT to provide outbound internet access for the service.
B.Assign a public IP to the Cloud SQL instance and allow all traffic from Cloud Run.
C.Use the Cloud SQL Auth Proxy as a sidecar container in the same pod.
D.Configure the service with a VPC connector and use private IP for Cloud SQL.
E.Create a service account with the cloudsql.instances.connect permission.
AnswersC, D

Correct; Cloud SQL Auth Proxy provides secure IAM-based access.

Why this answer

The Cloud SQL Auth Proxy, when deployed as a sidecar container in the same pod, provides encrypted connections and IAM-based authentication to Cloud SQL without requiring a public IP or complex network configuration. It automatically handles TLS 1.3 encryption and uses the service account's IAM permissions to authorize connections, ensuring secure access from Cloud Run.

Exam trap

The PCD exam often tests the misconception that a service account permission alone (Option E) is sufficient for secure access, when in reality the permission must be paired with a connectivity method like the Cloud SQL Auth Proxy or a VPC connector to actually establish the encrypted channel.

12
MCQmedium

An organization is migrating a MySQL 5.7 database to Cloud SQL for MySQL 8.0. They have many tables using MyISAM engine and want to ensure compatibility. What is the correct approach for handling MyISAM tables?

A.Migrate as-is and change engine after migration using mysqldump with --skip-create-options.
B.Use Database Migration Service which automatically converts MyISAM to InnoDB during migration.
C.Keep MyISAM as is; Cloud SQL fully supports MyISAM in MySQL 8.0.
D.Convert MyISAM tables to InnoDB using ALTER TABLE ENGINE=InnoDB before migration.
AnswerD

Converting to InnoDB ensures transactional integrity and better performance on Cloud SQL.

Why this answer

Cloud SQL for MySQL 8.0 supports InnoDB as the default engine. MyISAM tables are not recommended because they lack transaction support and row-level locking. The best practice is to convert MyISAM tables to InnoDB using ALTER TABLE ...

ENGINE=InnoDB before or after migration.

13
Multi-Selectmedium

A company has a Cloud SQL for MySQL instance in the us-central1 region. They want to improve read performance for a report generation tool that runs in us-west1, and also provide disaster recovery in case the primary fails. Which TWO actions should they take?

Select 2 answers
A.Configure the report generation tool to connect to the cross-region replica.
B.Create a cross-region read replica in us-west1.
C.Enable high availability (HA) on the primary instance.
D.Change the primary instance to a larger machine type.
E.Add a read replica in us-central1.
AnswersA, B

This offloads reads to the replica and improves performance.

Why this answer

Cross-region read replicas serve both read scaling in another region and disaster recovery. A regional HA instance only provides HA within the same region. Increasing machine type improves performance but not DR.

Creating a read replica in the same region does not help with cross-region DR.

14
MCQeasy

A developer sets environment variables for a Cloud Function as shown. What is the security concern?

A.The variable name FOO is too short and does not follow naming conventions.
B.The variable DB_PASS should be set as a build variable instead.
C.There is no encryption applied to environment variables.
D.The password is exposed in plain text and should be stored in Secret Manager.
AnswerD

The password is exposed in plain text in environment variables. It should be stored in Secret Manager to prevent unauthorized access.

Why this answer

Storing a password in plain text in an environment variable exposes it to anyone with access to the function's configuration. Cloud Secret Manager should be used to store secrets securely. Option A is incorrect because the variable name FOO, while short, is syntactically valid and does not pose a security risk.

Option B is incorrect because build variables are for build-time settings, not runtime secrets, and the security concern is about exposure, not where the variable is set. Option C is incorrect because encryption at rest is not applicable; environment variables are not encrypted by default, but the main issue is visibility, not encryption.

15
MCQhard

During a live migration from MySQL to Cloud SQL using DMS, the migration job enters a 'failed' state after the full dump. The error log indicates 'Binlog position out of bounds'. What is the most likely cause?

A.The Cloud SQL instance is not using InnoDB engine.
B.The source MySQL binary log retention period is too short.
C.The DMS job is configured for one-time migration instead of continuous.
D.The source database has GTID mode disabled.
AnswerB

Binary logs must be retained long enough for CDC to catch up; if purged, DMS cannot find the binlog position.

Why this answer

DMS CDC requires that binary logs on the source are retained from the point of the full dump until cutover. If the binary logs are purged (e.g., by expiring logs or manual cleanup), the CDC phase cannot continue.

16
MCQmedium

A company wants to use BigQuery Omni to query data stored in Amazon S3. They have set up a BigQuery Omni connection. Which querying method should they use?

A.Create an external table referencing the S3 data
B.Use Cloud Storage Transfer Service
C.Use the BigQuery Data Transfer Service to copy data
D.Use the bq load command to load data into BigQuery
AnswerA

External tables allow querying without moving data into BigQuery storage.

Why this answer

BigQuery Omni uses external tables stored in S3 (or Azure Blob). You create an external table that points to the S3 location, then query it with standard SQL.

17
MCQhard

An application running on Compute Engine uses Cloud Storage for storing user-uploaded images. During load testing, the application experiences high latency when reading images. The developer suspects that the application is making too many small read requests. Which approach should the developer take to optimize performance?

A.Enable Cloud CDN to cache the images at edge locations.
B.Rewrite the objects to use a different storage class.
C.Increase the read size to reduce the number of API requests.
D.Mount the Cloud Storage bucket using Cloud Storage FUSE and read files from the local filesystem.
AnswerC

Reading larger chunks reduces the number of HTTP requests and improves throughput, especially for sequential access patterns.

Why this answer

The high latency is caused by many small read requests, each incurring API overhead. By increasing the read size (e.g., reading larger chunks or using range requests), the application reduces the number of API calls, which lowers cumulative latency and improves throughput. This directly addresses the root cause of excessive small reads.

Exam trap

Google Cloud often tests the misconception that caching (Cloud CDN) or filesystem mounting (FUSE) solves performance issues caused by small read patterns, when the real fix is to reduce the number of API calls by increasing the read size.

How to eliminate wrong answers

Option A is wrong because Cloud CDN caches content at edge locations to reduce latency for repeated reads, but it does not reduce the number of small read requests the application makes; it only serves cached responses for subsequent requests, not the initial small-read pattern. Option B is wrong because changing the storage class (e.g., to Nearline or Coldline) affects cost and retrieval latency for infrequently accessed data, but it does not optimize the read size or reduce the number of API requests for small reads. Option D is wrong because Cloud Storage FUSE mounts the bucket as a local filesystem, but it still translates file operations into API calls; small reads from the filesystem still generate many underlying API requests, and FUSE can introduce additional overhead, not reduce it.

18
MCQhard

Refer to the exhibit. A developer deployed a Cloud Run service with the above command. They notice that the service's latency is higher than expected under load. The service performs CPU-intensive tasks. What is the most likely reason for the high latency?

A.The service is using gen2, which does not support CPU-intensive workloads
B.The service should be deployed with --max-instances set to a lower number
C.The execution environment is gen2, which only allocates CPU during request processing by default; the high concurrency causes CPU contention
D.The memory is insufficient for the concurrency level
AnswerC

Gen2 CPU is only allocated during request processing unless CPU always on is set.

Why this answer

Cloud Run's gen2 execution environment, by default, allocates CPU only during request processing. When concurrency is high, multiple requests compete for the same CPU quota, causing contention and increased latency for CPU-intensive tasks. The service's CPU-intensive nature exacerbates this issue, as the CPU is not continuously available between requests.

Exam trap

Google often tests the distinction between gen1 (CPU always on) and gen2 (CPU only during request processing) execution environments, and the trap here is assuming that high latency under load is always a scaling or memory issue rather than a CPU allocation model nuance.

How to eliminate wrong answers

Option A is wrong because gen2 does support CPU-intensive workloads; the issue is not lack of support but the default CPU allocation model. Option B is wrong because lowering --max-instances would reduce concurrency but not address the root cause of CPU contention within each instance; it could even worsen latency by limiting scaling. Option D is wrong because the problem is CPU allocation, not memory; insufficient memory would typically cause out-of-memory errors or throttling, not directly higher latency under load.

19
MCQmedium

A company wants to replicate data from an on-premises Oracle database to BigQuery for analytics. They need serverless, near-real-time CDC with minimal operational overhead. Which service should they use?

A.Cloud Data Fusion with Oracle plugin
B.Cloud Composer with scheduled jobs
C.Datastream
D.Dataflow with a Java transformation
AnswerC

Datastream provides serverless CDC from Oracle to BigQuery.

Why this answer

Datastream is a serverless, fully managed change data capture (CDC) and replication service that streams data from Oracle (and other sources) into BigQuery with near-real-time latency. It uses log-based CDC (Oracle Redo Logs) to capture changes without impacting source performance, and it handles schema mapping and data transformation automatically, minimizing operational overhead.

Exam trap

A common trap is to assume that Dataflow is necessary for streaming CDC, but Datastream is the purpose-built, serverless service for database-to-BigQuery replication with minimal operational overhead. Dataflow requires custom CDC implementation, increasing complexity.

How to eliminate wrong answers

Option A is wrong because Cloud Data Fusion is a batch-oriented ETL/ELT service that requires manual pipeline configuration and does not provide native, serverless, near-real-time CDC from Oracle to BigQuery; its Oracle plugin is for batch reads, not continuous log-based streaming. Option B is wrong because Cloud Composer is a managed Apache Airflow service for orchestrating scheduled batch jobs, not a real-time CDC solution; it would introduce latency and operational overhead for near-real-time replication. Option D is wrong because Dataflow with a Java transformation is a powerful stream/batch processing engine but requires custom code to implement CDC logic (e.g., reading Oracle logs) and is not a turnkey, serverless CDC service; it adds development and maintenance overhead compared to Datastream.

20
MCQmedium

A company has an application using Cloud SQL MySQL and wants to add a caching layer. They also need the cache to persist data across restarts. Which Memorystore tier should they choose?

A.Memorystore for Redis Basic tier
B.Memorystore for Redis Standard tier
C.Memorystore for Memcached
D.Cloud Bigtable
AnswerB

Standard tier provides replication and persistence.

Why this answer

Memorystore for Redis Standard tier is the correct choice because it provides replication (a replica node) and automatic failover, which enables data persistence across restarts. Unlike the Basic tier, which is a single node with no persistence guarantees, the Standard tier uses append-only file (AOF) persistence to ensure data survives node restarts. This meets the requirement for a caching layer that persists data across restarts.

Exam trap

The Google PCD exam often tests the distinction between Memorystore tiers by making candidates assume that any Redis tier provides persistence, when in fact only the Standard tier (with replication) guarantees data survival across restarts.

How to eliminate wrong answers

Option A is wrong because Memorystore for Redis Basic tier is a single-node deployment with no replication or persistence, so data is lost on restart. Option C is wrong because Memorystore for Memcached is a pure cache with no persistence capabilities; it is designed for ephemeral data and loses all data on restart. Option D is wrong because Cloud Bigtable is a fully managed NoSQL wide-column database, not a caching layer, and is overkill for a simple cache; it also does not provide the low-latency, in-memory caching semantics required.

21
MCQeasy

A company is migrating an on-premises PostgreSQL database to Cloud SQL for PostgreSQL. They need to minimize downtime and ensure continuous replication during the cutover. Which Google Cloud service should they use to achieve continuous change data capture (CDC)?

A.Cloud Data Fusion
B.Database Migration Service (DMS)
C.Dataproc
D.Cloud Memorystore
AnswerB

DMS provides continuous migration with CDC from PostgreSQL to Cloud SQL PostgreSQL.

Why this answer

Database Migration Service (DMS) supports continuous change data capture (CDC) for PostgreSQL migrations to Cloud SQL by using PostgreSQL's native logical replication. This allows DMS to replicate ongoing changes from the source to the target with minimal downtime, enabling a near-zero-downtime cutover by simply promoting the Cloud SQL instance as the new primary.

Exam trap

The trap here is that candidates may confuse Cloud Data Fusion's ETL capabilities with database replication, not realizing that DMS is the only Google Cloud service purpose-built for live database migrations with CDC support.

How to eliminate wrong answers

Option A is wrong because Cloud Data Fusion is a data integration and ETL service, not a database migration tool; it does not provide continuous CDC for PostgreSQL to Cloud SQL. Option C is wrong because Dataproc is a managed Spark and Hadoop service for big data processing, not designed for database replication or CDC. Option D is wrong because Cloud Memorystore is a managed Redis/Memcached in-memory cache service, which cannot perform CDC or replicate PostgreSQL data.

22
MCQhard

A company runs a critical application on Compute Engine with a stateful database. They need to achieve 99.99% availability for the database tier. Which architecture should they implement?

A.A Compute Engine instance group with managed instance groups and a regional persistent disk configured for synchronous replication.
B.Use Cloud SQL with automatic failover and read replicas.
C.Two Compute Engine instances in different zones with a shared Zonal persistent disk.
D.Single Compute Engine instance with a persistent disk snapshot scheduled every hour.
AnswerA

Regional persistent disks replicate data synchronously across zones, and the managed instance group can automatically fail over to a new instance in another zone on failure, achieving high availability.

Why this answer

A managed instance group with a regional persistent disk configured for synchronous replication provides the necessary 99.99% availability by ensuring the database runs across two zones with synchronous writes to both replicas. This architecture allows automatic failover within seconds if one zone fails, meeting the high-availability requirement without data loss.

Exam trap

The PCD exam often tests the misconception that a shared zonal persistent disk across two instances provides high availability, but the trap is that a zonal disk is still tied to a single zone and fails if that zone goes down, whereas a regional persistent disk is required for true multi-zone resilience.

How to eliminate wrong answers

Option B is wrong because Cloud SQL with automatic failover and read replicas is a managed database service that offers up to 99.95% availability, not 99.99%, and read replicas are asynchronous, which can lead to data loss during failover. Option C is wrong because two Compute Engine instances in different zones with a shared zonal persistent disk cannot achieve 99.99% availability, as a zonal disk is tied to a single zone and becomes inaccessible if that zone fails, causing a single point of failure. Option D is wrong because a single Compute Engine instance with hourly persistent disk snapshots provides no high availability; recovery from a snapshot can take minutes to hours, far exceeding the downtime allowed for 99.99% availability (approximately 52.56 minutes per year).

23
MCQhard

A company has a multi-region Cloud Run service with traffic splitting between revisions. They notice that a newly rolled-out revision is receiving 0% of traffic even though they set traffic to 100% via the console. The revision shows 'Ready: Yes'. What is the most likely cause?

A.The revision has a low CPU limit causing it to be throttled.
B.The revision is not healthy because of a misconfigured health check.
C.The revision has a tag but no traffic percentage assigned; the tag is being used for routing.
D.The revision has a concurrency setting of 0, which is invalid.
AnswerC

If a revision has a tag, it may be accessible only via that URL; without a traffic percentage, it won't serve at the default URL.

Why this answer

When a revision shows 'Ready: Yes' but receives 0% traffic despite setting 100% via the console, the most likely cause is that the revision has a tag assigned but no traffic percentage. In Cloud Run, tags are used for direct URL routing (e.g., for testing) and do not receive any traffic from the service's main URL unless a traffic percentage is explicitly assigned. The console's traffic splitting UI allows setting a tag without a percentage, which can lead to this confusion.

Exam trap

The trap here is that candidates assume setting traffic to 100% in the console automatically distributes traffic to the latest revision, but they overlook that a tag can override this behavior by creating a separate routing path without a traffic percentage.

How to eliminate wrong answers

Option A is wrong because a low CPU limit would cause throttling or performance degradation, not a complete 0% traffic assignment; Cloud Run still routes traffic to the revision even if it is throttled. Option B is wrong because if the revision were unhealthy due to a misconfigured health check, the revision would show 'Ready: No' or be in a failed state, not 'Ready: Yes'. Option D is wrong because a concurrency setting of 0 is invalid and would cause a deployment error or revision failure, not a 0% traffic split with a healthy revision.

24
MCQmedium

An engineer needs to create a cross-region read replica for a Cloud SQL for MySQL instance for disaster recovery. Which step is required?

A.Create the replica in a different zone within the same region
B.Configure an external replica in the target region
C.Enable HA on the primary instance first
D.Create the replica in a different region
AnswerD

Cross-region read replicas can be created in any region, supporting DR.

Why this answer

Cross-region read replicas are supported in Cloud SQL for MySQL. The engineer can create a read replica in a different region from the primary instance. Read replicas are promoted for DR.

HA configuration is regional only. External replicas are for on-premises. Binary logging must be enabled on the primary.

25
MCQmedium

An online gaming company uses Cloud SQL for MySQL for player data and wants to synchronise some of that data to a BigQuery dataset daily for analytics. The data transformations are complex (e.g., aggregations, joins with other sources). Which service should they use to build this pipeline?

A.Datastream with BigQuery as destination
B.Dataflow pipeline using JDBC source and BigQuery sink
C.BigQuery Data Transfer Service for Cloud SQL
D.Cloud Functions triggered by Cloud Scheduler
AnswerB

Dataflow can read from Cloud SQL via JDBC, perform complex transformations, and write to BigQuery.

Why this answer

Dataflow provides a fully managed, serverless execution environment for Apache Beam pipelines, which can read from Cloud SQL via a JDBC source, perform complex transformations (aggregations, joins with other sources) in a distributed manner, and write the results to BigQuery as a sink. This directly addresses the requirement for complex, daily transformations that are beyond the capabilities of simpler services.

Exam trap

The trap here is that candidates often confuse Datastream's CDC replication (which is for continuous, near-real-time sync without transformations) with the need for a batch ETL pipeline that requires complex transformations, leading them to incorrectly choose Option A.

How to eliminate wrong answers

Option A is wrong because Datastream is designed for continuous, change data capture (CDC) replication to BigQuery, not for executing complex batch transformations like aggregations and joins with other sources. Option C is wrong because BigQuery Data Transfer Service for Cloud SQL only supports one-time or scheduled full table snapshots without any built-in transformation capabilities, so it cannot handle complex aggregations or joins. Option D is wrong because Cloud Functions have a maximum execution timeout of 9 minutes and limited memory, making them unsuitable for processing large volumes of data or performing complex, long-running transformations.

26
Multi-Selecthard

You are designing a Cloud Bigtable schema for a time-series application that stores metrics from millions of devices. The row key is currently deviceID#timestamp. You want to avoid hotspotting on writes and optimize scan performance for reading all data from a specific device within a time range. Which two row key design strategies should you apply? (Choose 2)

Select 2 answers
A.Add a salt prefix to the row key (e.g., hash of deviceID)
B.Reverse the timestamp so that recent data appears first
C.Store data in multiple tables per device
D.Use a single column family for all metrics
E.Promote the device type to the start of the row key
AnswersA, B

Salting distributes writes across tablets to avoid hotspots.

Why this answer

Adding a salt prefix (e.g., a hash of the deviceID) distributes write load across multiple tablet servers, preventing hotspotting on a single node when many devices write concurrently. This ensures that sequential timestamps for the same device are not all written to the same tablet, which would otherwise cause a bottleneck.

Exam trap

A common trap in Google Cloud Bigtable is believing that reversing the timestamp alone prevents hotspotting. While it improves scan order for recent data, it does not distribute write load; a salted row key (e.g., hashed device ID) is also required to avoid writing all data for a device to the same tablet server. Both strategies are needed together.

27
MCQmedium

An e-commerce platform uses Memorystore for Redis as a session store. During a flash sale, the application experiences high latency and some sessions are evicted. The application currently uses a Standard Tier instance with 5 GB of memory. What is the MOST effective solution to improve performance and prevent evictions?

A.Increase the instance memory to 10 GB and enable persistence
B.Switch from Standard Tier to Basic Tier to reduce overhead
C.Delete all unused keys hourly using a scheduled job
D.Implement a cache-aside pattern with Cloud Firestore
AnswerA

Increasing memory capacity prevents evictions; persistence ensures data survives restarts, but the main fix is more memory.

Why this answer

Memorystore for Redis has two tiers: Basic (no replication, no HA) and Standard (replicated, HA). Basic tier does not support replication or high availability. Increasing memory to 10 GB provides more room for session data, preventing evictions.

Using a larger machine type with additional memory is the correct remedy for evictions. Changing to Basic tier would worsen availability. Using a cache aside pattern is a client-side optimization, not directly addressing evictions.

Deleting unused keys may free space but is not a scalable solution.

28
MCQmedium

An organization plans to adopt polyglot persistence: Cloud SQL for transactions, Cloud Bigtable for time-series, and BigQuery for analytics. They need to ensure data consistency when updating both Cloud SQL and Bigtable in a single business transaction. What approach should they use?

A.Use Cloud Spanner for all data to avoid cross-database consistency issues.
B.Implement a saga pattern where each database operation is a local transaction, with compensating actions for failures.
C.Use a two-phase commit protocol across Cloud SQL and Bigtable.
D.Write to Cloud SQL first, then use Cloud Functions to asynchronously write to Bigtable with retries.
AnswerB

The saga pattern is the recommended approach for distributed transactions across polyglot stores; each step has a compensating action to maintain eventual consistency.

29
Multi-Selectmedium

A team is migrating a MySQL database to Cloud SQL for MySQL. They want to test the migration with a dual-write strategy before cutting over to the new database. Which TWO steps should they take?

Select 2 answers
A.Delete the source database after the first successful write.
B.Direct all reads to Cloud SQL to validate performance.
C.Configure the application to write to both the source and target databases simultaneously.
D.Use Database Migration Service to set up continuous replication.
E.Run comparison queries to verify data consistency between source and target.
AnswersC, E

This is the essence of dual-write: each write operation is performed on both databases.

Why this answer

Shadow writes (dual-write) involve writing to both databases and comparing results. Comparison queries and load testing are validation techniques.

30
MCQeasy

A company needs a fully managed, globally distributed relational database that supports ACID transactions across regions. Which Google Cloud service should they choose?

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

Spanner provides global distribution with strong consistency and ACID transactions.

Why this answer

Cloud Spanner is the only Google Cloud database that is fully managed, globally distributed, and supports ACID transactions. Cloud SQL is regional. Bigtable is NoSQL and does not support ACID transactions.

Firestore is a document database with limited transaction support but not globally distributed in the same way.

31
Multi-Selecthard

A Cloud SQL for PostgreSQL instance is experiencing high query latency. The database has a high number of read replicas and is used for reporting. The team has identified that index scans are not being used effectively. Which THREE actions should they take to improve query performance?

Select 3 answers
A.Analyze table statistics using VACUUM ANALYZE.
B.Increase the number of CPUs on the primary instance.
C.Enable automatic storage increase.
D.Use pg_stat_statements to identify slow queries.
E.Create additional read replicas.
AnswersA, B, D

Updating statistics helps the query planner choose index scans over sequential scans.

Why this answer

`VACUUM ANALYZE` updates table statistics that the PostgreSQL query planner relies on to choose efficient index scans. Stale statistics can cause the planner to underestimate the selectivity of index conditions, leading to sequential scans instead of index scans, which increases latency. Regular analysis ensures the planner has accurate data distribution information to optimize query execution plans.

Exam trap

The PCD exam often tests the distinction between symptom mitigation (adding replicas or CPUs) and root-cause resolution (updating statistics), leading candidates to choose resource scaling options instead of the correct maintenance operation.

32
Multi-Selectmedium

Which TWO are best practices for testing containerized applications on Google Cloud?

Select 2 answers
A.Use Kubernetes for testing only.
B.Use Distroless images for testing.
C.Use Cloud Build to build and test containers.
D.Use a different base image for testing than production.
E.Run tests inside the container as a separate layer using Docker multi-stage builds.
AnswersC, E

Cloud Build integrates seamlessly with container workflows.

Why this answer

Cloud Build is a managed CI/CD platform that can build container images from source code and execute tests as part of the build pipeline. It integrates natively with Google Cloud services like Container Registry and Artifact Registry, and supports custom build steps, making it an ideal tool for building and testing containerized applications in a consistent, automated environment.

Exam trap

The PCD exam often tests the misconception that testing should use a different base image to avoid production bloat, but the correct practice is to use the same base image for testing and production to ensure consistency, while leveraging multi-stage builds to separate build and test dependencies from the final runtime image.

33
MCQeasy

A company deploys a microservices application on Google Kubernetes Engine (GKE). The operations team needs to monitor API latency between services. Which Google Cloud service should they use to trace requests across services?

A.Error Reporting
B.Cloud Logging
C.Cloud Monitoring
D.Cloud Trace
AnswerD

Cloud Trace provides distributed tracing to analyze latency across services.

Why this answer

Cloud Trace is the correct choice because it is a distributed tracing system designed to capture latency data as requests propagate through microservices. It provides end-to-end visibility by collecting trace spans from each service, allowing the operations team to identify bottlenecks and measure API latency between services in a GKE environment.

Exam trap

The trap here is that candidates confuse Cloud Monitoring (metrics) with Cloud Trace (distributed tracing), assuming that latency metrics alone can trace requests across services, but metrics lack the span-level context needed to follow a single request's path.

How to eliminate wrong answers

Option A is wrong because Error Reporting aggregates and analyzes application errors, not latency traces. Option B is wrong because Cloud Logging stores and queries log data, but it does not provide the distributed trace context needed to follow a request across multiple services. Option C is wrong because Cloud Monitoring focuses on metrics, alerts, and dashboards (e.g., CPU, memory), not on tracing individual request paths or measuring per-hop latency.

34
MCQmedium

A company runs a critical PostgreSQL database on Cloud SQL. They want to enforce that all client connections use SSL/TLS encryption. Which step is necessary to ensure this?

A.Enable IAM database authentication
B.Use the Cloud SQL Auth Proxy to connect
C.Assign a private IP address to the instance
D.Set the 'require_ssl' flag to 'on' for the instance
AnswerD

This flag enforces SSL/TLS for all connections. Clients without SSL will be rejected.

Why this answer

Cloud SQL provides a server-side SSL certificate and optionally enforces encryption using the 'require_ssl' flag (or 'cloudsql.ssl_mode' in newer versions). IAM authentication does not enforce SSL. The Auth Proxy uses SSL by default but does not enforce it at the database level.

Private IP alone does not encrypt traffic.

35
Multi-Selecthard

A company uses Cloud Spanner for a globally distributed application. They need to design their table schema for maximum scalability and performance. Which two design considerations are critical? (Choose two.)

Select 2 answers
A.Use interleaved tables to colocate related data.
B.Store large binary blobs directly in Spanner.
C.Define secondary indexes on every column.
D.Use monotonically increasing primary keys.
E.Choose primary keys that distribute write load evenly across nodes.
AnswersA, E

Interleaved tables store parent and child rows in the same split, reducing the number of participants in transactions and improving performance.

Why this answer

Interleaved tables in Cloud Spanner physically colocate parent and child rows on the same split, reducing cross-node reads and improving join performance. This design is critical for globally distributed applications because it minimizes latency and ensures that related data is stored together for efficient access.

Exam trap

The PCD exam often tests the misconception that secondary indexes on every column improve query performance, but in Spanner they increase write latency and storage costs without benefiting all queries.

36
MCQhard

A company is migrating a MySQL 5.7 database to Cloud SQL for MySQL 8.0. Their application uses utf8 charset and GROUP BY with nonstandard behavior (e.g., missing expressions in SELECT list). After migration, they notice queries that previously ran now fail. What is the most likely cause?

A.The caching_sha2_password plugin changed authentication.
B.JSON data type behavior changed in MySQL 8.0.
C.ONLY_FULL_GROUP_BY SQL mode is enabled by default in MySQL 8.0.
D.The utf8 charset is not supported in MySQL 8.0.
AnswerC

This causes queries with GROUP BY that don't include all non-aggregated columns in SELECT to fail.

Why this answer

MySQL 5.7 allowed GROUP BY with columns not in the SELECT list by default (ONLY_FULL_GROUP_BY was off), but MySQL 8.0 enables it by default. This change can cause queries to fail if they rely on the old behavior.

37
MCQeasy

A developer is using Cloud Spanner for a global application. They need to design a schema to avoid hotspots. Which practice should they follow?

A.Use a UUID primary key
B.Use a monotonically increasing primary key
C.Use a composite primary key with a timestamp
D.Use a hash prefix on the primary key
AnswerD

A hash prefix distributes write load evenly across nodes, avoiding hotspots.

Why this answer

Cloud Spanner uses a distributed architecture that splits data across splits based on the primary key. A monotonically increasing or timestamp-based key causes all new writes to hit a single split, creating a hotspot. By using a hash prefix on the primary key, writes are distributed uniformly across all splits, avoiding hotspots and maximizing write throughput.

Exam trap

The PCD exam often tests the misconception that any random key (like UUID) automatically avoids hotspots, but in Cloud Spanner, the key distribution must be explicitly designed to avoid sequential patterns, and a hash prefix is the recommended pattern.

How to eliminate wrong answers

Option A is wrong because a UUID primary key, while random, is 128 bits and can still lead to uneven distribution and hotspotting if the UUID generation is not truly random or if the application uses sequential UUIDs (e.g., UUID v1). Option B is wrong because a monotonically increasing primary key (e.g., auto-increment integer) causes all new rows to be written to the last split, creating a severe write hotspot. Option C is wrong because a composite primary key with a timestamp as the leading column causes all writes at the same time to target the same split, again creating a hotspot.

38
MCQhard

A startup is migrating an on-premises PostgreSQL 14 database to Cloud SQL. The database is 500 GB and handles OLTP workloads. They want to minimize downtime during migration. Which approach should they use?

A.Export the database using pg_dump and import using psql
B.Create a Cloud SQL read replica from the on-premises database
C.Use gcloud sql import to directly import from a dump file
D.Use Database Migration Service (DMS) with continuous replication
AnswerD

DMS supports continuous replication for minimal downtime.

Why this answer

Database Migration Service (DMS) supports continuous replication from source PostgreSQL to Cloud SQL, allowing near-zero downtime. Export/import requires downtime. Replica promotion is not a migration method.

39
MCQmedium

A company uses Cloud Bigtable for AdTech clickstream data. They notice that some tables have many deleted rows and the storage cost is increasing. What should they configure to automatically remove deleted data and reduce storage?

A.Set up cluster replication to a secondary cluster
B.Enable compaction on the table
C.Configure a garbage collection policy based on time or number of versions
D.Use IAM conditions to restrict write access
AnswerC

Garbage collection automatically removes old or deleted data, reducing storage.

Why this answer

Cloud Bigtable automatically compacts data in the background, but deleted rows are not immediately removed; they remain as tombstones until a garbage collection policy is applied. By configuring a garbage collection policy based on time or number of versions, you instruct Bigtable to permanently delete expired data and reclaim storage space, reducing costs.

Exam trap

A common misconception is that compaction alone removes deleted data, but without a garbage collection policy, tombstones persist and storage is not reclaimed.

How to eliminate wrong answers

Option A is wrong because cluster replication is used for high availability and disaster recovery, not for removing deleted data; it actually increases storage cost by duplicating data across clusters. Option B is wrong because compaction is an automatic background process in Bigtable that merges SSTables and removes tombstones, but it does not enforce a retention policy—without a garbage collection policy, tombstones can persist indefinitely. Option D is wrong because IAM conditions control access permissions, not data lifecycle management; they cannot remove deleted rows or reduce storage.

40
MCQmedium

An e-commerce company is designing a global product inventory system that requires strong consistency across regions, horizontal scaling for millions of users, and 99.999% availability. Which Google Cloud database meets all these requirements?

A.Firestore
B.Cloud Bigtable
C.Cloud Spanner
D.Cloud SQL for PostgreSQL
AnswerC

Cloud Spanner uses atomic clocks and the TrueTime API to enforce external consistency across globally distributed nodes, satisfying the strong consistency requirement. Its horizontal scaling via automatic sharding and replication supports millions of users, while multi-region deployment with synchronous replication achieves 99.999% availability for the inventory system.

Why this answer

Cloud Spanner is the only Google Cloud database that provides globally distributed ACID transactions with strong consistency, horizontal scaling, and 99.999% SLA.

41
MCQeasy

A mobile app needs to store user preferences as a simple key-value store. The data is infrequently accessed and should be highly available with no operational overhead. The app is already using Firebase. Which database is the best fit?

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

Firestore is serverless, no operational overhead, integrates with Firebase, and suitable for key-value data.

Why this answer

Firestore is serverless, integrates with Firebase, and is ideal for storing user preferences as documents.

42
Multi-Selecthard

Which THREE of the following are valid reasons to use Cloud Deploy instead of manually applying kubectl commands in a CI/CD pipeline?

Select 3 answers
A.Cloud Deploy automatically containerizes applications.
B.Cloud Deploy maintains a deployment history for auditing.
C.Cloud Deploy enforces IAM roles on Kubernetes clusters.
D.Cloud Deploy provides automatic rollbacks on deployment failure.
E.Cloud Deploy supports canary and blue-green deployments out of the box.
AnswersB, D, E

Audit trail is built-in.

Why this answer

Cloud Deploy automatically maintains a detailed deployment history, including the state of each rollout, approvals, and metadata. This history is stored in the Cloud Deploy API and can be queried for auditing, compliance, and troubleshooting purposes, which is not natively provided by manual kubectl commands in a CI/CD pipeline.

Exam trap

The trap here is that candidates may confuse Cloud Deploy's role in the CI/CD pipeline with containerization or cluster-level security, assuming it handles build or IAM enforcement, when in fact it is a continuous delivery service focused on rollout strategies and auditability.

43
Multi-Selectmedium

A team is implementing a CI/CD pipeline for a Cloud Function using Cloud Build. Which three steps should they include in their cloudbuild.yaml? (Choose 3)

Select 3 answers
A.Static code analysis
B.Deploy the function
C.Run unit tests
D.Build a container image
E.Manual approval step
AnswersA, B, C

Static analysis (linting, security scanning) is a good practice to include in the pipeline.

Why this answer

Static code analysis (A) is correct because it helps identify code quality issues, security vulnerabilities, and adherence to coding standards early in the pipeline, which is a best practice for Cloud Functions. Running unit tests (C) is essential to validate function logic before deployment. Deploying the function (B) is the final step that pushes the validated code to Cloud Functions, making it a required step in the CI/CD pipeline.

Exam trap

The PCD exam often tests the misconception that Cloud Functions require building a container image for all runtimes, but in reality, only custom container runtimes (e.g., using Dockerfile) need that step, while the default runtimes use source-based deployment.

44
MCQeasy

A startup wants to deploy a web application on App Engine standard environment. They need to handle sudden traffic spikes automatically. How should they configure scaling?

A.Use automatic scaling.
B.Use basic scaling with idle timeout.
C.Use manual scaling with a fixed number of instances.
D.Use a combination of manual and automatic scaling.
AnswerA

Automatic scaling adjusts instance count based on traffic.

Why this answer

Automatic scaling is the correct choice because App Engine standard environment natively supports automatic scaling, which dynamically adds or removes instances based on request rate, latency, and other metrics. This allows the application to handle sudden traffic spikes without manual intervention, as the platform automatically provisions resources to meet demand.

Exam trap

The trap is that basic scaling might seem appropriate because it can start instances on demand, but it introduces startup latency and does not automatically scale down based on load, making automatic scaling the better choice for handling sudden traffic spikes in App Engine standard environment.

How to eliminate wrong answers

Option B is wrong because basic scaling requires instances to be manually started and stopped, and while it can handle spikes, it relies on an idle timeout to shut down instances, which is not designed for automatic, seamless handling of sudden traffic spikes. Option C is wrong because manual scaling uses a fixed number of instances, which cannot automatically adjust to traffic spikes, leading to potential over-provisioning or under-provisioning. Option D is wrong because App Engine does not support a combination of manual and automatic scaling; you must choose one scaling type for the entire service.

45
Multi-Selecteasy

Which TWO features are provided by Google Cloud Deploy? (Choose 2.)

Select 2 answers
A.Rollback to a previous deployment revision.
B.Run containers without managing infrastructure.
C.Automated canary analysis based on deployment verification.
D.Build container images from source code.
E.Manage Kubernetes clusters across multi-cloud environments.
AnswersA, C

Cloud Deploy supports rollbacks.

Why this answer

Google Cloud Deploy is a managed continuous delivery service that automates the rollout of applications to Google Kubernetes Engine (GKE) or GKE Enterprise clusters. It supports rollback to a previous deployment revision (A) by reverting the target cluster to the last known good state, and it provides automated canary analysis (C) by integrating with Cloud Monitoring to verify deployment health metrics before progressing traffic shifts.

Exam trap

Google Cloud often tests the distinction between deployment orchestration (Cloud Deploy) and other GCP services like Cloud Build (image building) or Cloud Run (serverless compute), so candidates mistakenly associate Cloud Deploy with building images or managing infrastructure.

46
Multi-Selectmedium

A company is deploying a containerized application on Cloud Run that needs to connect to a Cloud SQL (MySQL) database. The database must not be accessible from the public internet. Which two steps should the company take to secure the connection?

Select 2 answers
A.Enable automatic IAM database authentication for Cloud SQL.
B.Create a Cloud NAT gateway for outbound traffic from Cloud Run.
C.Use Cloud SQL Auth proxy within the Cloud Run container.
D.Set Cloud SQL to have a private IP address only.
E.Configure a VPC Serverless Access connector and attach it to the Cloud Run service.
AnswersD, E

A private IP ensures the database is not exposed to the public internet, meeting the security requirement.

Why this answer

Setting Cloud SQL to have a private IP address only (Option D) ensures the database is accessible only within the VPC network, not from the public internet. This eliminates exposure to external threats and is a fundamental security best practice for private database access.

Exam trap

The trap here is that candidates often think Cloud SQL Auth proxy alone is sufficient for security, but it does not prevent public internet access to the database; the proxy only encrypts the connection, while the database's IP address remains publicly reachable unless explicitly set to private.

47
MCQeasy

A developer wants to containerize a Node.js application and deploy it to Cloud Run. They need to ensure the container is as small as possible. What should they do?

A.Use a full Ubuntu base image with all dependencies.
B.Use a multi-stage Dockerfile with a distroless base image.
C.Use a node:latest image and remove unnecessary files.
D.Use a simple FROM scratch image.
AnswerB

Multi-stage builds copy only runtime dependencies, and distroless images are minimal.

Why this answer

A multi-stage Dockerfile allows you to separate the build environment from the runtime environment. By using a distroless base image (e.g., gcr.io/distroless/nodejs), you include only the application and its runtime dependencies, omitting package managers, shells, and other OS utilities. This results in a significantly smaller container image, which reduces attack surface and improves deployment speed on Cloud Run.

Exam trap

The PCD exam often tests the misconception that 'FROM scratch' is the smallest possible image for any application, but candidates must recognize that scratch images lack the runtime libraries required by interpreted languages like Node.js, making distroless the correct minimal choice.

How to eliminate wrong answers

Option A is wrong because using a full Ubuntu base image with all dependencies results in a large image (hundreds of MB) that includes unnecessary OS utilities, increasing attack surface and deployment time. Option C is wrong because using node:latest and removing unnecessary files is inefficient; the image still contains the full OS layer and package manager, and manual removal is error-prone and does not achieve the minimal size of a distroless image. Option D is wrong because a FROM scratch image provides no base filesystem or runtime libraries, and Node.js applications require the Node.js runtime and system libraries (e.g., libc, libstdc++) that are not present in a scratch image, causing the container to fail to start.

48
MCQeasy

Which Google Cloud database is best suited for high-throughput, low-latency caching to reduce load on a primary database?

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

Memorystore provides managed Redis/Memcached for caching.

Why this answer

Memorystore (managed Redis/Memcached) is the caching layer, providing sub-millisecond access times.

49
MCQeasy

A developer wants to quickly test changes to a containerized web application that will run on Cloud Run, without building and deploying a new container. Which approach should they use?

A.Deploy to a staging Cloud Run service
B.Run locally with Docker
C.Use traffic splitting to test a new revision
D.Use Cloud Run for Anthos
AnswerB

Running the container locally with Docker provides the fastest feedback loop as it avoids deployment steps.

Why this answer

Running locally with Docker allows rapid iteration without the overhead of building and pushing to a registry and redeploying. Staging deployment is slower. Traffic splitting is for production traffic management.

Cloud Run for Anthos is for hybrid deployments.

50
Multi-Selectmedium

A company is migrating a 1 TB MySQL database to Cloud SQL for MySQL 8.0. The source uses the utf8 charset and MyISAM tables. They need to minimize downtime. Which TWO actions should the team take?

Select 2 answers
A.Convert MyISAM tables to InnoDB.
B.Use Database Migration Service with a one-time migration job.
C.Change the charset from utf8 to utf8mb4.
D.Migrate using mysqldump and mysql import.
E.Enable binary logging on the source MySQL database.
AnswersA, C

Cloud SQL requires InnoDB; MyISAM tables must be converted before migration.

Why this answer

MyISAM must be converted to InnoDB before migration. utf8 must be changed to utf8mb4 to support full Unicode. DMS continuous migration minimizes downtime.

51
MCQhard

You are designing a Cloud Spanner schema for a global user database. Users are identified by a UUID. You notice hotspotting on a specific node during writes. What is the most effective way to resolve this?

A.Use a composite primary key with a hash prefix of the UUID
B.Enable interleaved tables to store child rows with parent
C.Change the primary key to a monotonically increasing timestamp
D.Add a secondary index on the UUID column
AnswerA

This spreads writes across splits, eliminating hotspotting.

Why this answer

Hotspotting in Cloud Spanner occurs when writes are concentrated on a single node due to a monotonically increasing primary key (like a UUID without a hash prefix). By using a composite primary key with a hash prefix of the UUID, you distribute writes evenly across all nodes because the hash prefix ensures that successive writes land on different splits. This prevents a single node from becoming a bottleneck, thereby resolving the hotspotting issue.

Exam trap

A common misconception is that secondary indexes or interleaved tables can fix write distribution issues, but the root cause is the primary key design, and only modifying the primary key (e.g., with a hash prefix) directly addresses hotspotting in Cloud Spanner.

How to eliminate wrong answers

Option B is wrong because interleaved tables organize child rows physically near their parent row, which can improve read performance but does not address write hotspotting caused by the primary key distribution. Option C is wrong because changing the primary key to a monotonically increasing timestamp would worsen hotspotting, as all new writes would target the same split (the last one), concentrating load on a single node. Option D is wrong because adding a secondary index on the UUID column does not change the underlying primary key distribution; writes still use the original primary key, so hotspotting persists.

52
Multi-Selecthard

Which TWO statements about Cloud Trace are correct?

Select 2 answers
A.Trace can be integrated with Cloud Monitoring for alerting
B.Trace collects latency data from all requests by default
C.Trace automatically creates dashboards for visualization
D.Trace can be used to analyze end-to-end latency across services
E.Trace supports auto-scaling based on latency
AnswersA, D

Trace data can be used with Cloud Monitoring alerts.

Why this answer

Cloud Trace can be integrated with Cloud Monitoring to create alerting policies based on trace data, such as latency thresholds or error rates. This integration allows you to set up notifications when specific trace conditions are met, enabling proactive performance monitoring.

Exam trap

The PCD exam often tests the misconception that Cloud Trace captures all requests by default, but the key trap is that it uses sampling to manage cost and performance, so you must explicitly configure higher sampling for full visibility.

53
Multi-Selecteasy

A developer wants to view real-time logs from a running application on Compute Engine. Which two methods can they use to stream logs? (Choose two.)

Select 2 answers
A.Using the Logs Explorer's 'Stream logs' feature
B.Using gcloud compute ssh and running journalctl -f
C.Using gcloud logging tail
D.Using Cloud Monitoring's metrics explorer
E.Using gcloud app logs tail
AnswersA, C

Correct: the Logs Explorer provides a streaming view.

Why this answer

The Logs Explorer in the Google Cloud Console provides a 'Stream logs' feature that allows you to view real-time log entries as they are ingested by Cloud Logging. This is ideal for monitoring a running Compute Engine instance without needing to SSH into it. Option C is correct because the `gcloud logging tail` command streams log entries from Cloud Logging in real time, using the Logging API's tail method, and can filter by resource type (e.g., `gce_instance`) or log name.

Exam trap

The PCD exam often tests the distinction between streaming logs from the centralized Cloud Logging service versus streaming logs directly from the VM's local journal, and candidates mistakenly choose `journalctl -f` (Option B) because they think it provides the same real-time view, but it does not integrate with Cloud Logging's centralized filtering and retention.

54
MCQhard

A company deploys a stateful application using StatefulSets on GKE. They need to store persistent data on regional persistent disks for high availability. However, during zonal failures, pods are not rescheduled quickly. What is the best approach to improve recovery time?

A.Increase the number of replicas in the StatefulSet.
B.Configure podDisruptionBudget and use persistent disk with regional replication.
C.Use a headless service with external persistent storage like Filestore.
D.Use a Deployment instead of StatefulSet.
AnswerB

Regional PDs replicate across zones and PDB ensures minimum available pods during disruptions.

Why this answer

Configuring a podDisruptionBudget ensures that a minimum number of Pods remain available during voluntary disruptions, while using regional persistent disks (which replicate data across zones) allows the StatefulSet controller to quickly reschedule Pods in another zone without waiting for the failed zone's disk to become available. This combination minimizes downtime during zonal failures by maintaining quorum and ensuring data is already accessible in the surviving zone.

Exam trap

The PCD exam often tests the misconception that increasing replicas alone improves availability during zonal failures, but the real bottleneck is the persistent volume's zonal binding, which requires regional replication to allow cross-zone attachment.

How to eliminate wrong answers

Option A is wrong because increasing the number of replicas does not address the root cause of slow rescheduling during zonal failures; it only spreads Pods across more nodes but still relies on the same regional disk, which may be stuck in the failed zone. Option C is wrong because using a headless service with external persistent storage like Filestore changes the storage architecture but does not inherently improve recovery time for StatefulSets; Filestore is a network file system that introduces latency and does not provide the same zonal failover guarantees as regional PDs. Option D is wrong because using a Deployment instead of StatefulSet would lose the ordered pod identity and stable storage mapping required for stateful applications, and Deployments do not guarantee that each Pod gets its own persistent volume, which can lead to data corruption or loss.

55
Multi-Selectmedium

A DevOps team is migrating an on-premises monitoring solution to Google Cloud. They need to collect custom application metrics from a batch processing job running on Compute Engine. Which two services can ingest custom metrics into Cloud Monitoring? (Choose two.)

Select 2 answers
A.Cloud Profiler API
B.Stackdriver Monitoring agent with custom plugin
C.Cloud Logging with log-based metrics
D.Cloud Trace API
E.Cloud Monitoring API with custom metric descriptors
AnswersC, E

Correct: log-based metrics can extract numerical values from logs and create custom metrics.

Why this answer

Cloud Logging can ingest any log entry, and log-based metrics allow you to extract numeric values from log content to create custom metrics that appear in Cloud Monitoring. Option E is correct because the Cloud Monitoring API lets you define custom metric descriptors and then write time-series data directly to those metrics, bypassing any agent or log pipeline.

Exam trap

The PCD exam often tests the misconception that the Stackdriver Monitoring agent (Ops Agent) can ingest arbitrary custom metrics via plugins, when in fact it only collects predefined metrics and custom metrics require either log-based metrics or direct API calls.

56
MCQhard

A company uses Cloud Build to build Docker images and push to Artifact Registry. They want to trigger builds automatically when code is pushed to a Cloud Source Repository branch. They also need to ensure that only builds from the repository's main branch are allowed to push to the production Artifact Registry repository. What is the best way to implement this?

A.Use Cloud Source Repository webhooks and a Cloud Function to call Cloud Build
B.Use Cloud Build triggers and configure separate service accounts for each branch
C.Use Cloud Build triggers with branch filter and use IAM conditions on the Artifact Registry to restrict push based on the Cloud Build service account
D.Use Cloud Build triggers with substitution variables and separate build configurations
AnswerC

This approach allows you to create a trigger for the main branch with a dedicated service account that has write access to the production repository.

Why this answer

Cloud Build triggers with a branch filter can be set to only trigger on the main branch, and IAM conditions on the Artifact Registry can restrict push access based on the Cloud Build service account, ensuring only builds from the main branch can push to the production repository. Option A is overly complex and unnecessary. Option B does not enforce branch-level restrictions.

Option D is less direct and harder to manage.

57
MCQmedium

A mobile app team wants to store user session state with low latency and support for pub/sub messaging. They need a managed service that automatically scales. Which database is BEST suited for this?

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

Redis excels at session store, pub/sub, and caching with sub-millisecond latency.

Why this answer

Memorystore for Redis is the best choice because it provides an in-memory data store with sub-millisecond latency, ideal for session state caching, and natively supports pub/sub messaging via Redis Pub/Sub. As a managed service, it automatically handles scaling and failover, meeting the team's requirements without operational overhead.

Exam trap

Google often tests the distinction between real-time database listeners (like Firestore) and true pub/sub messaging, leading candidates to mistakenly choose Firestore for pub/sub needs when it only supports document-level real-time updates, not a general publish-subscribe channel.

How to eliminate wrong answers

Option A is wrong because Bigtable is a wide-column NoSQL database optimized for analytical workloads with high throughput, not for low-latency session state or pub/sub messaging. Option B is wrong because Cloud SQL is a relational database with higher latency due to disk-based storage and lacks built-in pub/sub capabilities. Option C is wrong because Firestore is a document database that supports real-time listeners but does not offer native pub/sub messaging; its real-time updates are limited to document changes, not a general-purpose pub/sub channel.

58
MCQmedium

You are migrating a PostgreSQL database to Cloud SQL. The database currently uses custom functions and PostGIS extensions. The target must support these extensions. Which database version and tier should you choose?

A.Cloud SQL for MySQL 8.0 with highmem machine type
B.Cloud SQL for PostgreSQL 15 with standard machine type
C.Cloud Spanner with PostgreSQL dialect
D.Cloud SQL for SQL Server 2019 with lightweight machine type
AnswerB

PostgreSQL supports PostGIS and custom functions.

Why this answer

Cloud SQL for PostgreSQL supports PostGIS and custom functions. The machine type depends on performance needs, but any tier works as long as PostgreSQL is chosen.

59
MCQmedium

A financial services company needs a globally distributed, strongly consistent database that can handle OLTP workloads with high throughput and automatic scaling. Which Google Cloud database should they use?

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

Spanner provides global distribution, strong consistency, and horizontal scaling for OLTP workloads.

Why this answer

Cloud Spanner is the only Google Cloud database that provides global distribution with strong consistency and horizontal scaling for OLTP workloads. Bigtable is eventually consistent across regions. Cloud SQL is regional.

Firestore is eventually consistent and limited to single-region or limited multi-region.

60
MCQeasy

A company has a hybrid cloud setup with on-premises applications that need to send messages to a Pub/Sub topic. The on-premises network is connected via Cloud VPN. What is the recommended way to publish messages?

A.Use a Cloud NAT instance to route traffic
B.Expose Pub/Sub publicly and use authentication via OAuth2 tokens
C.Use VPC Service Controls and Private Google Access
D.Use Cloud Router to establish BGP sessions for direct connectivity
AnswerC

Private Google Access enables on-premises to reach Google APIs via VPN, and VPC Service Controls provides security.

Why this answer

To allow on-premises access to Pub/Sub via Cloud VPN, you need to enable Private Google Access to allow traffic from on-premises to Google APIs via private IP, and VPC Service Controls to restrict data exfiltration. Option A is incorrect: Cloud NAT is for outbound internet access from private instances, not for on-premises to Google API access. Option B is incorrect: exposing Pub/Sub publicly with OAuth would not use the VPN and would be less secure.

Option D is incorrect: Cloud Router establishes BGP sessions for dynamic routing, but does not directly provide access to Pub/Sub.

61
MCQeasy

Your Cloud Run service is experiencing 5xx errors. You have enabled Cloud Logging and Cloud Error Reporting. How can you quickly identify the most common error type?

A.Use Cloud Trace to analyze the traces of failing requests.
B.Open Cloud Error Reporting to see grouped error counts.
C.View the logs in Cloud Logging and manually count error messages.
D.Create a Cloud Monitoring alert on 5xx response codes.
AnswerB

Error Reporting aggregates and surfaces top errors.

Why this answer

Cloud Error Reporting automatically groups similar errors (e.g., same stack trace or error message) and shows a count for each group, making it the fastest way to identify the most common 5xx error type without manual log inspection. It is purpose-built for this exact use case, aggregating errors from Cloud Logging and presenting them in a dashboard sorted by frequency.

Exam trap

The PCD exam often tests the distinction between monitoring (Cloud Monitoring alerts) and error analysis (Cloud Error Reporting), tempting candidates to choose a monitoring alert when the question explicitly asks for identifying the most common error type, not just detecting that errors exist.

How to eliminate wrong answers

Option A is wrong because Cloud Trace is designed for latency analysis and distributed tracing, not for counting or grouping error types; it would require manual correlation to find the most common error. Option C is wrong because manually counting error messages in Cloud Logging is inefficient and error-prone, defeating the purpose of 'quickly' identifying the most common error type. Option D is wrong because a Cloud Monitoring alert on 5xx response codes only notifies you that errors are occurring, but does not group or identify the most common error type; it lacks the error aggregation and classification that Error Reporting provides.

62
MCQeasy

A company is deploying a new web application on Google Cloud and needs a managed relational database with PostgreSQL compatibility. The database must support automatic failover within 60 seconds in case of a zone outage. Which database deployment option should they choose?

A.Cloud SQL single zone with automatic storage increase
B.Cloud SQL regional HA configuration
C.Spanner multi-region configuration
D.AlloyDB with a read pool of 2 instances
AnswerB

Regional HA uses a standby in a different zone and provides automatic failover in <60s.

Why this answer

Cloud SQL with regional HA configuration provisions a primary and a standby instance in different zones within the same region, using synchronous replication to enable automatic failover in under 60 seconds. This meets the requirement for high availability within a single region.

63
MCQmedium

You are designing a Cloud Spanner schema with a parent table 'Customers' and a child table 'Orders'. To optimize read performance for retrieving a customer and their orders in a single split, you should use:

A.Interleaved tables with Customers as the parent
B.A secondary index on Orders.customer_id
C.A foreign key constraint from Orders to Customers
D.Use a single table with repeated fields
AnswerA

Interleaving stores child rows adjacent to the parent, improving read performance.

Why this answer

Interleaved tables store child rows with the parent row in the same split, enabling efficient joins and low-latency reads.

64
Multi-Selecthard

Which THREE methods are valid ways to deploy a containerized application to Google Kubernetes Engine (GKE)?

Select 3 answers
A.Use Helm to install a chart.
B.Use gcloud container clusters create to deploy the application.
C.Upload the container image to Cloud Storage and use a trigger to deploy.
D.Use kubectl apply with a Deployment manifest.
E.Use Config Connector to create a KubernetesDeployment resource.
AnswersA, D, E

Helm is a package manager for Kubernetes.

Why this answer

Helm is a package manager for Kubernetes that simplifies deploying containerized applications by using pre-configured charts. A Helm chart packages all the necessary Kubernetes resource definitions (e.g., Deployments, Services) into a single deployable unit, and running `helm install` on a GKE cluster will deploy the application correctly.

Exam trap

Google PCD often tests the distinction between cluster management commands (`gcloud container clusters`) and application deployment commands (`kubectl`, `helm`), and the trap here is that candidates mistakenly think `gcloud container clusters create` deploys an application because it creates a cluster, but it only provisions the cluster infrastructure.

65
MCQmedium

You need a caching layer for a web application that handles high read traffic. The cache must support pub/sub messaging for cache invalidation across multiple servers. Which service should you use?

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

Memorystore for Redis supports pub/sub for cache invalidation.

Why this answer

Memorystore for Redis is the correct choice because Redis natively supports pub/sub messaging, which enables cache invalidation notifications across multiple application servers. This allows each server to subscribe to channels and receive real-time invalidation messages, ensuring cache consistency in a distributed environment. Memcached, in contrast, lacks pub/sub capabilities, making it unsuitable for this requirement.

Exam trap

The trap here is that candidates often confuse Memcached with Redis, assuming both support pub/sub, but Memcached is purely a key-value cache with no messaging primitives, while Redis includes pub/sub as a built-in feature.

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, not a caching layer, and it does not support pub/sub messaging for cache invalidation. Option B is wrong because Memorystore for Memcached provides a distributed cache but lacks pub/sub messaging support, which is essential for cross-server cache invalidation. Option D is wrong because Firestore is a document-oriented NoSQL database for mobile and web apps, not a caching layer, and it does not offer pub/sub messaging for cache invalidation across servers.

66
Multi-Selecthard

A company is designing a multi-region Cloud Spanner deployment for a global user base. They want to ensure the lowest possible read latency for users in North America and Europe while maintaining strong consistency. Which THREE configuration choices should they make? (Choose 3)

Select 3 answers
A.Use interleaved tables to localize related data
B.Configure the application to use stale reads with 1-second bounded staleness
C.Choose a multi-region configuration that includes us-central1 and europe-west1 as primary regions
D.Use a single-region configuration and rely on Cloud CDN to cache read results
E.Add read-only replicas in both us-central1 and europe-west1
AnswersA, C, E

Interleaving improves locality and reduces cross-split reads, lowering latency.

Why this answer

A multi-region configuration with primary regions in North America and Europe provides leader placement for writes and read replicas for low-latency reads. Adding read-only replicas in each region reduces read latency. Placing read-write replicas in both regions ensures strong consistency locally.

67
MCQmedium

A company uses Cloud SQL for PostgreSQL and wants to run periodic analytical queries on the data without impacting the transactional workload. The data is updated frequently. Which integration approach is most suitable?

A.Use Cloud Composer to schedule ETL jobs that copy data to BigQuery every minute.
B.Migrate the database to Cloud Spanner and use strong reads for analytics.
C.Export the Cloud SQL data to Cloud Storage and then load into BigQuery for analysis.
D.Create a read replica of the Cloud SQL instance and point analytical queries to the replica.
AnswerD

Read replicas handle read traffic without impacting the main database's write performance.

Why this answer

Cloud SQL read replicas provide a read-only copy of the database that is continuously updated, allowing analytical queries to be run without affecting the primary instance's performance. This is ideal for frequently updated data. Option A is incorrect because using Cloud Composer to schedule frequent ETL jobs (every minute) is unnecessarily complex and may not keep up with updates.

Option B is incorrect because migrating to Cloud Spanner is a major change and not necessary for this use case; read replicas achieve the goal with less complexity. Option C is incorrect because exporting to Cloud Storage and loading into BigQuery is a batch process that introduces latency and is not suitable for frequently updated data.

68
MCQhard

Refer to the exhibit. A developer creates this cloudbuild.yaml for a Cloud Build pipeline. When they run the build, they get an error that the image push failed. What is the most likely cause?

A.The project ID 'my-project' does not exist.
B.The Artifact Registry repository 'my-repo' has not been created.
C.The Dockerfile is missing in the repository.
D.Cloud Run service 'my-service' already exists and needs to be deleted.
E.The gcloud command requires the '--platform managed' flag.
AnswerB

The push step requires the repository to exist; otherwise, the push fails.

Why this answer

The error occurs because the cloudbuild.yaml references an Artifact Registry repository 'my-repo' that does not exist in the project. Cloud Build attempts to push the Docker image to the specified repository, and if the repository has not been created, the push fails with a permission or not-found error. The repository must be created before the build runs, as Cloud Build does not automatically create repositories.

Exam trap

The PCD exam often tests the distinction between build-time errors (e.g., missing Dockerfile) and push-time errors (e.g., missing repository), and candidates may confuse a missing repository with a missing project or a deployment flag issue.

How to eliminate wrong answers

Option A is wrong because if the project ID 'my-project' did not exist, the build would fail earlier with a project-level authentication or resource-not-found error, not specifically an image push failure. Option C is wrong because a missing Dockerfile would cause a build failure during the image build step, not during the push step. Option D is wrong because the Cloud Run service already existing is not an error; Cloud Run deployments can update existing services, and the error is about image push, not deployment.

Option E is wrong because the '--platform managed' flag is required for Cloud Run deployments, not for image pushes to Artifact Registry; the push failure is unrelated to this flag.

69
MCQhard

A developer uses this Cloud Build configuration to deploy to Cloud Run. The build succeeds but the deployment fails with an error that the service account lacks permission. What is the most likely missing permission?

A.roles/iam.serviceAccountUser on the Compute Engine default service account.
B.roles/iam.serviceAccountUser on the Cloud Build service account.
C.roles/storage.objectViewer on the container registry.
D.roles/run.admin on the Cloud Run service.
AnswerB

The Cloud Build service account needs to impersonate the runtime service account (default Compute Engine service account) to deploy Cloud Run services.

Why this answer

The Cloud Build service account (typically the default compute engine service account or a user-specified service account) needs the `roles/iam.serviceAccountUser` role on the Cloud Run service account to impersonate it during deployment. Without this permission, Cloud Build cannot act as the Cloud Run service account to deploy the revision, even though the build itself succeeds. This is a common misconfiguration when deploying to Cloud Run from Cloud Build.

Exam trap

Google Cloud certification exams often test the distinction between permissions needed to *use* a service account (iam.serviceAccountUser) versus permissions to *administer* a resource (run.admin), leading candidates to incorrectly choose the broader admin role.

How to eliminate wrong answers

Option A is wrong because the Compute Engine default service account is not the identity used by Cloud Build to deploy; Cloud Build uses its own service account (or a user-specified one) to impersonate the Cloud Run service account. Option C is wrong because `roles/storage.objectViewer` on the container registry is needed for pulling container images, but the error is about deployment permissions, not image access. Option D is wrong because `roles/run.admin` grants full management of Cloud Run services, but the missing permission is specifically the ability for Cloud Build to impersonate the Cloud Run service account, which requires `roles/iam.serviceAccountUser` on that service account, not the `run.admin` role.

70
MCQeasy

A developer needs to implement caching for a Cloud SQL database to reduce read latency for frequently accessed data. Which Google Cloud service should they use?

A.Cloud Spanner
B.Memorystore for Redis
C.Cloud CDN
D.Cloud Bigtable
AnswerB

Memorystore for Redis is a fully managed in-memory cache that can be used to cache frequent reads from Cloud SQL.

71
Multi-Selecteasy

A company wants to deploy a containerized application to Cloud Run. Which two approaches are supported? (Choose two.)

Select 2 answers
A.Use gcloud beta run deploy with --source flag to build and deploy from source
B.Use Cloud Functions to package the container as a function
C.Upload a Dockerfile to Cloud Run console and let it build
D.Use Kubernetes Engine to deploy the container and then migrate to Cloud Run
E.Build the container locally and push to Artifact Registry, then deploy with gcloud
AnswersA, E

This allows building and deploying directly from source code.

Why this answer

The `gcloud beta run deploy --source` flag allows Cloud Run to automatically build a container image from your source code using Cloud Build, then deploy it. This is a fully managed workflow that eliminates the need to manually build and push a container. Option E is correct because you can build a container locally, push it to Artifact Registry, and then deploy it to Cloud Run using `gcloud run deploy` with the `--image` flag, which is the standard deployment path for pre-built images.

Exam trap

A common misconception tested on this exam is that Cloud Run can build directly from a Dockerfile uploaded via the console, but in reality, Cloud Run requires a pre-built image or uses Cloud Build triggered by the CLI or source repositories.

72
Multi-Selecteasy

A company is using Cloud Bigtable for a time-series workload. They want to monitor performance and identify hot spots. Which TWO Google Cloud tools or features should they use? (Choose 2.)

Select 2 answers
A.Key Visualiser
B.Cloud Trace
C.Cloud Monitoring metrics such as request latency
D.Cloud Profiler
E.Cloud Logging
AnswersA, C

Key Visualiser shows row key distribution, helping identify hot spots.

Why this answer

Key Visualizer is a Cloud Bigtable-specific tool that provides a heatmap of tablet server load, row key access patterns, and traffic distribution. It directly identifies hot spots by showing which row ranges are receiving disproportionate read/write activity, enabling targeted schema optimization.

Exam trap

The trap here is that candidates often confuse Cloud Trace (which tracks end-to-end request latency) with Cloud Monitoring metrics (which expose Bigtable-specific latency counters), or they overlook Key Visualizer as the only tool that provides row-key-level heatmaps for hot spot detection.

73
MCQhard

A company runs a Java microservice on Google Kubernetes Engine (GKE) using a standard cluster with 3 nodes. They use Cloud Build to build the Docker image and push it to Artifact Registry, then apply a Kubernetes Deployment manifest that references the new image tag. The Deployment has a rolling update strategy with maxSurge=1 and maxUnavailable=0. After a recent deployment, the new pods crash with 'CrashLoopBackOff'. The old pods are still running successfully. The application logs show a connection refused error when trying to connect to a Cloud SQL instance. The Cloud SQL instance is in the same project and region. The GKE cluster nodes have the appropriate scopes to access Cloud SQL. The application uses a Cloud SQL proxy sidecar container to establish the connection. The previous deployment worked fine. What is the most likely cause of the failure?

A.The GKE cluster nodes do not have the Cloud SQL Client role.
B.The Cloud SQL proxy sidecar container is not included in the new Deployment revision.
C.The Kubernetes Secret containing the service account key was not updated to include the new pod's service account.
D.The new image tag points to a broken build that has incorrect code for Cloud SQL connection.
AnswerB

Correct. Without the sidecar, the application cannot connect to Cloud SQL, resulting in connection refused.

Why this answer

The Cloud SQL proxy sidecar container is missing from the new Deployment revision. Since the application relies on the sidecar to establish a secure connection to Cloud SQL, its absence causes the connection refused error. The old pods continue to run because they still have the sidecar from the previous Deployment revision, while the new pods crash due to the missing proxy.

Exam trap

The PCD exam often tests the misconception that a connection refused error implies a code or permission issue, when in fact it is a missing sidecar container that causes the failure, especially in scenarios where the sidecar is defined in the Deployment manifest and accidentally removed during a revision update.

How to eliminate wrong answers

Option A is wrong because the GKE cluster nodes have the appropriate scopes to access Cloud SQL, and the Cloud SQL Client role is an IAM role assigned to the service account, not a scope on the nodes; the sidecar proxy handles authentication. Option C is wrong because the Kubernetes Secret containing the service account key is not relevant here—the Cloud SQL proxy sidecar typically uses Workload Identity or a service account key mounted as a volume, but the issue is the sidecar container itself being absent, not a missing or outdated secret. Option D is wrong because the new image tag points to a build that likely has correct code; the connection refused error is due to the missing sidecar proxy, not a code defect in the application.

74
Multi-Selecthard

A company runs a microservices architecture on GKE with gRPC services. They want to implement traffic splitting for canary deployments. Which THREE components should they use?

Select 3 answers
A.ClusterIP service
B.Istio or Anthos Service Mesh
C.Ingress resource
D.Google Cloud Load Balancer
E.Headless service
AnswersB, C, D

Provides advanced traffic management, including weight-based canary deployments.

Why this answer

Istio or Anthos Service Mesh provides fine-grained traffic splitting capabilities for canary deployments in a GKE environment. It uses Envoy sidecar proxies to route a percentage of traffic to different service versions based on HTTP headers or weight, enabling controlled rollouts without modifying application code.

Exam trap

The trap here is that candidates often confuse ClusterIP or Headless services with traffic splitting capabilities, but these are only for basic service discovery and do not provide the advanced routing needed for canary deployments.

75
Multi-Selecthard

A company is migrating from MySQL 5.7 to Cloud SQL for MySQL 8.0. They have a mix of MyISAM and InnoDB tables, and their application uses utf8 charset. They want to minimize changes to the application code. Which THREE changes should they make during migration? (Choose 3 options.)

Select 3 answers
A.Convert all MyISAM tables to InnoDB.
B.Keep utf8 charset to avoid application code changes.
C.Keep the default authentication plugin as caching_sha2_password.
D.Change the charset from utf8 to utf8mb4.
E.Change the default authentication plugin to mysql_native_password if the application uses an older client.
AnswersA, D, E

MyISAM is deprecated; InnoDB is required for transactional integrity and replication.

Why this answer

MySQL 8.0 changes default authentication to caching_sha2_password, which may break application connections if the client driver does not support it. MyISAM tables should be converted to InnoDB for reliability and features like foreign keys. utf8 charset should be changed to utf8mb4 to avoid truncation of 4-byte characters. The caching_sha2_password plugin is default; if the app uses older connectors, they may need to set the default to mysql_native_password or update the connector.

Page 1 of 13

Page 2