Courseiva

Google Professional Cloud Developer (PCD) — Questions 151225

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

Page 2

Page 3 of 13

Page 4
151
MCQmedium

A company's Firestore security rules are too permissive, allowing all users to read and write any document. They need to restrict access so that only authenticated users can read and write their own data. Which rule structure should they use?

A.Allow read/write if request.auth.uid == resource.data.user_id;
B.Allow read/write if request.auth != null;
C.Allow read/write if request.auth != null && request.auth.uid == resource.id;
D.Allow read/write if request.auth.token.email == resource.data.email;
AnswerA

This restricts access to documents where the user ID field matches the authenticated user.

Why this answer

Firestore security rules can use `request.auth.uid` to verify the authenticated user's identity and `resource.data.user_id` to check ownership. The correct rule ensures that the authenticated user's UID matches the `user_id` field in the document.

152
MCQmedium

Your team manages a service that receives thousands of requests per second. They have set up Cloud Monitoring alerting based on the 99th percentile latency. Recently, they received an alert warning that latency exceeded 1 second, but after investigating, they found it was a false alarm caused by a single very slow request. How can they improve their alert to reduce false positives?

A.Set the alert to fire only if the condition persists for a longer duration.
B.Use a log-based metric instead of latency.
C.Increase the alerting threshold to 2 seconds.
D.Use a different latency metric like median or 95th percentile.
AnswerD

Lower percentiles are less sensitive to outliers, reducing false alarms while still capturing most user experience.

Why this answer

Using a different latency metric like the 95th percentile reduces sensitivity to outliers. The 99th percentile captures the slowest 1% of requests, so a single very slow request can trigger an alert. The 95th percentile ignores the top 5% of outliers, making it more robust against isolated slow requests while still monitoring tail latency effectively.

Exam trap

Google Cloud exams often test the misconception that increasing thresholds or durations is the best way to reduce false positives, when the real solution is to adjust the statistical metric to be less sensitive to outliers.

How to eliminate wrong answers

Option A is wrong because increasing the duration the condition must persist does not address the root cause; a single slow request can still sustain the latency for a longer period if it is long enough, and this approach delays detection of real issues. Option B is wrong because log-based metrics measure log events, not request latency, so they cannot directly replace a latency-based alert and would not solve the outlier problem. Option C is wrong because raising the threshold to 2 seconds merely shifts the problem; a single very slow request exceeding 2 seconds would still trigger a false alarm, and it risks missing real performance degradation that stays under the new threshold.

153
Multi-Selectmedium

A company is deploying Cloud Bigtable for a high-throughput write-heavy workload. They need high availability and read scalability across two GCP regions. Which TWO actions should they take? (Choose 2.)

Select 2 answers
A.Add a secondary cluster in a different region.
B.Create the instance with HDD storage to reduce costs.
C.Use a development instance type.
D.Enable autoscaling for the primary cluster only.
E.Configure replication between the clusters.
AnswersA, E

Replication across regions provides HA and enables read from each cluster.

Why this answer

Adding a secondary cluster in a different region provides high availability and read scalability for Cloud Bigtable. With a multi-cluster instance, if the primary cluster fails, the secondary cluster can serve traffic, and read requests can be routed to the closest cluster for lower latency and load distribution.

Exam trap

The trap here is that candidates may think autoscaling or instance type choices address high availability, but only cross-region replication with a secondary cluster provides the required geographic redundancy and read scalability.

154
MCQeasy

You are setting up Cloud Build to automatically deploy a container to Cloud Run when code is pushed to the main branch of a GitHub repository. What is the minimal configuration required?

A.Create a Cloud Build trigger connected to GitHub, and include a cloudbuild.yaml with steps to build and deploy.
B.Set up GitHub Actions to push images to Container Registry and then use Cloud Run.
C.Create a Cloud Build trigger without a build config file, using the inline builder.
D.Use Artifact Registry to store images and then manually trigger deployment.
AnswerA

Correct because Cloud Build triggers can be configured to automatically execute a build pipeline when code is pushed to a GitHub repository, and a cloudbuild.yaml file defines the steps to build and deploy.

Why this answer

Cloud Build triggers can be configured to automatically execute a build pipeline when code is pushed to a GitHub repository. The minimal configuration requires a trigger connected to GitHub and a cloudbuild.yaml file that defines the steps to build the container image and deploy it to Cloud Run using the `gcloud run deploy` command or the `cloudrun` builder. This setup provides a fully automated CI/CD pipeline without additional services.

Exam trap

The trap here is that candidates may think an inline builder (Option C) is simpler than a cloudbuild.yaml file, but the exam expects the standard, minimal, and documented approach of using a build config file for clarity and maintainability.

How to eliminate wrong answers

Option B is wrong because it introduces GitHub Actions as an intermediary, which is not minimal; Cloud Build can directly integrate with GitHub to trigger builds without requiring GitHub Actions. Option C is wrong because while an inline builder can be used, the question asks for the minimal configuration to automatically deploy to Cloud Run, and a cloudbuild.yaml file is the standard and most straightforward way to define build and deploy steps; omitting it would require more complex inline configuration. Option D is wrong because manually triggering deployment defeats the purpose of automation when code is pushed to the main branch; the requirement is for automatic deployment, not manual intervention.

155
MCQmedium

A company is migrating from on-premises SQL Server to Cloud SQL SQL Server using Database Migration Service (DMS). During the continuous migration phase, they notice that the replication lag is increasing. What is the most likely cause?

A.The DMS migration job is not using a source read replica.
B.The target Cloud SQL instance is not using Premium tier.
C.Large transactions on the source database are causing CDC to fall behind.
D.The source database has a low transaction log retention period.
AnswerC

Large transactions generate many log records that can overwhelm CDC replication, increasing lag.

Why this answer

Database Migration Service (DMS) uses Change Data Capture (CDC) to replicate ongoing changes from the source SQL Server to the target Cloud SQL instance. Large transactions on the source database generate a high volume of log records that the CDC reader must process sequentially. If the transaction volume exceeds the throughput capacity of the DMS replication slot, the lag between the source and target increases, causing the replication lag to grow.

Exam trap

A common mistake is to assume that replication lag is caused by target-side performance issues, such as Cloud SQL tier or lack of read replicas. In reality, the bottleneck is typically on the source side: DMS uses CDC, which must process large transactions sequentially. If the transaction volume exceeds the capture rate, lag increases.

How to eliminate wrong answers

Option A is wrong because DMS does not require a source read replica for CDC-based continuous migration; it reads directly from the source transaction log. Option B is wrong because the Cloud SQL tier (Premium vs. Standard) affects instance availability and performance features, but replication lag during DMS migration is primarily limited by the CDC processing rate, not the target tier.

Option D is wrong because a low transaction log retention period would cause log truncation before DMS can read it, leading to data loss or migration failure, not an increasing replication lag.

156
MCQhard

A company is using Bigtable for real-time analytics and notices that certain row keys are causing hot spots. Which tool should they use to identify the hot spot patterns?

A.Profiler
B.Key Visualizer
C.Cloud Monitoring workspace
D.Cloud Trace
AnswerB

Key Visualizer provides a heatmap of access patterns to detect hot spots.

Why this answer

Bigtable Key Visualizer is designed to analyze access patterns and identify hot spots by visualizing row key distribution and traffic. It helps optimize row key design. The other options are general monitoring or optimization tools not specific to Bigtable key analysis.

157
Multi-Selecteasy

A company stores sensitive user data in Cloud Storage. They want to ensure that only authenticated users with the appropriate permissions can access the data, and that data is encrypted at rest. Which two steps should they take? (Choose TWO.)

Select 2 answers
A.Configure a Customer-Managed Encryption Key (CMEK) in Cloud KMS.
B.Enable default encryption on the bucket using Google-managed keys.
C.Use IAM roles to grant access to specific users and groups.
D.Set bucket-level public access prevention.
E.Enable VPC Service Controls to restrict data access.
AnswersB, C

Default server-side encryption is already enabled.

Why this answer

Cloud Storage buckets are encrypted at rest by default using Google-managed keys, which satisfies the requirement for data encryption without additional configuration. Option C is correct because IAM roles provide fine-grained access control, ensuring only authenticated users with appropriate permissions can access the data.

Exam trap

The PCD exam often tests the misconception that enabling default encryption or using CMEK is optional or that public access prevention alone satisfies access control, when in fact IAM is the primary mechanism for user-level authorization and default encryption is already enabled.

158
MCQmedium

A company uses Cloud Bigtable for time-series data. They want to enable disaster recovery with the ability to fail over to another region in minutes. What feature should they enable?

A.Export tables to Cloud Storage and import into another Bigtable instance.
B.Enable Bigtable replication across regions.
C.Configure Bigtable backups and restore in another region.
D.Use BigQuery federated queries to access Bigtable data from another region.
AnswerB

Replication provides near real-time data availability in another region for rapid failover.

Why this answer

Bigtable replication allows you to have multiple clusters in different regions, with automatic replication of data. You can fail over by redirecting traffic to the other cluster. This meets the RTO of minutes.

159
MCQhard

An engineer needs to deploy Cloud Spanner with the ability to scale compute capacity automatically between 1000 and 6000 processing units based on load, with a target high-priority CPU utilization of 65%. Which configuration achieves this?

A.Create the instance with 6 nodes (6000 processing units) and set autoscaling with min=1, max=6, target high-priority CPU=0.65.
B.Create the instance with 1 node (1000 processing units) and enable autoscaling with min=1000, max=6000, target high-priority CPU=0.65.
C.Create the instance with 1000 processing units and enable autoscaling with min=1, max=6, target CPU=0.65.
D.Create the instance with 3 processing units and enable autoscaling with min=1000, max=6000, target CPU=0.65.
AnswerB

This is the correct way: processing units autoscaling with min/max and target high-priority CPU utilization.

Why this answer

Cloud Spanner auto-scaling uses processing units with min/max bounds and a high-priority CPU target. Nodes are fixed at 1000 processing units each, so auto-scaling with processing units is required to specify a range and target. The feature was introduced to allow finer-grained scaling than nodes.

160
MCQmedium

A company needs to back up their Cloud Bigtable instance for disaster recovery across regions. They want to restore to a different cluster in a different region. What should they use?

A.Use Bigtable managed backups and restore to a different cluster
B.Export tables to Avro in GCS and import in another region
C.Use gcloud bigtable instances create with replication
D.Use Cloud Scheduler to copy tables via Dataflow
AnswerA

Managed backups support cross-cluster and cross-region restore.

Why this answer

Bigtable managed backups are cluster-level backups that can be restored to a different cluster, including cross-region, provided the restore is to an instance in the same project.

161
Multi-Selectmedium

A retail company is migrating its on-premises PostgreSQL OLTP database to Google Cloud. They require high availability with automatic failover and zero RPO. The application is latency-sensitive and must remain in a single region. Which TWO configurations should they choose? (Choose TWO.)

Select 2 answers
A.Deploy Cloud SQL for PostgreSQL with cross-region replication
B.Deploy Cloud Spanner multi-region configuration
C.Deploy Cloud SQL for PostgreSQL with HA configuration
D.Deploy AlloyDB for PostgreSQL with high availability
E.Use Memorystore for Redis as a primary database
AnswersC, D

Cloud SQL HA provides synchronous replication within the same region, automatic failover, and zero RPO.

Why this answer

Cloud SQL HA uses synchronous replication to a standby in a different zone within the same region, providing automatic failover and zero RPO. AlloyDB is PostgreSQL-compatible and offers HA with synchronous replication. Cloud SQL cross-region replication is asynchronous, not meeting zero RPO.

Spanner multi-region is overkill and introduces cross-region latency. Memorystore is not a relational database.

162
MCQhard

A company runs a stateful application on Compute Engine instances with local SSDs. They need to perform maintenance that requires stopping the instances. What is the best approach to ensure data durability and minimal downtime?

A.Create a snapshot of the local SSD before stopping the instance
B.Use instance groups with autohealing to automatically recreate instances
C.Enable live migration on the instance
D.Migrate data to persistent disks and configure the application to use persistent disks
AnswerD

Persistent disks are durable and can be detached and reattached to other instances, ensuring data persistence during maintenance.

Why this answer

Local SSDs provide ephemeral storage that is tied to the lifecycle of the Compute Engine instance. When an instance is stopped or terminated, data on local SSDs is permanently lost. To ensure data durability during maintenance that requires stopping the instance, the application must use persistent disks, which are durable network-attached storage that persists independently of the instance.

Option D is correct because migrating the application to persistent disks ensures data survives the stop and allows the instance to be restarted with the same data, minimizing downtime.

Exam trap

The trap here is that candidates assume local SSDs can be snapshotted or that live migration works with local SSDs, but Google Cloud explicitly disables both features for local SSDs, making persistent disks the only durable option for stateful workloads requiring maintenance.

How to eliminate wrong answers

Option A is wrong because snapshots cannot be created directly from local SSDs; local SSDs are ephemeral and do not support snapshot creation. Option B is wrong because instance groups with autohealing recreate instances based on health checks, but they do not preserve data on local SSDs, which are lost when instances are terminated or recreated. Option C is wrong because live migration is enabled by default for instances with persistent disks, but it is not supported for instances with local SSDs; local SSDs prevent live migration, so the instance must be stopped for maintenance.

163
MCQmedium

Your team needs to query data across Cloud SQL (MySQL), Cloud Storage (CSV files), and Bigtable using a single SQL query without moving any data. Which Google Cloud feature enables this?

A.BigQuery Omni
B.Cloud Spanner federated queries
C.Datastream
D.BigQuery federated queries
AnswerD

Federated queries in BigQuery allow querying external data sources without loading.

Why this answer

BigQuery federated queries allow querying data in Cloud SQL, Cloud Storage, Bigtable, and other sources externally via the EXTERNAL_QUERY or table definitions.

164
MCQhard

An engineer is configuring Cloud SQL for PostgreSQL with HA. They notice that after a failover, the original primary instance does not automatically resume as a standby. What is the likely cause?

A.The standby instance was not configured in a different zone
B.The HA instance is using local SSD which is not durable
C.The original primary instance is deleted after failover
D.The original primary instance's disk is now in read-only mode
AnswerD

After failover, the original primary's disk is remounted as read-only to avoid split-brain. The instance must be recreated as a standby.

Why this answer

In Cloud SQL HA, after a failover, the original primary becomes a new standby using the same underlying disk. It does not create a new instance automatically. The disk is preserved, and the standby is recreated.

165
MCQmedium

A company needs to monitor the disk usage of their Cloud SQL instance to proactively increase storage before it runs out. They want to set an alert when disk usage exceeds 80%. Which metric should they use in Cloud Monitoring?

A.database/cpu/utilisation
B.database/disk/quota
C.database/disk/bytes_used
D.database/memory/utilisation
AnswerC

This metric tracks disk bytes used, from which you can calculate utilization.

Why this answer

Cloud SQL provides the `database/disk/bytes_used` metric, which represents the actual storage used. By setting an alert on this metric (e.g., as a percentage of total disk size), they can be notified when usage is high.

166
MCQeasy

A developer needs to query data from Cloud Spanner and Bigtable together in a single SQL statement without moving data. Which Google Cloud feature allows this?

A.Spanner change streams
B.BigQuery Omni
C.Cloud SQL external tables
D.Federated queries
AnswerD

BigQuery federated queries can query Cloud Spanner, Bigtable, and Cloud SQL directly.

Why this answer

BigQuery federated queries allow querying external data sources like Cloud Spanner and Bigtable directly from BigQuery using SQL, without importing data.

167
MCQmedium

A global e-commerce company uses Cloud Spanner for transactional data. They need to stream real-time order changes to a BigQuery table for analytics. Which approach meets the requirement with minimal latency and operational overhead?

A.Create a Cloud Function that queries Spanner every minute and writes new records to BigQuery.
B.Use Cloud Scheduler to run a daily export of Spanner table to Cloud Storage, then load into BigQuery.
C.Use Spanner change streams to capture changes, publish to Pub/Sub, and use Dataflow to write to BigQuery.
D.Configure a Datastream stream from Spanner to BigQuery.
AnswerC

Spanner change streams + Pub/Sub + Dataflow is the correct architecture for real-time streaming of Spanner changes to BigQuery.

Why this answer

Cloud Spanner change streams capture incremental changes (inserts, updates, deletes) and can be read via Pub/Sub. A Dataflow pipeline can then write these changes to BigQuery in near real-time. This is the recommended pattern for streaming Spanner changes to BigQuery.

168
MCQmedium

A team wants to monitor CPU utilization on their Compute Engine instances. They need an alert that sends a notification when the average CPU utilization across all instances in a project exceeds 80% for more than 5 minutes. Which alerting configuration should they use?

A.Use Cloud Scheduler to periodically check CPU and trigger notification
B.Create a log-based alert using metrics from Cloud Logging
C.Use an uptime check to monitor CPU utilization
D.Create an alert policy with a metric threshold condition for compute.googleapis.com/instance/cpu/utilization, aggregated across all instances with alignment period 1 min and duration 5 min
AnswerD

This correctly sets up a threshold alert on CPU utilization.

Why this answer

Cloud Monitoring alert policies allow you to define a metric threshold condition using the `compute.googleapis.com/instance/cpu/utilization` metric, aggregate it across all instances in the project, and set an alignment period of 1 minute with a duration of 5 minutes. This configuration ensures the alert fires only when the average CPU utilization exceeds 80% for a sustained period of 5 minutes, meeting the exact requirement.

Exam trap

The trap here is that candidates confuse log-based alerts (which work on log entries) with metric-based alerts (which work on numeric time-series data), leading them to incorrectly choose Option B.

How to eliminate wrong answers

Option A is wrong because Cloud Scheduler is a cron job service for triggering actions on a schedule, not a monitoring or alerting tool; it cannot natively evaluate metric thresholds or aggregate CPU utilization across instances. Option B is wrong because log-based alerts are designed for log entries, not for numeric metric thresholds like CPU utilization; they cannot directly monitor `compute.googleapis.com/instance/cpu/utilization` as a metric. Option C is wrong because uptime checks monitor HTTP/HTTPS/TCP endpoint availability and response, not CPU utilization metrics; they are used for service health, not infrastructure resource usage.

169
MCQhard

You are designing a Cloud Spanner database for a global user application that must enforce strong consistency across regions. The primary key of the main table is a UUID. You notice that write latency is high and suspect hotspotting. Which design change is MOST likely to reduce hotspotting?

A.Use a monotonically increasing integer as the primary key
B.Use a composite primary key with a leading hash prefix of the UUID
C.Switch to regional Spanner instance instead of multi-region
D.Use a secondary index on the UUID column and keep the primary key as a UUID
AnswerB

A hash prefix (e.g., first 4 bytes of SHA256) distributes writes evenly across splits, reducing hotspotting.

Why this answer

Using a composite primary key with a leading hash prefix distributes writes evenly across all Cloud Spanner splits, preventing hotspotting. A UUID primary key alone can still cause hotspots if the UUID generation is not perfectly random or if the application uses sequential UUIDs; a hash prefix ensures uniform distribution regardless of the UUID's characteristics.

Exam trap

The trap here is that candidates assume UUIDs are always perfectly random and thus immune to hotspotting, but Cloud Spanner's split-by-key-range design means that any sequential or clustered key pattern—including certain UUID implementations—can cause hotspots, and a hash prefix is the standard solution.

How to eliminate wrong answers

Option A is wrong because a monotonically increasing integer primary key creates a hotspot on the last split, as all new writes go to the same tablet, causing high write latency. Option C is wrong because switching to a regional instance reduces availability and may increase latency for global users, and does not address the underlying hotspotting caused by the primary key design. Option D is wrong because a secondary index on the UUID column does not change the primary key's distribution; writes still target the same splits based on the primary key, so hotspotting persists.

170
MCQmedium

A company uses Cloud Deploy for continuous delivery with multiple targets (dev, staging, prod). After a successful promotion to staging, the team discovers a critical bug and needs to roll back the production target to the previous release. The production target has already been promoted to the current release, but the staging target should remain on the current release. How should the team roll back the production target?

A.Create a new release with the same image tag as the previous release and promote it to production.
B.Use the 'gcloud deploy rollback' command targeting the production target.
C.Redeploy the previous release by running the previous Cloud Deploy command.
D.Manually delete the current release and then promote the previous release again.
AnswerB

Rollback creates a new release with the previous rollout's configuration and deploys it to the target.

Why this answer

The 'gcloud deploy rollback' command is specifically designed to roll back a Cloud Deploy target to its previous successful release without affecting other targets. This command reverts the production target to the prior release while leaving the staging target on the current release, as required. It operates by redeploying the last known good release to the specified target, ensuring minimal disruption and preserving the promotion history.

Exam trap

The PCD exam often tests the misconception that rolling back a target requires creating a new release or manually manipulating releases, when in fact Cloud Deploy provides a dedicated rollback command that handles the process cleanly without affecting other targets or the release history.

How to eliminate wrong answers

Option A is wrong because creating a new release with the same image tag as the previous release would create a duplicate release in the pipeline, not a true rollback; it would also require a new promotion, which could trigger unintended side effects like re-running tests or approvals. Option C is wrong because rerunning the previous Cloud Deploy command would attempt to create a new release or promotion from scratch, not revert the production target to a prior state, and it could overwrite the current release history. Option D is wrong because manually deleting the current release is not supported in Cloud Deploy—releases are immutable once created—and promoting the previous release again would require it to still exist in the pipeline, which it does, but the manual deletion step is invalid and could break the deployment pipeline.

171
Multi-Selecthard

An engineer needs to secure a Cloud SQL for MySQL instance that contains sensitive data. They want to ensure that only specific Compute Engine VMs in the same VPC can connect, and that all connections are encrypted. Which THREE steps should they take? (Choose three.)

Select 3 answers
A.Enable IAM database authentication.
B.Configure the instance to use a private IP address.
C.Assign a public IP address to the instance.
D.Add the VMs' IP addresses to the authorized networks.
E.Enable the 'require_ssl' flag.
AnswersA, B, E

IAM authentication provides fine-grained access control using IAM policies.

Why this answer

Private IP restricts access to the VPC. SSL enforcement ensures encryption. IAM database authentication adds an extra layer of security by allowing IAM-based login.

Public IP would expose the instance. Authorized networks are for public IP access, which is not desired. Cloud SQL Auth Proxy can be used but not necessary if using private IP with SSL; the proxy adds another layer but is not required for this basic encryption and access control.

172
MCQmedium

Your Bigtable instance is experiencing high latency on read queries that scan a large range of rows. The row keys are timestamps in descending order (e.g., '2024-01-01#user123'). What is the most likely cause?

A.Row keys are too short
B.Row keys cause hotspotting because of descending timestamps
C.There are too many column families
D.Column family design is incorrect
AnswerB

Correct: descending timestamps concentrate writes on a single tablet server, causing hotspots.

Why this answer

Descending timestamps as row keys cause hotspotting because new writes (which are always the most recent timestamp) are concentrated on a single tablet server node, creating a 'hot node' that also serves read queries for that range. Bigtable splits and load-balances by row key prefix, so sequential descending keys like '2024-01-01#...', '2024-01-02#...' are written to the same tablet, leading to uneven load and high read latency for scans over large ranges.

Exam trap

Google Cloud often tests the misconception that descending timestamps are a good way to keep recent data at the top of scans, but the trap is that this creates a hotspot on the last tablet, causing both write and read bottlenecks.

How to eliminate wrong answers

Option A is wrong because row key length does not directly cause hotspotting or high read latency; short keys are fine as long as they distribute writes evenly. Option C is wrong because the number of column families affects storage and schema design but does not cause hotspotting from write patterns or scan latency on large row ranges. Option D is wrong because column family design impacts data organization and compression, not the distribution of row keys across tablets; incorrect column family design would not create a hot node from timestamp-based keys.

173
Multi-Selectmedium

Which TWO security best practices should be implemented when using Cloud Build to deploy applications? (Choose 2.)

Select 2 answers
A.Add SSH keys to Cloud Build for private Git repos.
B.Use Cloud KMS to encrypt sensitive environment variables.
C.Use container image tags instead of digests in build configs.
D.Store secrets in Cloud Build's default substitution variables.
E.Restrict Cloud Build trigger creation to specific IAM roles.
AnswersB, E

Encrypted variables are decrypted at build time.

Why this answer

Cloud Build does not automatically encrypt environment variables stored in build config files or the console. Using Cloud KMS allows you to encrypt sensitive data like API keys or passwords, then decrypt them at build time via the `gcloud kms decrypt` step, ensuring secrets are never stored in plaintext.

Exam trap

A common pitfall for this question is believing that SSH keys (option A) or container image tags (option C) are security best practices for Cloud Build. SSH keys should be avoided in favor of Cloud Source Repositories or other secure Git integrations. Tags are mutable, making them insecure; digests provide immutability.

Additionally, storing secrets in default substitution variables (option D) is insecure because they are not encrypted. The correct best practices are using Cloud KMS for encrypting sensitive environment variables (B) and restricting trigger creation to specific IAM roles (E).

174
MCQeasy

A development team wants to test their application locally with Cloud Bigtable without incurring costs. Which instance type should they create?

A.Production instance with a single node
B.Production instance with a multi-cluster configuration
C.Development instance
D.Production instance with HDD storage
AnswerC

Development instances are cost-effective for testing, providing limited performance but full API compatibility.

Why this answer

Cloud Bigtable offers a 'Development' instance type for testing and development. It uses a single node (or limited cluster) and costs significantly less than a production instance. Production instances are for live workloads.

An HDD cluster is for production with slower storage. A multi-cluster is for replication.

175
MCQhard

A financial services company has a critical application that must survive a regional outage. They deployed on Compute Engine across multiple zones within a single region and now want to redirect traffic to a secondary region if the primary region becomes unavailable. Which load balancing solution should they use?

A.SSL Proxy Load Balancer
B.External HTTP(S) Load Balancer
C.Proxy Network Load Balancer
D.Internal TCP/UDP Load Balancer
E.Network Load Balancer
AnswerB

Global load balancer that can distribute traffic to backends in multiple regions and perform health-check-based failover.

Why this answer

The External HTTP(S) Load Balancer is the correct choice because it supports global load balancing across multiple regions, enabling traffic failover to a secondary region when the primary region becomes unavailable. It uses anycast IP addresses and is designed for HTTP/S traffic, making it suitable for a critical application that must survive a regional outage.

Exam trap

The trap here is that candidates often confuse regional load balancers (like Network Load Balancer or SSL Proxy) with global ones, assuming any load balancer can handle cross-region failover, but only the External HTTP(S) Load Balancer (and the External TCP/UDP Network Load Balancer with global access) supports multi-region failover for HTTP/S traffic.

How to eliminate wrong answers

Option A is wrong because SSL Proxy Load Balancer is a regional load balancer that terminates SSL connections and forwards TCP traffic, but it does not support cross-region failover or global load balancing. Option C is wrong because Proxy Network Load Balancer is a regional load balancer for TCP/UDP traffic and cannot redirect traffic to a secondary region. Option D is wrong because Internal TCP/UDP Load Balancer is a regional internal load balancer used for private traffic within a VPC and cannot handle cross-region failover.

Option E is wrong because Network Load Balancer is a regional passthrough load balancer for TCP/UDP traffic and does not support global load balancing or regional failover.

176
MCQmedium

The developer runs the command above and sees both instances are unhealthy. The instances are running and serving traffic on port 80 when accessed directly. What is the most likely cause?

A.Firewall rules block the health check probe IP ranges
B.The instances have been deleted
C.The instances are not running the specified health check port
D.The load balancer is misconfigured
E.The instances are out of memory and unable to respond
AnswerA

Health check probes originate from Google's health checker IP ranges; they must be allowed in firewall rules.

Why this answer

The most likely cause is that firewall rules are blocking the health check probe IP ranges. Google Cloud Platform (GCP) load balancers use specific, documented IP ranges for health check probes. If a firewall rule denies traffic from these ranges, the load balancer will mark the instances as unhealthy even though the instances are running and serving traffic on port 80 when accessed directly.

This is a common misconfiguration because the health check probes originate from these special IP ranges, not from the load balancer's frontend IP.

Exam trap

The PCD exam often tests the misconception that health checks originate from the load balancer's frontend IP or that the instance's direct accessibility implies it will pass health checks, ignoring that health check probes come from specific, separate IP ranges that must be explicitly allowed in firewall rules.

How to eliminate wrong answers

Option B is wrong because the instances are explicitly described as 'running and serving traffic on port 80 when accessed directly,' so they have not been deleted. Option C is wrong because the instances are serving traffic on port 80, which matches the specified health check port (port 80), so the port is correct. Option D is wrong because the load balancer is correctly configured to send health checks to port 80, and the instances respond on that port; the issue is that the health check probes are being blocked, not that the load balancer configuration is incorrect.

Option E is wrong because the instances are serving traffic on port 80 when accessed directly, indicating they are not out of memory and are capable of responding; memory exhaustion would prevent all responses, not just health check responses.

177
Multi-Selecthard

Which THREE are valid ways to create custom metrics in Cloud Monitoring? (Select exactly 3.)

Select 3 answers
A.Use the Cloud Billing pricing calculator to estimate metric costs.
B.Use the Cloud Monitoring API to write time series directly.
C.Install the Cloud Monitoring agent and configure custom metrics in its configuration file.
D.Define a log-based metric in Cloud Logging based on log content.
E.Deploy Ops Agent with default configuration.
AnswersB, C, D

Allows programmatic metric creation.

Why this answer

The Cloud Monitoring API allows you to write time series data directly via the `projects.timeSeries.create` method, which is a primary mechanism for ingesting custom metrics. This enables you to programmatically send metric data from any source, bypassing the need for an agent.

Exam trap

The PCD exam often tests the distinction between agent-based collection of predefined metrics (Ops Agent default) and the explicit creation of custom metrics via API or log-based definitions, leading candidates to mistakenly select the Ops Agent default as a valid method for custom metrics.

178
Multi-Selectmedium

A team uses GitHub for source control. They want to automatically trigger Cloud Build builds on pull request creation. Which two actions are required? (Choose two.)

Select 2 answers
A.Install the Cloud Build GitHub app in the repository
B.Create a Cloud Build trigger that listens to 'pull_request' event
C.Configure a webhook in GitHub to send push events to Cloud Build
D.Use Cloud Source Repositories as a mirror of GitHub
E.In the Cloud Build trigger, set the event to 'push' and branch filter to 'pull-request/*'
AnswersA, B

The app is required to allow Cloud Build to receive webhook events from GitHub.

Why this answer

Installing the Cloud Build GitHub app and creating a trigger with the 'pull_request' event are the two necessary steps. Other options are either not needed or incorrect.

179
MCQmedium

A company is migrating an on-premises PostgreSQL database to Cloud SQL for PostgreSQL using Database Migration Service (DMS). They need to minimize downtime and keep the on-premises database available for reads during migration. The migration plan includes a full dump followed by continuous change data capture (CDC). Which method should they use to validate the migrated data before cutting over?

A.Run the migration job a second time in parallel and compare the data manually.
B.Stop the Database Migration Service job and promote the source Cloud SQL instance.
C.Promote the Cloud SQL replica to a standalone instance for testing; if the data is correct, stop the on-premises database and update the application connection string.
D.Modify the promoted replica's database flags to match the source and then run a consistency check.
AnswerC

Promoting the replica allows you to test the migrated data without affecting the source. You can continue CDC replication until cutover.

Why this answer

Promoting the Cloud SQL read replica to a standalone instance allows you to validate the migrated data in isolation without affecting the ongoing CDC replication. This method minimizes downtime by keeping the on-premises database available for reads and only cutting over after verification, which aligns with the requirement for a low-downtime migration using Database Migration Service.

Exam trap

Google Cloud exams often test the misconception that you must stop the DMS job or modify database flags before validation, when in fact promoting the Cloud SQL read replica is the standard low-downtime validation step that preserves CDC continuity until cutover.

How to eliminate wrong answers

Option A is wrong because running a second migration job in parallel would double the load on the source database and CDC stream, risking performance degradation and data inconsistency, and manual comparison is error-prone and not a validated method for DMS. Option B is wrong because stopping the DMS job and promoting the source Cloud SQL instance would interrupt CDC and potentially lose unapplied changes, and the source Cloud SQL instance is not the target; the promoted replica is the target for validation. Option D is wrong because modifying database flags on the promoted replica is unnecessary for validation and could introduce configuration drift; consistency checks are typically run after promotion using tools like pg_dump or pg_checksums, not by altering flags.

180
MCQeasy

A startup is deploying a Node.js application on App Engine Standard Environment. They have configured the application in app.yaml with runtime: nodejs16. After deploying with gcloud app deploy, the deployment succeeds, but when they access the application, they get a 502 Bad Gateway error. They check the logs and see "Failed to start container" and "Error: Cannot find module 'express'". The application uses Express. The team has confirmed that the package.json file includes express as a dependency. What is the most likely cause?

A.The application is running on a different port than the one specified in the environment variable PORT.
B.The node_modules folder was not uploaded because it is in the .gcloudignore file.
C.The package.json file is missing the express dependency.
D.The request exceeds the 60-second timeout.
AnswerB

If node_modules is ignored, App Engine will install dependencies during deployment, but if there is a lockfile issue or missing package.json fields, it may fail. However, the error indicates express is not installed, so the build process may not have run correctly, possibly due to .gcloudignore preventing upload of a needed file.

Why this answer

The error 'Cannot find module express' indicates that the Express module is not available to the application. In App Engine Standard Environment, dependencies are automatically installed based on package.json during deployment. However, if the node_modules folder is present in the project directory and is excluded via .gcloudignore, the automatic installation may be skipped or overridden, leading to missing modules.

The most likely cause is that node_modules is listed in .gcloudignore, so it wasn't uploaded and the automatic install didn't run correctly. Option B correctly identifies this issue.

181
Multi-Selectmedium

Which TWO best practices should be followed when deploying a containerized application to Cloud Run for production?

Select 2 answers
A.Use a minimal base image with only necessary dependencies.
B.Set min-instances to 0 to save costs when idle.
C.Set max-instances to unlimited to handle traffic spikes.
D.Configure CPU to be always allocated to reduce latency.
E.Always use the latest public image from Docker Hub for dependencies.
AnswersA, D

Minimal images reduce attack surface and improve start time.

Why this answer

Using a minimal base image (e.g., distroless or Alpine-based) reduces the attack surface, decreases image size, and speeds up cold starts. Cloud Run pulls the container image for each new instance, so a smaller image directly reduces startup latency and improves scaling responsiveness. This aligns with Google's best practices for production deployments on Cloud Run.

Exam trap

A common misconception is that setting min-instances to 0 is always cost-effective, but in production, the trade-off between cost and latency often leads to setting min-instances to at least 1 to avoid cold starts.

182
MCQeasy

A developer wants to store application logs from Compute Engine instances in a centralized logging system. Which service should they use?

A.Cloud Monitoring
B.Cloud Trace
C.Cloud Debugger
D.Cloud Logging
AnswerD

Cloud Logging is designed to store, search, and analyze log data.

Why this answer

Cloud Logging. Cloud Logging is the centralized logging service in Google Cloud that collects and stores logs from various sources, including Compute Engine instances. Cloud Monitoring (A) is for monitoring metrics and alerting, not logs.

Cloud Trace (B) is a distributed tracing tool for latency analysis. Cloud Debugger (C) inspects application state at runtime, not for log storage.

183
MCQhard

You are tuning a Cloud Bigtable table used for analytics. One column family, 'data', contains both frequently accessed columns (e.g., 'price', 'volume') and rarely accessed columns (e.g., 'raw_json'). To optimize performance and cost, what column family design is recommended?

A.Use separate tables for each access pattern
B.Store rarely accessed columns as a JSON string in a single column
C.Create two column families: 'core' for frequently accessed columns and 'extended' for rarely accessed columns
D.Place all columns in a single column family for simplicity
AnswerC

This allows efficient reads by reading only the required column family.

Why this answer

Separating columns into different column families based on access patterns is a best practice. Frequently accessed columns should be in one column family (e.g., 'core'), and rarely accessed columns in another (e.g., 'extended'). This allows Bigtable to optimize storage and read performance.

184
MCQeasy

A developer runs the above command and receives a successful deployment. However, the service is not accessible from the internet. The service is intended to be public. What should the developer check next?

A.The region us-central1 is not available
B.The Cloud Run service has a custom domain mapped
C.The container image is healthy
D.The service IAM policy to ensure allUsers has Cloud Run Invoker role
AnswerD

This is the most common reason for a publicly inaccessible Cloud Run service after successful deployment.

Why this answer

Cloud Run services are private by default; even after a successful deployment, the service will not be accessible from the internet unless the IAM policy explicitly grants the `roles/run.invoker` role to `allUsers`. Without this permission, any HTTP request from outside the project will be denied with a 403 Forbidden error, regardless of the service's health or region.

Exam trap

The PCD exam often tests the misconception that a successful deployment or a healthy container automatically makes a service publicly accessible, when in fact Cloud Run requires an explicit IAM binding to allow unauthenticated invocations.

How to eliminate wrong answers

Option A is wrong because `us-central1` is a standard, fully available Google Cloud region; region unavailability would cause a deployment failure, not a post-deployment accessibility issue. Option B is wrong because a custom domain is optional for public access — Cloud Run automatically provides a `*.run.app` URL that is publicly resolvable; the issue is IAM, not DNS. Option C is wrong because a healthy container image is required for a successful deployment, but it does not control network-level access; the container could be perfectly healthy yet still unreachable if IAM denies unauthenticated invocations.

185
MCQmedium

A company is migrating from Amazon Redshift to BigQuery. They need to stage the data in Amazon S3 before transferring to BigQuery. Which service should they use to automate the transfer?

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

DTS for Redshift automates data transfer from Redshift to BigQuery via S3 staging.

Why this answer

BigQuery Data Transfer Service supports Redshift as a source and uses Amazon S3 as an intermediate staging location for the data transfer.

186
MCQmedium

A team is using Cloud Source Repositories and wants to enforce code reviews before merging. What tool should they use?

A.Cloud Source Repositories pull requests without restrictions.
B.Cloud Deploy with manual approval.
C.Cloud Source Repositories with branch protection rules that require pull request reviews and passing status checks.
D.Cloud Build triggers with approval gates.
AnswerC

Enforces mandatory code reviews and CI checks.

Why this answer

Cloud Source Repositories (CSR) integrates with Cloud Build and Git. To enforce mandatory code reviews before merging, you configure branch protection rules on the CSR repository. These rules require pull request reviews and passing status checks (e.g., from Cloud Build), preventing direct pushes to protected branches.

This is the native Git-based mechanism for enforcing review workflows.

Exam trap

The trap here is confusing deployment approval gates (Cloud Deploy or Cloud Build) with repository-level merge controls, leading candidates to pick a CI/CD tool instead of the correct branch protection feature within Cloud Source Repositories.

How to eliminate wrong answers

Option A is wrong because CSR pull requests without restrictions do not enforce code reviews; they allow merging without any approval, defeating the requirement. Option B is wrong because Cloud Deploy is a continuous delivery service for deploying to GKE, Cloud Run, etc., not a code review or repository management tool; its manual approval gates apply to deployment pipelines, not to merging code. Option D is wrong because Cloud Build triggers with approval gates control whether a build runs after a commit, not whether a pull request can be merged; they do not enforce code review requirements on the repository itself.

187
Multi-Selectmedium

A developer wants to automatically detect and capture application errors in a production environment on Google Cloud. Which two Google Cloud services should be enabled? (Choose two.)

Select 2 answers
A.Cloud Error Reporting
B.Cloud Trace
C.Cloud Profiler
D.Cloud Debugger
E.Cloud Logging
AnswersA, E

Cloud Error Reporting automatically detects and groups application errors.

Why this answer

Cloud Error Reporting aggregates and displays application errors in real time, allowing developers to automatically detect and capture errors in production. Cloud Logging stores all application logs, which Error Reporting uses as a source to identify and analyze error events. Together, they provide a complete solution for error detection and capture without manual intervention.

Exam trap

The PCD exam often tests the distinction between monitoring (Error Reporting, Logging) and debugging/tracing tools (Debugger, Trace, Profiler), leading candidates to select Debugger or Trace for error detection when they are designed for different purposes.

188
Multi-Selecthard

A company is deploying a Cloud Spanner database for a global application. They need to minimize write latency for users in North America and Europe while ensuring strong consistency. They also want to control costs by only paying for the capacity they use. Which THREE features should they use?

Select 3 answers
A.Dual-region instance configuration.
B.Enable autoscaling with processing units.
C.Multi-region instance configuration (e.g., nam3, eur3).
D.Use a fixed number of nodes to simplify management.
E.Set up a read replica in each continent.
AnswersB, C, E

Enabling autoscaling with processing units adjusts capacity based on demand, allowing the company to pay only for the capacity they use, controlling costs.

Why this answer

A multi-region instance configuration (e.g., nam3, eur3) spans continents, reducing write latency for users in North America and Europe while maintaining strong consistency. Enabling autoscaling with processing units adjusts capacity based on demand, allowing the company to pay only for the capacity they use, controlling costs. Setting up read replicas in each continent reduces read latency for users and offloads reads from the primary, which can indirectly improve write performance by reducing load.

The other options are incorrect: a dual-region instance configuration is limited to two regions within one continent and does not provide global write performance; a fixed number of nodes does not allow cost control since you pay for provisioned nodes regardless of usage.

Exam trap

Candidates often assume dual-region or read replicas provide global write performance, but only multi-region instances ensure strong consistency and low write latency across continents. Read replicas help with read performance but can also reduce load on write regions.

189
MCQmedium

An application uses Cloud SQL and is experiencing slow query performance. The team wants to monitor query latency and identify slow queries. Which Google Cloud tool should they use?

A.Cloud SQL Insights
B.Cloud Debugger
C.Cloud Monitoring
D.Cloud Trace
AnswerA

Cloud SQL Insights is designed for query performance monitoring.

Why this answer

Cloud SQL Insights is the correct tool because it is specifically designed to provide detailed query performance diagnostics for Cloud SQL databases. It captures query latency, execution plans, and wait events, enabling teams to identify and troubleshoot slow queries directly within the Cloud SQL console without additional configuration.

Exam trap

The trap here is that candidates often confuse Cloud Trace (which traces request latency across services) with database query tracing, but Cloud Trace does not provide per-query execution plans or database-specific wait events, making Cloud SQL Insights the only tool that directly addresses slow query identification in Cloud SQL.

How to eliminate wrong answers

Option B (Cloud Debugger) is wrong because it is used for inspecting the state of a running application (e.g., capturing variable values and stack traces) in production, not for monitoring database query latency. Option C (Cloud Monitoring) is wrong because while it can collect metrics and set alerts for Cloud SQL, it does not provide per-query latency breakdowns or execution plan analysis; it is a general monitoring tool, not a query-specific diagnostic tool. Option D (Cloud Trace) is wrong because it focuses on end-to-end request latency across distributed services (e.g., HTTP requests), not on individual database query performance within Cloud SQL.

190
MCQeasy

A developer runs the command above. What is the effect of the --promote flag in this deployment?

A.It creates a new default service version with split traffic.
B.It promotes the previous version to receive traffic.
C.It causes the new version (v2) to receive 100% of traffic after deployment.
D.It enables automatic scaling for the new version.
AnswerC

Correct: --promote directs all traffic to the newly deployed version.

Why this answer

The --promote flag in a Google Cloud App Engine deployment command (gcloud app deploy --promote) causes the newly deployed version (v2) to immediately receive 100% of traffic, effectively making it the default serving version. This is the standard behavior unless the --no-promote flag is explicitly used to keep traffic on the previous version.

Exam trap

A common misconception is that the --promote flag affects the previous version or creates traffic splits. In Google Cloud App Engine, the --promote flag causes the newly deployed version to receive 100% of traffic, making it the default serving version. Using --no-promote keeps traffic on the previous version.

How to eliminate wrong answers

Option A is wrong because --promote does not create a new default service version with split traffic; it sets the new version as the sole default, receiving all traffic, not a split. Option B is wrong because --promote promotes the new version (v2) to receive traffic, not the previous version; the previous version is demoted. Option D is wrong because --promote has no effect on automatic scaling; scaling configuration is set separately via app.yaml or deployment parameters, not by this flag.

191
MCQmedium

A developer deploys this Cloud Run service. During a load test, each incoming request starts a new container instance, even though concurrency is set to 80. What is the reason?

A.The memory limit is too low
B.The container is CPU-bound and cannot handle multiple requests concurrently
C.The CPU limit is too low
D.The concurrency setting of 80 is too high and Cloud Run ignores it
E.The container is not designed to handle multiple concurrent requests (single-threaded)
AnswerE

If the container processes one request at a time, Cloud Run will start a new instance per request.

Why this answer

Cloud Run's concurrency setting controls how many requests the runtime can send to a container instance, but the container itself must be capable of handling those requests concurrently. If the application is single-threaded or uses a blocking I/O model (e.g., a simple Flask or Express server without async workers), it can only process one request at a time. Cloud Run detects that the container is busy and starts a new instance for each incoming request, effectively ignoring the concurrency setting.

Exam trap

The PCD exam often tests the misconception that Cloud Run's concurrency setting is a hard limit that the platform enforces regardless of application design, when in reality the application must be capable of handling concurrent requests for the setting to take effect.

How to eliminate wrong answers

Option A is wrong because a low memory limit would cause out-of-memory errors or container restarts, not the creation of a new container instance per request. Option B is wrong because being CPU-bound does not prevent a container from handling multiple concurrent requests; it may slow down processing, but Cloud Run still sends multiple requests to the same instance if concurrency is set. Option C is wrong because a low CPU limit would throttle CPU usage, not force a new instance per request; the container would still receive concurrent requests, just processed more slowly.

Option D is wrong because Cloud Run does not ignore a concurrency setting of 80; it respects the setting as long as the container can handle the load, but if the container is single-threaded, it effectively becomes a bottleneck.

192
MCQhard

A financial services company is architecting a multi-database solution. They need strong consistency across Cloud Spanner and Cloud SQL for a critical transaction flow. However, two-phase commit (2PC) across heterogeneous databases is not supported. Which pattern should they adopt to maintain data integrity?

A.Use Cloud Spanner change streams to sync data to Cloud SQL
B.Eventual consistency with conflict resolution
C.Migrate all data to Cloud Spanner to avoid cross-database transactions
D.Saga pattern with orchestration and compensating transactions
AnswerD

Saga pattern coordinates distributed transactions and provides consistency via compensations.

Why this answer

The Saga pattern with orchestration and compensating transactions is correct because it maintains data integrity across heterogeneous databases like Cloud Spanner and Cloud SQL without relying on distributed transactions (2PC). In this pattern, each local transaction commits independently, and if a subsequent transaction fails, a compensating transaction is executed to undo the previous committed changes, ensuring eventual consistency and business-level rollback.

Exam trap

The trap here is that candidates may assume Cloud Spanner change streams or eventual consistency with conflict resolution can provide the required strong consistency across heterogeneous databases. However, the correct understanding is that when two-phase commit is not supported, the Saga pattern with orchestration and compensating transactions is the appropriate pattern to maintain data integrity and business-level atomicity across Cloud Spanner and Cloud SQL.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner change streams are designed for real-time replication and analytics, not for maintaining strong transactional consistency across heterogeneous databases; they introduce latency and cannot guarantee atomicity across Cloud Spanner and Cloud SQL. Option B is wrong because eventual consistency with conflict resolution does not meet the requirement for strong consistency in a critical transaction flow; it allows temporary data divergence that could violate business rules. Option C is wrong because migrating all data to Cloud Spanner avoids the cross-database problem but is not a pattern for managing a multi-database solution; the question explicitly asks for a pattern to adopt while keeping both databases.

193
Multi-Selectmedium

A company needs to migrate an on-premises PostgreSQL database to Cloud SQL for PostgreSQL with near-zero downtime. Which TWO features of Database Migration Service (DMS) should they use?

Select 2 answers
A.Dataflow templates
B.Connection profiles
C.Continuous migration with CDC
D.Full dump only
E.One-time migration
AnswersB, C

Required to define source and target for the migration job.

Why this answer

Continuous migration with CDC allows near-zero downtime by capturing ongoing changes after the initial dump. Connection profiles define source and target endpoints. A one-time dump would cause downtime.

Continuous migration includes CDC.

194
MCQmedium

You are a cloud architect at a financial services company. The company is deploying a new application on Google Kubernetes Engine (GKE) that processes sensitive financial transactions. The application must be highly available across two regions (us-central1 and europe-west1) and must fail over automatically if one region becomes unavailable. The application uses Cloud Spanner as its primary database. Additionally, the application needs to send audit logs to a centralized Cloud Storage bucket for compliance. The current design uses GKE clusters in each region with a global HTTP(S) load balancer. However, during a recent test, when the us-central1 cluster was deliberately taken down, the load balancer continued to send traffic to that region, causing errors. You need to troubleshoot and fix the issue. What is the most likely cause and the best solution?

A.The load balancer is configured with only one backend service. Solution: Create a separate backend service for each region.
B.The load balancer backend lacks a health check that marks the backend as unhealthy when the cluster is down. Solution: Configure a health check on the backend service that points to a readiness endpoint on the GKE cluster.
C.The Cloud Spanner instance is not configured with multi-region replication, causing write failures. Solution: Configure Cloud Spanner as a multi-region instance.
D.The GKE clusters are not configured as network endpoint groups (NEGs). Solution: Create NEGs for each cluster and use them as backends.
AnswerB

Health checks are required for the load balancer to stop routing traffic to unhealthy backends.

Why this answer

The issue is that the global HTTP(S) load balancer continues to send traffic to the us-central1 region because its backend service lacks a health check that can detect when the GKE cluster is down. By configuring a health check on the backend service that probes a readiness endpoint (e.g., /healthz) on the GKE cluster, the load balancer will automatically stop routing traffic to the unhealthy region and fail over to the healthy region. This ensures high availability across the two regions as required.

Exam trap

The trap here is that candidates often confuse infrastructure-level health checks (e.g., instance group health) with application-level health checks, or assume that GKE's built-in ingress controller automatically configures health checks for regional failover, when in fact the load balancer backend service must have an explicit health check configured to detect a complete regional cluster outage.

How to eliminate wrong answers

Option A is wrong because creating separate backend services for each region does not solve the problem; the load balancer already uses separate backends (one per region) via the GKE ingress, but without proper health checks, it cannot detect regional failure. Option C is wrong because the issue is about traffic routing from the load balancer, not database write failures; Cloud Spanner multi-region replication is important for database availability but does not affect load balancer traffic distribution. Option D is wrong because while NEGs are a best practice for GKE with load balancers, the core issue is the absence of health checks, not the use of NEGs; NEGs alone do not enable automatic failover without health checks.

195
Drag & Dropmedium

Drag and drop the steps to set up a Cloud Function triggered by a Cloud Storage event in the correct order.

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

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

Why this order

Cloud Functions can be triggered by Cloud Storage events; deployment includes specifying the bucket trigger.

196
MCQmedium

A retail company uses Cloud Spanner as its global transactional database. They need to capture all data changes (inserts, updates, deletes) from specific tables and stream them to a Pub/Sub topic for real-time downstream processing. What Google Cloud feature should they use?

A.Create a Dataflow pipeline that reads from Spanner using JDBC
B.Use Cloud Functions to poll the Spanner tables for changes every minute
C.Enable Cloud Spanner change streams on the tables and configure them to write to Pub/Sub
D.Export the Spanner tables to Avro files in GCS and use BigQuery Change Data Capture
AnswerC

Change streams capture all DML changes and can be set up to stream to Pub/Sub for downstream use.

Why this answer

Cloud Spanner change streams provide a native, fully managed, and low-latency mechanism to capture row-level changes (inserts, updates, deletes) from Spanner tables. These change streams can be directly configured to write to a Pub/Sub topic via a Dataflow template or a custom pipeline, enabling real-time streaming without polling or external tools.

Exam trap

Candidates often confuse Cloud Spanner change streams with batch export methods (e.g., Avro exports to GCS) or polling-based approaches. The key distinction is that change streams provide native, continuous, low-latency capture of row-level changes without batch latency.

How to eliminate wrong answers

Option A is wrong because using a Dataflow pipeline with JDBC to read from Spanner is a batch-oriented approach that does not capture real-time change data; it would require periodic full or incremental scans, which is inefficient and not a streaming solution. Option B is wrong because polling Spanner tables every minute with Cloud Functions introduces latency, is not real-time, and can cause excessive read load on Spanner, violating the requirement for continuous change capture. Option D is wrong because exporting Spanner tables to Avro files in GCS is a batch export operation, not a streaming change data capture mechanism; BigQuery Change Data Capture (CDC) applies to BigQuery tables, not to streaming Spanner changes into Pub/Sub.

197
MCQhard

An application running on Compute Engine generates structured logs. The operations team needs to parse a specific field from the logs and create a metric that counts occurrences of a particular value. They want the metric to be available for alerting with minimal delay. What should they do?

A.Export logs to BigQuery and use scheduled queries
B.Write a Cloud Function to process logs from Pub/Sub
C.Create a log-based metric in Cloud Logging
D.Use the Cloud Monitoring agent to collect logs
AnswerC

Log-based metrics are designed for this use case and provide low-latency metrics.

Why this answer

Log-based metrics in Cloud Logging are designed to extract specific fields from structured logs and count occurrences of particular values with near-real-time latency, making them ideal for alerting with minimal delay. They are natively integrated with Cloud Monitoring, so the metric is automatically available for alerting policies without additional infrastructure or data movement.

Exam trap

The PCD exam often tests the distinction between log-based metrics (native, low-latency) and log export to external systems (higher latency, more complex), tempting candidates to choose BigQuery or Pub/Sub because they seem more powerful for analysis, but they are not optimal for real-time alerting.

How to eliminate wrong answers

Option A is wrong because exporting logs to BigQuery and using scheduled queries introduces significant latency (minutes to hours) due to export batching and query scheduling, which is unsuitable for alerting with minimal delay. Option B is wrong because writing a Cloud Function to process logs from Pub/Sub adds unnecessary complexity, latency, and cost; Cloud Functions are event-driven but still require setting up a Pub/Sub sink and custom code, whereas log-based metrics provide a simpler, native solution with lower overhead. Option D is wrong because the Cloud Monitoring agent collects metrics from VM instances, not logs; it cannot parse structured log fields or create count-based metrics from log content.

198
MCQmedium

A team uses Cloud Endpoints to manage their API. They want to monitor API latency for each API method. What is the recommended approach?

A.Parse Cloud Logging endpoint logs to calculate latency.
B.Use Cloud Trace to analyze samples and estimate latency.
C.Instrument the API code with a custom metric for each method.
D.View the built-in Cloud Endpoints latency metrics in Cloud Monitoring.
AnswerD

Endpoints exports per-method latency metrics automatically.

Why this answer

Cloud Endpoints automatically sends metrics including request latency per method to Cloud Monitoring. Cloud Trace can trace individual requests but not aggregate per method easily. Custom metrics require code changes.

Cloud Logging latency is not built-in.

199
Matchingmedium

Match each Cloud Storage class to its typical use case.

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

Concepts
Matches

Frequently accessed data

Data accessed less than once a month

Data accessed less than once a quarter

Long-term archival data accessed less than once a year

Automatic transition between classes based on access patterns

Why these pairings

Cloud Storage classes optimize cost based on access frequency. Standard is for hot data, Nearline for monthly, Coldline for quarterly, and Archive for yearly access. Common mistakes involve confusing the frequency thresholds.

200
MCQmedium

A company is using Cloud SQL for PostgreSQL and wants to ensure that all connections to the database use SSL/TLS. They have set the `require_ssl` flag but still see some connections using non-SSL. What is the most likely reason?

A.The application is using a database driver that does not support SSL.
B.The flag only applies to connections using the Cloud SQL Auth Proxy.
C.The flag must be configured in the database server parameters, not the Cloud SQL admin panel.
D.Existing connections that were established before the flag was enabled are still active.
AnswerD

The flag does not terminate existing non-SSL connections; they remain until disconnected.

Why this answer

The `require_ssl` flag only affects new connections; existing connections may continue without SSL until they are re-established. Restarting the instance forces all connections to reconnect with SSL. The flag does not require clients to connect via Auth Proxy.

Old clients may not support SSL but the flag would block them, not allow non-SSL.

201
MCQeasy

A company wants to migrate an on-premises PostgreSQL 9.6 database to Cloud SQL for PostgreSQL with minimal downtime. Which service should they use?

A.Cloud Dataflow
B.BigQuery Data Transfer Service
C.Cloud SQL Auth Proxy
D.Database Migration Service
AnswerD

DMS supports PostgreSQL with continuous migration for minimal downtime.

Why this answer

Database Migration Service (DMS) supports PostgreSQL migrations with continuous CDC for minimal downtime. It manages the full dump and incremental sync.

202
MCQmedium

A company is migrating an on-premises PostgreSQL database to Google Cloud. They need high availability with automatic failover and zero RPO. Which Cloud SQL configuration should they choose?

A.Cloud SQL with cross-region replication
B.Cloud SQL HA instance (regional)
C.Cloud SQL read replica in a different region
D.Single zone Cloud SQL instance with automated backups
AnswerB

An HA instance replicates synchronously to a standby in a different zone within the same region, ensuring automatic failover and zero RPO.

Why this answer

Cloud SQL HA instances use synchronous replication to a standby in the same region, providing automatic failover and zero RPO.

203
MCQmedium

A developer is designing a data pipeline using Pub/Sub and Dataflow. They need to guarantee at-least-once delivery with no duplicates in the sink. Which Dataflow feature should they use?

A.Exactly-once processing
B.Checkpointing
C.Idempotent writes
D.Windowing
AnswerA

Exactly-once processing ensures each record is processed once, eliminating duplicates in the sink.

Why this answer

Dataflow's exactly-once processing (also known as 'exactly-once semantics' or 'EOS') ensures that each record is processed exactly once, even if the pipeline restarts or fails. This eliminates duplicates in the sink while still guaranteeing at-least-once delivery from Pub/Sub, because Dataflow uses a combination of source-side deduplication (via Pub/Sub message IDs) and sink-side idempotent writes (via the Dataflow sink's commit protocol). The result is that no duplicate records are written to the sink, meeting the requirement of no duplicates.

Exam trap

The trap here is that candidates confuse 'idempotent writes' (a sink-side property) with Dataflow's built-in 'exactly-once processing' feature, or they mistakenly think checkpointing alone eliminates duplicates, when in fact checkpointing only saves state and does not prevent duplicate writes to the sink.

How to eliminate wrong answers

Option B is wrong because checkpointing is a mechanism for saving pipeline state (e.g., snapshots of progress) to enable recovery after failures, but it does not by itself prevent duplicates in the sink — it only ensures that processing can resume from the last checkpoint, which may still cause duplicate writes if the sink is not idempotent. Option C is wrong because idempotent writes are a property of the sink (e.g., BigQuery's insertId or Cloud Storage's generation number) that allows the same write to be applied multiple times without creating duplicates, but the question asks for a Dataflow feature, not a sink feature; Dataflow's exactly-once processing uses idempotent writes as part of its implementation, but the feature itself is exactly-once processing. Option D is wrong because windowing is a Dataflow feature that groups unbounded data into finite windows (e.g., fixed, sliding, session) for aggregation or processing, but it has no direct role in guaranteeing at-least-once delivery or preventing duplicates — it is a time-based grouping mechanism, not a delivery semantics feature.

204
MCQmedium

Your team manages a serverless application deployed on Cloud Run. The application processes image uploads and stores metadata in Firestore. You have set up a Cloud Monitoring alert based on the 'request_count' metric for the Cloud Run service. The alert triggers when the request count exceeds 1000 requests per minute. Recently, the alert has been firing frequently, but the team notices that the application is performing well and there are no errors. The team is concerned about alert fatigue. You review the metric and notice that the request count metric is based on all HTTP requests, including health checks from the Cloud Run system. The health check requests account for about 30% of the total requests. What should you do to reduce unnecessary alerts while still monitoring real user traffic?

A.Increase the alert threshold to 1500 requests per minute
B.Create a new log-based metric that filters out health check requests, and use that in the alert
C.Disable health checks on the Cloud Run service
D.Configure the existing metric to exclude health check logs
AnswerB

This metric will only count user requests, reducing noise.

Why this answer

Creating a new log-based metric that filters out health check requests allows you to monitor only real user traffic. Cloud Run's system health checks (e.g., from the Cloud Run infrastructure) are included in the default 'request_count' metric, inflating the count. By using a log-based metric with a filter that excludes these health check requests, you can set an accurate alert threshold based on actual user demand, reducing alert fatigue without losing visibility into real issues.

Exam trap

The PCD exam often tests the misconception that you can modify built-in metrics or that simply adjusting thresholds is sufficient, when in reality you must create a custom metric to filter out noise like health checks.

How to eliminate wrong answers

Option A is wrong because simply increasing the threshold to 1500 requests per minute does not address the root cause—health check requests are still included, and the threshold may still be exceeded by a combination of real traffic and health checks, or it may be too high to detect real traffic spikes. Option C is wrong because disabling health checks on Cloud Run is not recommended; health checks are essential for ensuring the service is healthy and for routing traffic correctly, and disabling them could cause the service to be marked unhealthy or stop receiving traffic. Option D is wrong because the existing 'request_count' metric is a built-in metric that cannot be configured to exclude specific logs; you must create a new custom log-based metric with a filter to exclude health check requests.

205
MCQmedium

A company is deploying a batch job that runs once a day on Compute Engine. They are using a startup script to install dependencies and run the job. The job writes output to Cloud Storage. Recently, the job started failing intermittently with "No space left on device" errors, even though the persistent disk has 100 GB free. The team has verified that the disk is not fragmented and that the inode usage is low. The job processes large files and creates many temporary files in /tmp. They suspect the /tmp directory is filling up. What is the most likely cause?

A.The /tmp partition is using a small temporary disk that is separate from the persistent disk.
B.The instance's RAM is insufficient, causing swap to fill the disk.
C.The startup script is not cleaning up temporary files.
D.The Cloud Storage bucket quota is exceeded.
AnswerA

Often /tmp is a tmpfs with limited capacity; creating too many temporary files fills it.

Why this answer

On many Compute Engine images, /tmp is mounted as a tmpfs (in-memory filesystem) which has a limited size, often a fraction of the instance's memory. When the job creates many temporary files, it can fill the tmpfs, causing "No space left on device" even though the persistent disk has ample free space. Option B is incorrect because while cleanup would help, the root cause is limited space in /tmp.

Option C is incorrect because insufficient RAM would cause swapping, not a filesystem full error. Option D is incorrect because Cloud Storage quota would produce errors when writing to the bucket, not on the local filesystem.

206
MCQeasy

A startup expects low and predictable traffic initially but wants to use containers with minimal operational overhead. Which compute service should they choose?

A.App Engine Flexible Environment
B.Google Kubernetes Engine (GKE)
C.Cloud Run
D.Compute Engine
E.Cloud Functions
AnswerC

Fully managed, autoscaling, no infrastructure to manage.

Why this answer

Cloud Run is the correct choice because it runs containers in a fully managed, serverless environment that automatically scales from zero, requires no cluster management, and charges only for resources used during request processing. This matches the startup's need for minimal operational overhead and low, predictable traffic, as Cloud Run abstracts away infrastructure management entirely.

Exam trap

The PCD exam often tests the distinction between serverless containers (Cloud Run) and managed Kubernetes (GKE), where candidates mistakenly choose GKE for container support without considering the operational overhead of cluster management.

How to eliminate wrong answers

Option A is wrong because App Engine Flexible Environment requires managing VM instances and has a minimum of 1 instance running, incurring cost even with no traffic, and does not offer the same zero-scaling efficiency as Cloud Run. Option B is wrong because Google Kubernetes Engine (GKE) requires managing a Kubernetes cluster, including node pools, upgrades, and networking, which adds significant operational overhead unsuitable for minimal management. Option D is wrong because Compute Engine requires full VM management, including OS patching, scaling configuration, and capacity planning, contradicting the goal of minimal operational overhead.

Option E is wrong because Cloud Functions is for event-driven, short-lived code snippets, not for running containers, and has a 9-minute timeout and limited runtime support, making it unsuitable for containerized applications.

207
MCQhard

A team is deploying a microservices application on Cloud Run and needs to implement canary deployments with traffic splitting. They are using Cloud Deploy. What is the correct configuration to gradually shift traffic from the old revision to the new revision?

A.Use Cloud Build to deploy with a script that gradually increases traffic using the Cloud Run API.
B.Use a Cloud Deploy pipeline with a blue-green strategy that swaps all traffic at once.
C.Use a Cloud Deploy delivery pipeline with a canary strategy that specifies percentages like [5, 10, 50, 100] and includes a verification step.
D.Use Cloud Run's built-in traffic splitting with `gcloud run deploy --traffic` and manage manually.
AnswerC

This leverages Cloud Deploy's built-in canary deployment capability with progressive traffic shifting.

Why this answer

Cloud Deploy natively supports canary deployments with traffic splitting for Cloud Run. By defining a canary strategy with incremental percentages (e.g., [5, 10, 50, 100]) and including a verification step, the pipeline automatically shifts traffic in stages, pausing for verification at each phase to ensure the new revision is healthy before progressing. This approach integrates directly with Cloud Deploy's delivery pipeline, eliminating the need for manual scripts or external API calls.

Exam trap

The trap here is that candidates often confuse Cloud Run's manual traffic splitting (`gcloud run deploy --traffic`) with Cloud Deploy's automated canary pipeline, assuming manual commands are sufficient for gradual shifts, but the exam requires understanding that Cloud Deploy provides the orchestration, verification, and rollback needed for production canary deployments.

How to eliminate wrong answers

Option A is wrong because using Cloud Build with a script to gradually increase traffic via the Cloud Run API bypasses Cloud Deploy's native canary support, adding unnecessary complexity and losing pipeline observability and rollback capabilities. Option B is wrong because a blue-green strategy swaps all traffic at once, which contradicts the requirement for gradual traffic shifting; it does not support incremental percentages. Option D is wrong because using `gcloud run deploy --traffic` manually requires ongoing manual intervention and does not leverage Cloud Deploy's automated pipeline, verification steps, or rollback mechanisms.

208
MCQmedium

A financial services company needs a globally distributed database that provides ACID transactions across regions with 99.999% availability SLA. The workload is transactional, with up to 10,000 transactions per second. Which database should they choose?

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

Spanner meets all requirements: global distribution, ACID across regions, 99.999% SLA.

Why this answer

Cloud Spanner offers global distribution, ACID transactions, and 99.999% SLA, making it ideal for financial transactional workloads.

209
MCQhard

A company deploys a stateful application on GKE using a StatefulSet with PersistentVolumeClaims (PVCs). After a node failure, the pod is rescheduled to another node but the PVC remains in 'Pending' state. What is the most likely reason?

A.The PVC is bound to a PV that is still attached to the failed node.
B.The StorageClass has reclaimPolicy: Delete so the PV was deleted.
C.The PV's claimRef still points to the old PVC UID and is in Released state.
D.The StatefulSet's pod management policy prevents reattachment.
AnswerC

By default, PV has retain policy; claimRef must be removed to reuse.

Why this answer

When a StatefulSet pod is rescheduled after a node failure, the original PersistentVolume (PV) may remain in a 'Released' state if its claimRef still points to the old PersistentVolumeClaim (PVC) UID. The PV cannot be re-bound to the new PVC (which has a different UID) until the claimRef is cleared, causing the PVC to remain 'Pending'. This is a known behavior in Kubernetes where PVs are not automatically recycled for reuse with a new PVC UID.

Exam trap

The key trap is that the PV's claimRef prevents re-binding until it is cleared, leading to a 'Pending' PVC state. This is a known behavior in GKE and Kubernetes, where PVs are not automatically recycled for reuse with a new PVC UID.

How to eliminate wrong answers

Option A is wrong because if the PV were still attached to the failed node, the PVC would typically show a 'Lost' or 'Failed' status, not 'Pending'; the PV attachment is a separate concern from the PVC binding state. Option B is wrong because reclaimPolicy: Delete would delete the PV only after the PVC is deleted, not while the PVC still exists; the PVC being 'Pending' indicates the PV is still present but not bindable. Option D is wrong because StatefulSet's pod management policy (e.g., OrderedReady or Parallel) affects pod creation/deletion order, not the ability to reattach a PVC to a PV; the PVC binding issue is independent of the pod management policy.

210
MCQmedium

A stateful service on GKE needs to persist data that must be accessible from any pod in the cluster, regardless of which node the pod runs on. Which volume type should they use?

A.PersistentVolumeClaim with RWX access mode
B.emptyDir
C.ConfigMap
D.hostPath
AnswerA

PersistentVolumeClaim with ReadWriteMany allows multiple pods to access the same volume concurrently, even across nodes.

Why this answer

A PersistentVolumeClaim (PVC) with RWX (ReadWriteMany) access mode is correct because it allows multiple pods across different nodes to read and write to the same persistent volume simultaneously. This is essential for a stateful service where data must be accessible from any pod in the cluster, regardless of which node the pod runs on. RWX is typically backed by network filesystems like NFS or GKE Filestore, which provide shared access across nodes.

Exam trap

The PCD exam often tests the distinction between access modes (RWO, RWM, RWX) and candidates mistakenly choose hostPath or emptyDir because they think local storage is sufficient, overlooking the requirement for cross-node accessibility.

How to eliminate wrong answers

Option B (emptyDir) is wrong because it creates a temporary directory that is tied to the lifecycle of a pod and is not shared across pods on different nodes; data is lost when the pod is deleted. Option C (ConfigMap) is wrong because it is designed for storing non-sensitive configuration data as key-value pairs, not for persistent storage of application data; it cannot be used for read/write operations by pods. Option D (hostPath) is wrong because it mounts a file or directory from the host node's filesystem into a pod, making data inaccessible from pods running on other nodes and violating the requirement for cluster-wide accessibility.

211
MCQmedium

You need to design a system that handles both high-frequency OLTP transactions and real-time analytical queries on the same dataset with low latency. Which Google Cloud database should you choose?

A.AlloyDB
B.BigQuery
C.Cloud SQL for PostgreSQL
D.Cloud Spanner
AnswerA

AlloyDB's columnar engine allows fast analytical queries on transactional data.

Why this answer

AlloyDB is PostgreSQL-compatible and includes a columnar engine for fast analytical queries on transactional data, enabling HTAP workloads. Cloud SQL does not have a columnar engine, BigQuery is for analytics only, and Spanner is OLTP-focused.

212
MCQeasy

During a code review, a developer notices that the application's Cloud Storage client library is using the default credentials of the Compute Engine instance. What is a more secure alternative for a production environment?

A.Create a dedicated service account with minimal permissions and attach it to the instance
B.Store user credentials in a configuration file
C.Use an API key for Cloud Storage
D.Generate an access token and embed it in the code
AnswerA

This follows the principle of least privilege and avoids using default credentials.

Why this answer

Creating a dedicated service account with minimal permissions and attaching it to the Compute Engine instance follows the principle of least privilege. This avoids using the overly permissive default Compute Engine service account, which often has broad access to many Google Cloud services. By scoping the service account to only the required Cloud Storage permissions (e.g., roles/storage.objectViewer), you reduce the attack surface and adhere to production security best practices.

Exam trap

The PCD exam often tests the misconception that the default Compute Engine service account is acceptable for production, when in fact it is overly permissive and should be replaced with a custom service account scoped to the minimum required roles.

How to eliminate wrong answers

Option B is wrong because storing user credentials in a configuration file on the instance is insecure; credentials can be exposed via file read vulnerabilities or accidental commits, and user credentials are not designed for server-to-server service calls. Option C is wrong because API keys are a simplistic authentication mechanism that do not support fine-grained access control, are tied to the project rather than a specific identity, and are vulnerable to leakage in URLs or logs. Option D is wrong because embedding an access token directly in code is a severe security anti-pattern; tokens expire and require rotation, and hardcoding them makes them impossible to revoke or rotate without redeploying the application.

213
MCQmedium

Refer to the exhibit. A Cloud Build config deploys a new image to GKE. After the build succeeds, the pods restart with the new image but the application configuration is unchanged. What is the most likely cause?

A.The ConfigMap is not updated with the new configuration values.
B.The deployment rollout strategy is set to Recreate, causing downtime.
C.The new image is not being pulled because of imagePullPolicy: IfNotPresent.
D.The GKE cluster does not have sufficient permissions to pull from Container Registry.
AnswerA

Correct; the application config is stored in a ConfigMap that is not refreshed during deployment.

Why this answer

A is correct because a Cloud Build config that deploys a new image to GKE does not automatically update the ConfigMap. The pods restart with the new image, but the application configuration remains unchanged because the ConfigMap still holds the old values. To apply new configuration, the ConfigMap must be updated separately, and the pods must be restarted or redeployed to pick up the changes.

Exam trap

The PCD exam often tests the misconception that deploying a new image automatically updates the application configuration, when in fact ConfigMaps and Secrets must be updated independently.

How to eliminate wrong answers

Option B is wrong because the Recreate rollout strategy would cause downtime, but it would still apply the new image and any updated configuration; the question states the application configuration is unchanged, not that there is downtime. Option C is wrong because imagePullPolicy: IfNotPresent only affects whether the image is pulled if it already exists locally; it does not prevent the new image from being pulled if the tag is different (e.g., a new digest or tag). Option D is wrong because if the GKE cluster lacked permissions to pull from Container Registry, the build would fail or the pods would fail to start with an ImagePullBackOff error, not simply restart with unchanged configuration.

214
MCQmedium

You are designing a Cloud Spanner schema with a parent Orders table and an OrderItems child table. Queries frequently join Orders and OrderItems on OrderId. Which feature should you use to optimize read performance?

A.Denormalize OrderItems into the Orders table
B.Use a STORING clause on the index
C.Create a global secondary index on OrderItems(OrderId)
D.Use interleaved tables with OrderItems as child of Orders
AnswerD

Interleaving ensures child rows are stored with parent, making joins fast.

Why this answer

Interleaving stores child rows physically with the parent row, reducing latency for joins. Secondary indexes help lookups but not joins. Storing clause adds columns to index but does not improve join performance like interleaving.

215
MCQmedium

An organization uses Flyway for versioned schema migrations. They are migrating from PostgreSQL to Cloud SQL for PostgreSQL. What is the best practice for applying schema changes during the migration?

A.Use Database Migration Service to apply schema changes
B.Manually apply schema changes using pgAdmin
C.Use Flyway migration scripts in a CI/CD pipeline
D.Use Cloud SQL import wizard
AnswerC

Flyway provides versioned, automated schema migrations.

Why this answer

Flyway integrates well with Cloud SQL and CI/CD. The best practice is to use Flyway migrations to apply schema changes before or after data migration, ensuring version control and repeatability.

216
MCQeasy

A developer is building a CI/CD pipeline for a microservices application. The pipeline should build a container image, run unit tests, and deploy to Google Kubernetes Engine (GKE) only if all tests pass. Which Google Cloud service is best suited for orchestrating this pipeline?

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

Cloud Build is the native CI/CD service for building, testing, and deploying on Google Cloud.

Why this answer

Cloud Build is the correct choice because it is a fully managed CI/CD platform that natively supports building container images, running unit tests, and deploying to GKE. It can be configured with a cloudbuild.yaml file to define steps for building, testing, and deploying, and it only proceeds to the deploy step if all prior steps (including tests) succeed. This makes it the best fit for orchestrating the entire pipeline in a single, integrated service.

Exam trap

The trap here is that candidates may confuse Cloud Run (a deployment target) with a CI/CD orchestrator, or assume Compute Engine is needed for custom CI/CD tools, but Cloud Build is the native, fully managed service for this exact pipeline workflow.

How to eliminate wrong answers

Option B (Compute Engine) is wrong because it provides raw virtual machines, not a CI/CD orchestration service; you would need to manually install and manage CI/CD tools like Jenkins or GitLab Runner, which adds overhead and lacks native integration with GKE. Option C (Cloud Run) is wrong because it is a serverless compute platform for running stateless containers, not a CI/CD pipeline orchestrator; it cannot build images or run tests as part of a pipeline. Option D (Cloud Functions) is wrong because it is an event-driven compute service for single-purpose functions, not designed for multi-step CI/CD workflows; it lacks built-in support for building container images or deploying to GKE.

217
MCQmedium

You are designing a polyglot persistence architecture for an IoT platform. Device telemetry is stored in Cloud Bigtable for ingestion and low-latency queries. When a device registers a high-priority alert, you need to trigger an email notification. What is the recommended approach to decouple the alert processing from Bigtable?

A.Use the Bigtable change streams feature (currently in preview) to push alerts to Pub/Sub, then a Cloud Function sends the email.
B.Enable Bigtable replication and set up a trigger in the replica.
C.Write a Dataflow pipeline that reads from Bigtable and writes to Cloud Storage.
D.Create a scheduled Cloud Function that polls Bigtable every minute for new alerts.
AnswerA

Bigtable change streams (preview) allow streaming changes to Pub/Sub for real-time processing.

Why this answer

Bigtable change streams (currently in preview) allow you to capture row-level changes in near real-time and publish them to Pub/Sub. This is the recommended approach to decouple alert processing from Bigtable. Using change streams, you can configure a subscription that triggers a Cloud Function to send the email notification.

This pattern avoids the need for custom application code, polling, or inefficient batch processing. Option B (replication triggers) is not supported, option C adds unnecessary latency, and option D (polling) is inefficient and not decoupled.

218
Multi-Selectmedium

A developer is deploying a Python web application to App Engine Flexible Environment. The application requires a specific third-party binary that is not pre-installed on the runtime image. Which two steps should the developer take to ensure the binary is available? (Choose two.)

Select 2 answers
A.Configure a VM-level startup script in the Google Cloud Console.
B.Specify the binary as a dependency in the requirements.txt file.
C.Include the binary in the application's Git repository and reference it in the app.yaml.
D.Use a startup script in the app.yaml to install the binary.
E.Add the binary installation commands to a Dockerfile and use a custom runtime.
AnswersD, E

Startup scripts in app.yaml can run commands to install binaries.

Why this answer

App Engine Flexible Environment supports a `startup_script` field in `app.yaml` that runs shell commands during instance initialization, allowing installation of third-party binaries. Option E is correct because using a custom runtime with a Dockerfile gives full control over the base image and dependencies, enabling the developer to install any required binary via `RUN` commands.

Exam trap

The trap here is that candidates confuse App Engine Flexible Environment's `startup_script` with Compute Engine's VM-level startup scripts, or assume that `requirements.txt` can handle system dependencies, when in fact it only manages Python packages.

219
MCQeasy

A developer wants to deploy a Cloud Function that connects to a Cloud SQL database. What is the simplest way to securely inject database credentials?

A.Store credentials in the Cloud Function code as environment variables.
B.Use Cloud Key Management Service to encrypt credentials and pass them via HTTP headers.
C.Use Secret Manager to store and access the database password.
D.Embed credentials in the database connection string in the source code.
AnswerC

Secret Manager provides secure storage and access control for secrets.

Why this answer

Secret Manager provides a secure, centralized service for storing sensitive data like database passwords, and the Cloud Function can access the secret at runtime via the Secret Manager API or by mounting it as a volume. This avoids hardcoding credentials in code or environment variables, which can be exposed in logs or source control. It is the simplest and most secure approach recommended by Google Cloud for injecting database credentials into Cloud Functions.

Exam trap

The trap here is that candidates often confuse environment variables (Option A) as a secure method because they are not in source code, but the exam tests the understanding that environment variables in serverless environments can still be exposed through logs or the console, whereas Secret Manager provides dedicated encryption and access control.

How to eliminate wrong answers

Option A is wrong because storing credentials as environment variables in Cloud Function code is not secure; environment variables can be exposed in logs, error messages, or through the Cloud Functions UI, and they do not provide encryption at rest or access control. Option B is wrong because using Cloud KMS to encrypt credentials and passing them via HTTP headers is unnecessarily complex and insecure; HTTP headers are visible in transit unless TLS is used (which is standard), but the decryption key management adds overhead, and this approach does not integrate natively with Cloud Functions' runtime. Option D is wrong because embedding credentials in the database connection string in the source code is a security risk; it exposes secrets in version control, build artifacts, and logs, violating the principle of least privilege and making rotation difficult.

220
MCQhard

You are designing a data pipeline that ingests streaming data from IoT devices using Cloud IoT Core, processes it with Dataflow, and stores results in BigQuery. The data volume is expected to be 10 GB per day with occasional spikes. You need to minimize processing latency and cost. Which configuration should you choose for the Dataflow pipeline?

A.Use streaming mode with autoscaling and maximum workers set to 10.
B.Use Dataflow Prime for automatic optimization.
C.Use streaming mode with streaming engine enabled and 2 workers.
D.Use batch mode with a fixed number of workers to reduce cost.
AnswerC

Streaming engine reduces latency and cost for moderate throughput.

Why this answer

Streaming mode with Streaming Engine is designed for low-latency, continuous data ingestion from IoT Core, and setting 2 workers minimizes cost while handling the expected 10 GB/day volume with occasional spikes through autoscaling. Streaming Engine offloads state management to the backend, reducing worker overhead and improving latency, making it ideal for this use case. Option B (Dataflow Prime) is not optimal because, although it supports both batch and streaming pipelines and offers automatic optimization, for a small, predictable workload like 10 GB/day, the overhead of Prime's automation may not justify the cost.

Manual tuning with Streaming Engine and a small initial worker count is more cost-effective while still providing low latency. Autoscaling can handle spikes without over-provisioning, making C a better fit.

Exam trap

Google Cloud often tests the misconception that batch mode is cheaper for streaming data, but the trap here is that batch mode incurs higher latency and requires manual triggering, making it unsuitable for real-time IoT pipelines despite lower compute cost per GB.

How to eliminate wrong answers

Option A is wrong because setting maximum workers to 10 may over-provision resources for a 10 GB/day workload, increasing cost without latency benefit, and autoscaling alone doesn't guarantee the low-latency optimization that Streaming Engine provides. Option B is wrong because Dataflow Prime is a premium feature that adds cost for automatic optimization, which is unnecessary for this predictable, moderate-volume streaming workload and does not inherently minimize latency or cost compared to Streaming Engine. Option D is wrong because batch mode is designed for finite, bounded data and introduces higher latency (minutes to hours) due to windowing and triggering, which is unsuitable for real-time IoT streaming data that requires low processing latency.

221
MCQmedium

A team is setting up a CI/CD pipeline for a Node.js App Engine application using Cloud Build. The source code is in Cloud Source Repositories. What must be configured to automatically run unit tests before deployment?

A.Enable Cloud Build triggers on the repository
B.Use the App Engine deployment wizard
C.Add a cloudbuild.yaml file with a test step
D.Use a Dockerfile to run tests
AnswerC

The build config defines the steps, including running tests; a trigger can then invoke it on push.

Why this answer

Cloud Build uses a cloudbuild.yaml file to define build steps, and adding a test step ensures unit tests run automatically before deployment. Without this configuration, Cloud Build will not execute tests; it only runs the steps explicitly defined in the build configuration file.

Exam trap

The PCD exam often tests the misconception that enabling a trigger alone is sufficient to run tests, when in fact the trigger only initiates the build; the actual test execution must be explicitly defined in the build configuration file.

How to eliminate wrong answers

Option A is wrong because enabling Cloud Build triggers on the repository only starts the build process on code changes, but does not define what steps (like tests) to run; triggers alone do not execute tests. Option B is wrong because the App Engine deployment wizard is a manual GUI tool in the Google Cloud Console, not an automated CI/CD pipeline component, and it does not integrate with Cloud Build to run tests. Option D is wrong because a Dockerfile is used to build a container image, not to define CI/CD pipeline steps; Cloud Build ignores Dockerfiles for pipeline logic and requires a cloudbuild.yaml for test execution.

222
MCQeasy

You need a fully managed, relational OLTP database that is PostgreSQL-compatible and can run analytical queries on the same data without extract-transform-load (ETL). Which Google Cloud database should you use?

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

AlloyDB is PostgreSQL-compatible and includes a columnar engine for fast analytics on transactional data.

Why this answer

AlloyDB is a fully managed, PostgreSQL-compatible database service designed for both transactional (OLTP) and analytical workloads on the same data without requiring ETL. It achieves this through its AlloyDB Columnar Engine, which automatically accelerates analytical queries by storing data in a columnar format while maintaining full PostgreSQL compatibility for OLTP operations.

Exam trap

The trap here is that candidates often confuse Cloud SQL for PostgreSQL as sufficient for mixed workloads, but it lacks native columnar analytics acceleration, requiring separate analytics infrastructure or ETL processes.

How to eliminate wrong answers

Option A is wrong because Cloud Bigtable is a NoSQL, wide-column database optimized for high-throughput, low-latency operational workloads, not a relational OLTP database, and it is not PostgreSQL-compatible. Option B is wrong because Cloud SQL for PostgreSQL is a fully managed relational OLTP database but lacks built-in support for running analytical queries on the same data without ETL; it requires separate analytics solutions like BigQuery or external ETL pipelines. Option D is wrong because Cloud Spanner is a globally distributed, strongly consistent relational database but is not PostgreSQL-compatible (it uses GoogleSQL or standard SQL with Spanner-specific extensions) and is designed for horizontal scaling across regions, not specifically for mixed OLTP/analytical workloads without ETL.

223
Multi-Selectmedium

A company is deploying a containerized application on Cloud Run that requires access to a Cloud SQL PostgreSQL instance. The application needs to connect to the database using private IP to minimize latency and avoid public internet exposure. The Cloud Run service and Cloud SQL instance are in the same region and project. The database user and password are stored in Secret Manager. Which two steps should the developer take to enable the connection? (Choose TWO.)

Select 2 answers
A.Grant the Cloud Run service account the Cloud SQL Client role.
B.Set the CLOUD_SQL_CONNECTION_NAME environment variable in the Cloud Run service.
C.Enable the Cloud SQL Admin API.
D.Configure the Cloud Run service to use a VPC connector and set up a private services access connection for Cloud SQL.
E.Deploy the Cloud SQL Auth proxy as a sidecar container in Cloud Run.
AnswersA, D

The Cloud Run service account needs the Cloud SQL Client role (roles/cloudsql.client) to authenticate and connect to Cloud SQL.

Why this answer

The Cloud Run service account needs the Cloud SQL Client role to authenticate with Cloud SQL. Option D is correct because Cloud Run requires a VPC connector to access resources on a VPC network, and Private Services Access must be configured to allow Cloud Run to reach the Cloud SQL private IP. Option B is incorrect because the CLOUD_SQL_CONNECTION_NAME environment variable is used with the Cloud SQL Auth proxy, not with private IP.

Option C is incorrect because enabling the Cloud SQL Admin API is a prerequisite but not a direct step for the connection itself; it is often already enabled. Option E is incorrect because the Cloud SQL Auth proxy is not needed when using private IP.

224
MCQmedium

An organization is migrating an on-premises PostgreSQL database to Cloud SQL. They need minimal downtime and want to use Database Migration Service (DMS) with continuous change data capture (CDC). What is the correct sequence of steps?

A.Create connection profile → start migration job with full dump → CDC phase → promote replica
B.Create connection profile → start full dump → promote to primary
C.Start CDC directly without full dump → promote replica
D.Promote replica immediately after creating connection profile
AnswerA

Correct order for continuous migration with DMS.

Why this answer

DMS first creates a connection profile, then starts a migration job performing a full dump, then transitions to CDC, and finally promotes the replica to complete the cutover.

225
MCQeasy

An e-commerce company wants to use Cloud SQL for PostgreSQL with high availability (HA) in the same region. What is the RPO (Recovery Point Objective) of Cloud SQL HA configuration?

A.Up to 1 hour
B.Up to 5 minutes
C.Depends on the database size
D.0 (zero)
AnswerD

Synchronous replication guarantees zero data loss.

Why this answer

Cloud SQL uses synchronous replication to a standby instance in the same zone/region, ensuring zero data loss on failover.

Page 2

Page 3 of 13

Page 4