Courseiva

Google Professional Cloud Developer (PCD) — Questions 301375

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

Page 4

Page 5 of 13

Page 6
301
MCQeasy

A developer wants to connect to a Cloud SQL instance from a Compute Engine VM without whitelisting IP addresses and with automatic encryption. What should they use?

A.Use the Cloud SQL Auth Proxy.
B.Use direct IP connection with SSL.
C.Use a Cloud SQL Connector library.
D.Use a Cloud VPN connection.
AnswerA

Use the Cloud SQL Auth Proxy. It provides secure, encrypted connections without IP allowlisting using IAM authentication. It runs as a sidecar or on the client.

Why this answer

Cloud SQL Auth Proxy provides secure, encrypted connections without IP allowlisting. It uses IAM for authentication and runs as a sidecar or on the client. Direct IP with SSL still requires IP allowlisting.

Cloud SQL Connector libraries also provide secure connections but the proxy is the standard tool for VMs.

302
MCQeasy

Which Google Cloud database is serverless and automatically scales to zero when not in use, making it cost-effective for variable workloads?

A.Memorystore
B.BigQuery
C.Cloud Spanner
D.Cloud SQL
AnswerB

BigQuery is serverless; you pay only for queries and storage, and it scales automatically.

Why this answer

BigQuery is serverless and scales automatically; it charges per query / storage and can scale to zero (no compute when idle). Firestore is serverless but not exactly 'scales to zero' as it charges for data stored.

303
MCQeasy

A team is deploying a Cloud SQL for PostgreSQL instance and needs to enforce that all connections use SSL/TLS. Which flag must they enable on the Cloud SQL instance?

A.require_ssl
B.ssl_enforcement
C.enforce_tls
D.cloudsql_ssl_only
AnswerA

Enabling require_ssl forces all connections to use SSL.

Why this answer

The 'require_ssl' flag, when set to 'on', ensures that only SSL-encrypted connections are allowed. This is a database flag specific to Cloud SQL for PostgreSQL and MySQL.

304
MCQmedium

Your application writes structured logs to Cloud Logging. You want to create a metric that counts log entries with a specific severity level, then alert when the count exceeds a threshold. What should you do?

A.Use Cloud Monitoring's custom metrics API to write the count.
B.Export logs to BigQuery and analyze there.
C.Create a log-based metric using the Logs Explorer, then set up an alerting policy.
D.Use Cloud Logging's metrics dashboard.
AnswerC

Logs Explorer allows you to define a metric from a query (e.g., count of 'ERROR' severity), which then becomes available in Cloud Monitoring for alerting.

Why this answer

Log-based metrics in Cloud Logging allow you to define a counter metric based on log entries matching a filter (e.g., severity=ERROR). Once the metric is created, you can set up an alerting policy in Cloud Monitoring to trigger when the count exceeds a threshold. This approach is native, serverless, and requires no custom code or external exports.

Exam trap

The PCD exam often tests the distinction between viewing metrics (dashboards) and creating actionable metrics (log-based metrics with alerting), leading candidates to mistakenly choose the metrics dashboard option (D) instead of the correct creation workflow (C).

How to eliminate wrong answers

Option A is wrong because using Cloud Monitoring's custom metrics API would require you to write application code to manually increment a metric, which duplicates effort and bypasses the native log-based metric functionality. Option B is wrong because exporting logs to BigQuery adds latency, cost, and complexity; it is not a real-time alerting solution and requires separate querying and monitoring setup. Option D is wrong because Cloud Logging's metrics dashboard only displays existing metrics; it does not allow you to create a new log-based metric or configure alerting policies.

305
Multi-Selectmedium

Which TWO practices should be followed when integrating Cloud Endpoints with a Cloud Run service to enforce API authentication and rate limiting?

Select 2 answers
A.Use API keys to authenticate end users
B.Set the audience field in the Endpoints service configuration to the Cloud Run service URL
C.Configure rate limiting in the OpenAPI specification using extension properties
D.Deploy Cloud Endpoints as a sidecar container in the same Cloud Run instance
E.Configure Cloud Armor rules to enforce rate limiting before requests reach Endpoints
AnswersB, C

This ensures the JWT token is validated for the correct audience.

Why this answer

The `audience` field in the Endpoints service configuration must match the Cloud Run service URL (e.g., `https://myservice-xxxxx-uc.a.run.app`). This ensures that the JWT tokens issued by Google's authentication system are validated against the intended recipient, preventing token reuse across different services. Without this match, authentication will fail because the token's `aud` claim will not match the expected audience.

Exam trap

The PCD exam often tests the distinction between authentication mechanisms (API keys vs. JWT/OAuth2) and deployment models (sidecar vs. managed proxy), expecting candidates to know that API keys do not authenticate users and that Cloud Run uses a managed proxy, not a sidecar.

306
MCQmedium

An organization wants to cache frequently accessed session data for a web application to reduce database load. They require sub-millisecond latency and support for pub/sub messaging. Which Google Cloud service should they use?

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

Redis provides in-memory caching with sub-millisecond latency and built-in pub/sub messaging.

Why this answer

Memorystore for Redis is the correct choice because it provides an in-memory data store with sub-millisecond latency, ideal for caching frequently accessed session data. It also natively supports pub/sub messaging via Redis's built-in PUBLISH/SUBSCRIBE commands, meeting both requirements precisely.

Exam trap

The trap here is that candidates often confuse Firestore's real-time listeners with pub/sub messaging, overlooking that Firestore lacks the dedicated pub/sub channel model and sub-millisecond cache performance required for session caching.

How to eliminate wrong answers

Option A is wrong because Cloud SQL is a relational database with disk-based storage, incurring higher latency (typically milliseconds) and lacking native pub/sub messaging support. Option B is wrong because Cloud Bigtable is a wide-column NoSQL database optimized for large-scale analytical workloads, not for sub-millisecond caching or pub/sub patterns. Option D is wrong because Firestore is a document-oriented NoSQL database with real-time listeners but does not provide sub-millisecond cache latency and lacks a dedicated pub/sub messaging system like Redis.

307
Multi-Selecthard

A company is running a Cloud Spanner instance with 1000 processing units. They notice high-priority CPU utilization exceeding 90% during peak hours, causing increased latency. They want to automatically scale capacity to handle the load while staying cost-effective. Which TWO actions should they take? (Choose 2.)

Select 2 answers
A.Enable proactive scaling based on a schedule.
B.Manually increase processing units to 2000 during peak hours.
C.Set the high-priority CPU target to 70% to trigger scaling earlier.
D.Convert the instance to use nodes instead of processing units.
E.Configure autoscaling with a minimum of 1000 processing units and a maximum of 3000 processing units.
AnswersC, E

The target determines when to scale; a lower target (70%) triggers scaling before saturation.

Why this answer

Spanner autoscaling requires setting min and max processing units and a high-priority CPU target. Autoscaling adjusts capacity based on the target. Manual scaling is not automatic.

Nodes are a different capacity unit; mixing units is not recommended. Proactive scaling is for scheduled changes, not automatic.

308
MCQmedium

A company is deploying a containerized application on Google Kubernetes Engine (GKE). The deployment uses a Service of type LoadBalancer. After creating the Service, the external IP remains pending for several minutes. The team has verified that the cluster has sufficient node capacity and that the pod is running. What is the most likely cause?

A.The Service is using an incorrect port mapping.
B.The pod's readiness probe is failing.
C.The project's quota for external IP addresses has been exhausted.
D.The cluster is using a regional cluster type.
AnswerC

Exhausted quota is a common cause for pending external IPs.

Why this answer

When a Service of type LoadBalancer is created in GKE, it provisions an external IP address from the project's quota. If the quota for external IP addresses is exhausted, the IP assignment remains pending until additional quota is requested or released. The cluster having sufficient node capacity and the pod running confirms that the issue is not resource-related but rather a cloud-level quota limitation.

Exam trap

A common misconception when a GKE LoadBalancer's external IP is pending is that it's due to cluster resource issues (node capacity or pod readiness), but it is often a Google Cloud project quota limitation for external IP addresses.

How to eliminate wrong answers

Option A is wrong because incorrect port mapping would cause connectivity issues (e.g., timeouts or connection refused) but would not prevent the external IP from being assigned; the LoadBalancer controller would still allocate an IP. Option B is wrong because a failing readiness probe would cause the pod to be removed from the Service's endpoints, but the external IP assignment is handled by the cloud provider's load balancer controller independently of pod readiness; the IP would still be provisioned. Option D is wrong because regional clusters are the default and recommended type for GKE; they do not affect the ability to assign external IPs, and zonal clusters also support LoadBalancer Services without such delays.

309
MCQmedium

A company uses Cloud SQL for MySQL. They need to export data to Cloud Storage regularly. What is the recommended method?

A.Use Dataflow to read from Cloud SQL and write to Cloud Storage.
B.Use a cron job on Cloud SQL instance to write to Cloud Storage.
C.Use mysqldump command from a Compute Engine instance.
D.Use Cloud SQL export feature to export to Cloud Storage.
AnswerD

Cloud SQL export is the recommended method.

Why this answer

The recommended method to export data from Cloud SQL for MySQL to Cloud Storage is to use the built-in Cloud SQL export feature (Option D). This feature allows you to export data directly to Cloud Storage in formats like SQL or CSV, providing a secure and managed process without external tools. Option A (Dataflow) is not recommended for simple exports as it adds unnecessary complexity and cost.

Option B (cron job on Cloud SQL instance) is not supported; Cloud SQL does not allow running cron jobs on the instance. Option C (mysqldump from Compute Engine) is manual, requires additional security configurations, and is less efficient than the built-in export.

310
MCQhard

A team is building a mobile backend on Google Cloud using Cloud Endpoints with Firebase Authentication. They want to protect their API from abuse by implementing rate limiting per user. What approach should they take?

A.Implement rate limiting in the backend code and enforce it via Cloud Endpoints.
B.Use Apigee API Management as a proxy to enforce rate limiting per developer app.
C.Configure Cloud Armor with a rule to block requests from users exceeding a threshold.
D.Use Cloud CDN with a cache key based on the user ID.
AnswerB

Apigee can rate limit based on API keys or tokens associated with users.

Why this answer

Apigee API Management is the correct choice because it provides built-in rate limiting policies that can be enforced per developer app, which maps directly to per-user rate limiting when Firebase Authentication is used. Cloud Endpoints does not natively support per-user rate limiting; it relies on the backend to implement such logic, which is not a managed solution. Apigee acts as a proxy that can inspect the Firebase-issued JWT token to identify the user and apply rate limits accordingly, offloading this concern from the backend code.

Exam trap

Google Cloud often tests the misconception that Cloud Endpoints can handle rate limiting natively, but in reality, it only provides authentication and logging, while Apigee is the dedicated API management solution for rate limiting and monetization.

How to eliminate wrong answers

Option A is wrong because Cloud Endpoints does not provide built-in rate limiting capabilities; it only handles API management, authentication, and logging, leaving rate limiting to be implemented in the backend code, which is not a managed or scalable approach. Option C is wrong because Cloud Armor is a network security service that operates at the edge (layer 3-7) and cannot inspect per-user tokens or enforce rate limits based on user identity; it is designed for DDoS protection and IP-based rules, not per-user quotas. Option D is wrong because Cloud CDN is a content delivery network that caches responses based on cache keys, but it does not enforce rate limiting; it can only improve latency and reduce backend load, not block abusive users.

311
MCQmedium

A company is designing a real-time leaderboard for a mobile gaming application. The leaderboard must support millions of concurrent users updating their scores and querying rankings with low latency (under 100ms). Scores change frequently and require strong consistency for reads. The development team is evaluating Cloud SQL and Cloud Spanner. They estimate they need to handle 100,000 writes per second. Which database should they choose and why?

A.Cloud Firestore because it offers real-time synchronization and is serverless.
B.Cloud Bigtable because it's optimized for high write throughput and time-series data.
C.Cloud SQL with read replicas because it's cost-effective and supports ACID transactions.
D.Cloud Spanner because it provides horizontal scaling, strong consistency, and high write throughput.
AnswerD

Spanner is built for high-throughput, strongly consistent global workloads.

Why this answer

Cloud Spanner is the correct choice because it provides horizontal scaling with strong consistency and can handle 100,000 writes per second while maintaining ACID transactions and low-latency reads. Unlike Cloud SQL, Spanner scales horizontally across nodes without sacrificing consistency, making it ideal for a real-time leaderboard with millions of concurrent users.

Exam trap

The PCD exam often tests the misconception that Cloud SQL can scale writes via read replicas, but read replicas only offload read traffic, not write throughput, and Cloud SQL's single-primary architecture cannot handle 100,000 writes per second.

How to eliminate wrong answers

Option A is wrong because Cloud Firestore is a NoSQL document database optimized for mobile and web apps with real-time sync, but it does not support the required 100,000 writes per second with strong consistency for reads—it offers eventual consistency by default and has a write limit of 10,000 writes per second per database. Option B is wrong because Cloud Bigtable is optimized for high write throughput and time-series data but does not support strong consistency for reads (it provides eventual consistency) and lacks ACID transactions, which are required for a leaderboard with frequent score updates. Option C is wrong because Cloud SQL with read replicas cannot horizontally scale to 100,000 writes per second—it is limited by the primary instance's write capacity (typically up to tens of thousands of writes per second) and read replicas do not improve write throughput; additionally, strong consistency for reads would require reading from the primary, increasing latency.

312
MCQmedium

A company has an Oracle database and wants to migrate to Cloud SQL for PostgreSQL using Database Migration Service. They set up a connection profile and a continuous migration job. After the initial load, the CDC phase begins. Suddenly, the source database has a schema change (adding a column). What happens?

A.The CDC phase continues to replicate DML but may fail if the column is required
B.The migration job automatically skips the new column
C.The migration job pauses and asks for manual intervention
D.The schema change is automatically replicated to Cloud SQL
AnswerA

DMS replicates DML, but if the DDL adds a NOT NULL column, DML may fail. Manual remediation is needed.

Why this answer

DMS does not automatically replicate DDL changes. The column would be added to the source but not to the destination, potentially causing the CDC to fail due to data type mismatches.

313
MCQhard

A team is designing a Firestore database for a global mobile game. They need to support offline play and sync data when the device is online. Which Firestore feature enables offline sync?

A.Security Rules
B.Real-time listeners
C.Datastore mode
D.Offline persistence
AnswerD

Firestore SDKs cache data locally and sync changes when online.

Why this answer

Firestore provides persistent offline data access for mobile/web apps via built-in offline support in the client SDKs, enabling sync when connectivity returns.

314
Multi-Selecthard

A company is migrating an Oracle database to Cloud SQL for PostgreSQL using Database Migration Service (DMS). During the full dump phase, the migration fails with an error stating that the source database user does not have sufficient privileges. Which THREE privileges are required for the DMS user on the Oracle source? (Choose three.)

Select 3 answers
A.CREATE SESSION
B.EXECUTE on DBMS_FLASHBACK
C.CREATE TABLE
D.SELECT on V$LOG, V$LOGFILE, V$DATABASE
E.SELECT ANY TABLE
AnswersB, D, E

Correct. The DMS user needs EXECUTE privilege on the DBMS_FLASHBACK package to use Oracle Flashback Query for consistent snapshot and change data capture.

Why this answer

Database Migration Service (DMS) for Oracle to Cloud SQL for PostgreSQL uses Oracle Flashback technology to capture consistent change data during the migration. The DMS user must have the EXECUTE privilege on the DBMS_FLASHBACK package to enable Flashback Query operations, which are essential for reading the source database in a transactionally consistent state without blocking writes.

Exam trap

Google Cloud often tests the misconception that only SELECT ANY TABLE and basic session privileges are sufficient, but candidates forget that DMS requires specific system view access and the DBMS_FLASHBACK package execution privilege for consistent snapshot and CDC operations.

315
MCQhard

A company running a high-traffic e-commerce platform on Google Cloud experiences occasional data loss in their Cloud SQL database during failover events. The database is configured with a failover replica in a different zone. What is the most likely cause of the data loss?

A.Automated backups are not enabled.
B.The database is using asynchronous replication to the failover replica.
C.The failover replica is configured as a read replica instead of a failover replica.
D.The database is not using regional persistent disks.
AnswerB

Asynchronous replication may not have replicated the most recent transactions before failover.

Why this answer

Cloud SQL uses synchronous replication for failover replicas by default, ensuring that transactions are committed on both the primary and the replica before acknowledging the write. If asynchronous replication is configured, the replica may lag behind the primary, and during a failover, any transactions not yet replicated are lost. This is the most likely cause of data loss during failover events.

Exam trap

The PCD exam often tests the distinction between synchronous and asynchronous replication in the context of failover replicas, where candidates mistakenly assume all replicas are synchronous by default or confuse failover replicas with read replicas.

How to eliminate wrong answers

Option A is wrong because automated backups are for point-in-time recovery and do not affect data loss during failover events; they are unrelated to replication consistency. Option C is wrong because a read replica cannot be promoted to a primary during failover; the question specifies a failover replica is configured, so this misconfiguration would prevent failover entirely, not cause data loss. Option D is wrong because regional persistent disks provide zonal redundancy for storage, but Cloud SQL failover replicas already use separate zones; the data loss is due to replication lag, not disk durability.

316
MCQeasy

A company needs to perform complex transformations and join data from Cloud SQL, Cloud Storage, and Pub/Sub to load into BigQuery. Which Google Cloud service is designed for this ETL/ELT workload?

A.Cloud Functions
B.Cloud Run
C.Dataproc
D.Dataflow
AnswerD

Dataflow is a fully managed, serverless service for stream and batch data processing, ideal for complex ETL across databases, storage, and streaming.

317
MCQmedium

Refer to the exhibit. A Cloud Build pipeline that deploys a Cloud Run service fails with the above error. The Cloud Build service account has the roles/run.admin role at the project level. What is the most likely cause?

A.The service account used by Cloud Build does not have the Cloud Run Invoker role.
B.The Cloud Run service was deleted manually before the pipeline ran.
C.The Cloud Run API is not enabled in the project.
D.The region specified in the deploy step does not have Cloud Run enabled.
AnswerC

Correct. The API must be enabled for any Cloud Run operations to succeed.

Why this answer

The error message indicates that Cloud Run is not available, which typically occurs when the Cloud Run API has not been enabled in the project. Without the API enabled, any attempt to deploy a Cloud Run service via Cloud Build will fail, regardless of the service account's IAM roles. Enabling the API is a prerequisite for using Cloud Run resources.

Exam trap

The PCD exam often tests the distinction between IAM permissions (roles) and API enablement, trapping candidates who assume that granting a role automatically enables the underlying service API.

How to eliminate wrong answers

Option A is wrong because the Cloud Run Invoker role (roles/run.invoker) is only required for invoking (accessing) a deployed Cloud Run service, not for deploying it; the deploy operation requires roles/run.admin, which the service account already has. Option B is wrong because if the Cloud Run service was deleted manually, the pipeline would fail with a 'not found' error (HTTP 404), not with an error indicating that Cloud Run is not available or the API is disabled. Option D is wrong because Cloud Run is a global service; while regions can be restricted by organization policies, the error message shown in the exhibit does not mention region-specific unavailability, and the default behavior is that Cloud Run is available in all supported regions once the API is enabled.

318
MCQeasy

A development team is deploying a new application on Cloud Run. They anticipate unpredictable traffic patterns and want to minimize cold start latency. They also need to ensure that the application can handle sudden spikes without request drops. Which configuration should they use?

A.Use App Engine Standard Environment with automatic scaling.
B.Set min-instances to a non-zero value to keep some instances warm, and enable CPU always-on.
C.Set min-instances to 0 and max-instances to a high number to allow scaling from zero.
D.Use Cloud Functions instead of Cloud Run for better cold start performance.
AnswerB

Min-instances keeps containers warm; CPU always-on prevents cold start latency.

Why this answer

Setting min-instances to a non-zero value ensures that Cloud Run always keeps at least that many instances warm, eliminating cold starts for baseline traffic. Enabling CPU always-on prevents the instance's CPU from being throttled to zero when idle, allowing the instance to handle incoming requests immediately without a cold start penalty. This combination minimizes latency for unpredictable traffic and ensures capacity to absorb sudden spikes without dropping requests.

Exam trap

The PCD exam often tests the misconception that setting min-instances to 0 is acceptable for minimizing cold starts, or that switching to a different serverless product like Cloud Functions inherently solves cold start issues, when in fact the correct approach is to keep instances warm with min-instances and CPU always-on.

How to eliminate wrong answers

Option A is wrong because App Engine Standard Environment with automatic scaling does not provide the same fine-grained control over minimum instances and CPU always-on as Cloud Run, and it can still experience cold starts when scaling from zero. Option C is wrong because setting min-instances to 0 allows instances to scale down to zero, which guarantees cold starts on every new request after idle periods, directly contradicting the requirement to minimize cold start latency. Option D is wrong because Cloud Functions also suffers from cold starts (often worse than Cloud Run) and does not offer a min-instances or CPU always-on feature to keep instances warm; the recommendation to switch to Cloud Functions would not solve the cold start problem.

319
MCQhard

An engineer is designing a Cloud Spanner schema for a social media application. The Users table and the Posts table have a parent-child relationship. To optimize read performance for fetching all posts of a user, which schema design approach should be used?

A.Denormalize by storing post data as a repeated field in Users table
B.Use a local secondary index on user_id in the Posts table
C.Use interleaved tables with Users as parent and Posts as child
D.Create a global secondary index on user_id in the Posts table
AnswerC

Interleaving stores child rows with the parent row, minimizing cross-split reads and improving performance.

Why this answer

Interleaved tables store child rows (Posts) with their parent row (User) in the same split, enabling locality and faster joins. Global or local indexes are separate structures.

320
Multi-Selectmedium

A company uses Firestore in Native mode for a mobile app. They need to enforce security rules to allow users to read and write only their own data. Which TWO steps are required? (Select TWO.)

Select 2 answers
A.Write a security rule that checks if request.auth.uid == resource.data.user_id
B.Enable Datastore mode instead of Native mode
C.Assign the roles/datastore.user IAM role to each user
D.Ensure the app passes the user's UID in the document's user_id field
E.Create a composite index on user_id and timestamp
AnswersA, D

This rule ensures the authenticated user can only access documents where user_id matches their UID.

Why this answer

Firestore Security Rules use the request.auth object to identify the user. Use resource.data.user_id to match the document's owner field. The rules must check request.auth.uid against the document's field.

Configuring IAM roles at the project level is not granular enough. Enabling Datastore mode changes the API.

321
Multi-Selectmedium

A company is migrating a MySQL database to Cloud SQL for MySQL. They want to use Flyway for versioned schema migrations in CI/CD. Which TWO commands are part of a typical Flyway migration workflow?

Select 2 answers
A.flyway undo
B.flyway clean
C.flyway migrate
D.flyway validate
E.flyway repair
AnswersC, D

Applies pending migrations to the database.

Why this answer

Flyway uses 'migrate' to apply pending migrations and 'validate' to verify the schema state. These are core commands in CI/CD pipelines.

322
MCQeasy

A company wants to deploy a non-relational database for a real-time bidding application that requires low latency (under 10ms) and high throughput (millions of requests per second). The data model is key-value with a timestamp component. Which Google Cloud database is most appropriate?

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

Bigtable excels at high-throughput, low-latency key-value access.

Why this answer

Cloud Bigtable is designed for high-throughput, low-latency key-value workloads with time-series data, such as real-time bidding.

323
Multi-Selectmedium

Which TWO capabilities does Cloud Service Mesh (Istio) provide to help monitor application performance? (Select exactly 2.)

Select 2 answers
A.Legacy Cloud Logging agent integration for container logs.
B.Custom Prometheus exporter deployment for each microservice.
C.Automatic generation of HTTP request metrics (e.g., request count, latency, error rate) per service.
D.Cloud Endpoints API management with key validation.
E.Distributed tracing propagation and span generation without application changes.
AnswersC, E

Collects metrics for each service proxy.

Why this answer

Cloud Service Mesh (Istio) automatically generates HTTP request metrics such as request count, latency, and error rate for every service in the mesh. This is achieved through Envoy sidecar proxies that intercept all traffic and export standardized telemetry without requiring any application code changes.

Exam trap

The PCD exam often tests the distinction between automatic telemetry generation (Istio's built-in Prometheus and tracing) versus manual instrumentation or separate API management tools, leading candidates to confuse Cloud Endpoints or custom exporters with Istio's native capabilities.

324
MCQhard

An engineer is using Firestore Security Rules for a mobile app. They want to ensure that a user can only read their own documents, where each document has a field 'userId' matching the user's authenticated UID. Which rule is correct?

A.service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read: if request.auth.uid == get(/databases/$(database)/documents/$(document)).data.userId; } } }
B.service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read: if request.auth.uid == request.resource.data.userId; } } }
C.service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read: if resource.data.userId == request.auth.uid; } } }
D.service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read: if request.auth.uid == resource.data['user-id']; } } }
AnswerC

This rule allows read access if the document's userId field matches the authenticated user's UID.

Why this answer

Firestore Security Rules use the `request.auth.uid` variable to get the authenticated user's UID and `resource.data.userId` to access the document field. The correct condition checks that the document's 'userId' equals the requester's UID. `request.resource` refers to incoming data, not existing data.

325
Multi-Selecthard

You are designing a serverless application using Cloud Functions that processes events from Cloud Storage and Cloud Pub/Sub. The function must be idempotent and handle duplicate events. Which three best practices should you implement? (Choose THREE.)

Select 3 answers
A.Generate a unique idempotency key for each event and store processed keys in a database.
B.Invoke the function synchronously to avoid duplicates.
C.Implement a deduplication logic that checks the event's publish time against a threshold.
D.Use Cloud Firestore to record the state of each processed event.
E.Set the function timeout to maximum (540 seconds) to ensure processing completes.
AnswersA, C, D

Idempotency keys prevent duplicate processing.

Why this answer

Generating a unique idempotency key for each event and storing processed keys in a database (such as Cloud Firestore) ensures that if the same event is delivered multiple times (e.g., due to at-least-once delivery semantics in Cloud Pub/Sub or Cloud Storage notifications), the function can check the key before processing and skip duplicates. This pattern is essential for idempotent serverless functions, as Cloud Functions may be retried on failure or receive duplicate events from the source.

Exam trap

The trap here is that candidates often confuse timeout settings or synchronous invocation with duplicate prevention, but neither addresses the root cause of duplicate events from at-least-once delivery systems. In Google Cloud, Cloud Functions may receive duplicate events from Cloud Storage notifications or Pub/Sub, making idempotency keys and state tracking essential.

326
MCQmedium

A developer is building a Cloud Pub/Sub-based event-driven system. They need to ensure that messages are processed at least once, and they want to handle processing failures. What should they do?

A.Use pull subscriptions with auto-acknowledgment
B.Configure max delivery attempts on the subscription
C.Use Cloud Tasks instead of Pub/Sub
D.Use push subscriptions with a dead-letter topic
AnswerD

Push subscriptions with a dead-letter topic provide retries and failure handling.

Why this answer

Using push subscriptions with a dead-letter topic ensures at-least-once delivery and provides a mechanism to handle processing failures. When a push subscription fails to deliver a message (e.g., due to a downstream error), Pub/Sub automatically retries delivery. After exhausting the maximum delivery attempts (default 5), the message is forwarded to a dead-letter topic, where it can be analyzed or reprocessed without losing the message.

This guarantees that every message is either processed successfully or stored for manual intervention, satisfying the at-least-once requirement.

Exam trap

The PCD exam often tests the misconception that simply increasing delivery attempts (Option B) is sufficient for failure handling, but the trap is that without a dead-letter topic, messages are permanently lost after the final attempt, violating the at-least-once requirement.

How to eliminate wrong answers

Option A is wrong because auto-acknowledgment (i.e., acknowledging immediately upon receipt) can cause messages to be lost if processing fails after acknowledgment, violating the at-least-once guarantee. Option B is wrong because configuring max delivery attempts on the subscription alone does not handle failures; without a dead-letter topic, messages that exceed the max attempts are simply dropped and lost. Option C is wrong because Cloud Tasks is designed for HTTP-based task execution with at-least-once delivery, but it lacks the native dead-lettering and pub-sub decoupling that Pub/Sub provides for event-driven systems; using Cloud Tasks would introduce unnecessary complexity and not directly address the failure handling requirement as effectively as a dead-letter topic.

327
MCQhard

An organization has Cloud Bigtable for real-time ad serving and BigQuery for analytics. They want to synchronize data changes from Bigtable to BigQuery every hour with a Dataflow pipeline. However, they notice that some updates are missed. What is the most likely cause?

A.The Dataflow pipeline reads from Bigtable using a snapshot read
B.Bigtable does not support change data capture natively
C.The Bigtable table has no primary key
D.The Dataflow pipeline is using the wrong sink
AnswerB

Without change streams, Dataflow cannot see intermediate updates; only the latest state is visible.

Why this answer

Bigtable does not have built-in change data capture (CDC) like some databases. Dataflow can read Bigtable snapshots but not incremental changes unless using Dataflow's streaming insert, which is not native. The common approach is to use Bigtable replication or export, but missed updates often occur because Bigtable does not log changes.

A custom solution using Cloud Bigtable change streams (beta) or using a separate logging table is needed.

328
MCQhard

An organization is migrating a large Oracle database to Cloud SQL for PostgreSQL using Ora2Pg. They have complex PL/SQL packages with overloaded procedures. What is the correct approach to handle these packages in PostgreSQL?

A.Convert each Oracle package to a PostgreSQL schema containing the procedures and functions as individual objects.
B.Convert each package to a single PostgreSQL function containing all logic, using conditional logic to mimic overloaded procedures.
C.Keep the packages as is; PostgreSQL supports packages natively.
D.Use Oracle compatibility mode in PostgreSQL to enable package support.
AnswerA

Schemas are the PostgreSQL equivalent of packages. Each package becomes a schema, and procedures become functions within that schema.

Why this answer

PostgreSQL does not have packages. The recommended approach is to map each Oracle package to a separate schema containing the package's procedures and functions as top-level objects. Overloaded procedures can be handled by creating separate functions with different names or using default parameters.

Ora2Pg can automate much of the conversion but manual review is needed.

329
MCQmedium

The alert is not firing even though error_count metric occasionally spikes above 10. What is the most likely reason?

A.The aggregations are incorrect; should use REDUCE_MAX.
B.The filter specifies gke_container but the metric might be from other resources.
C.The duration of 300s means the condition must remain >10 for 5 minutes, so brief spikes do not trigger.
D.The comparison should be COMPARISON_GT_OR_NAN.
AnswerC

The duration parameter requires the threshold to be exceeded continuously for 300 seconds.

Why this answer

The alert condition is configured with a duration of 300 seconds (5 minutes), meaning the error_count metric must remain above 10 for the entire 5-minute window before the alert fires. Brief, transient spikes that exceed 10 but do not persist for the full duration will not trigger the alert, which is the most likely reason the alert is not firing despite occasional spikes.

Exam trap

The PCD exam often tests the distinction between 'threshold violation' and 'duration-based alerting' — candidates mistakenly think any breach of the threshold triggers an alert, but the duration parameter requires sustained violation over the specified window.

How to eliminate wrong answers

Option A is wrong because REDUCE_MAX is not a valid aggregation type in Google Cloud Monitoring; the correct aggregation for detecting spikes is typically REDUCE_MAX or REDUCE_COUNT, but the issue here is not about aggregation but about the duration window. Option B is wrong because the filter specifies gke_container, and if the metric were from other resources, the alert would simply not match any data, but the question states the metric occasionally spikes above 10, implying data is present. Option D is wrong because COMPARISON_GT_OR_NAN would treat missing data as exceeding the threshold, which could cause false positives, not prevent alerts from firing; the current comparison is likely COMPARISON_GT, which is correct for this scenario.

330
MCQhard

A company runs a multi-service application on GKE and wants to create a Service Level Indicator (SLI) for request latency. They have set up Cloud Service Mesh (Anthos Service Mesh) with Istio. Which metric should they use for the SLI?

A.istio_request_duration_milliseconds_bucket metric from Cloud Monitoring.
B.Custom metric exported by the application using OpenTelemetry.
C.Cloud Trace latency distribution from traces.
D.Cloud HTTP Load Balancer latency metric.
AnswerA

Built-in Istio metric for latency SLI.

Why this answer

`istio_request_duration_milliseconds_bucket` is a native Istio metric automatically exported by Cloud Service Mesh (Anthos Service Mesh) to Cloud Monitoring. It provides a histogram of request latencies, which is the standard data source for building a latency-based SLI (e.g., the proportion of requests under a threshold). This metric is pre-configured and requires no custom instrumentation, making it the most direct and reliable choice for an SLI in this environment.

Exam trap

The trap here is that candidates often confuse the load balancer latency metric (Option D) as the correct choice because it is a common SLI for external-facing services, but for a multi-service application inside GKE with Cloud Service Mesh, the correct metric must come from the service mesh itself to capture true request latency between services.

How to eliminate wrong answers

Option B is wrong because while custom metrics via OpenTelemetry can be used for SLIs, they require additional application-level instrumentation and are not the default or recommended approach when Cloud Service Mesh already provides the exact latency metric needed. Option C is wrong because Cloud Trace provides latency distributions from sampled traces, not a continuous, aggregated histogram suitable for a precise SLI calculation; it is designed for debugging, not for service-level monitoring. Option D is wrong because the Cloud HTTP Load Balancer metric measures latency at the load balancer level, which includes network overhead and does not reflect the actual request latency inside the GKE service mesh, leading to an inaccurate SLI.

331
Multi-Selectmedium

Which THREE components are essential for a complete application performance monitoring (APM) solution on Google Cloud?

Select 3 answers
A.Cloud Scheduler for job scheduling.
B.Cloud Monitoring for metrics and alerting.
C.Cloud Trace for request tracing.
D.Cloud CDN for content caching.
E.Cloud Logging for log aggregation and analysis.
AnswersB, C, E

Core component for metrics and alerts.

Why this answer

Cloud Monitoring is essential for an APM solution because it provides metrics, dashboards, and alerting policies to track application health and performance. It integrates with other services like Cloud Trace and Cloud Logging to offer a unified observability platform, enabling proactive detection of issues such as latency spikes or error rate increases.

Exam trap

The PCD exam often tests the distinction between operational tools (like Cloud Scheduler or Cloud CDN) and observability tools, leading candidates to mistakenly include services that manage tasks or optimize delivery rather than monitor performance.

332
MCQmedium

A company wants to run HTAP workloads on a PostgreSQL-compatible database with a built-in columnar engine for faster analytics on transactional data. Which Google Cloud database should they choose?

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

AlloyDB is PostgreSQL-compatible with a columnar engine, ideal for HTAP workloads.

Why this answer

AlloyDB is a PostgreSQL-compatible database that includes a columnar engine for analytics, providing up to 4x faster OLTP than Cloud SQL PostgreSQL and is designed for hybrid HTAP workloads.

333
Multi-Selecteasy

A startup is migrating a 100 GB PostgreSQL database from a self-managed VM to Cloud SQL. They want zero downtime during cutover. Which TWO features of Database Migration Service should they use?

Select 2 answers
A.Promote the Cloud SQL replica to standalone instance for cutover.
B.Use Cloud SQL Auth Proxy for source connectivity.
C.Continuous migration job with change data capture (CDC).
D.Use VPC peering to connect source to Cloud SQL.
E.One-time migration job.
AnswersA, C

Promoting the replica makes it the new primary, completing the cutover with minimal downtime.

Why this answer

Continuous migration with CDC enables cutover with minimal downtime. Promoting the replica is the final step to make Cloud SQL the primary with zero downtime.

334
MCQhard

A company is migrating an on-premises PostgreSQL database to Cloud SQL for PostgreSQL using Database Migration Service (DMS). During the continuous migration phase, the source database has high write throughput, and the DMS job is falling behind. The replication lag is increasing over time. What should the engineer do to reduce lag?

A.Change the source database to use synchronous replication with DMS
B.Reduce the maximum WAL size (max_wal_size) on the source to generate smaller logs
C.Increase the wal_keep_segments parameter on the source and enable parallel apply on the destination Cloud SQL instance
D.Increase the maintenance_work_mem parameter on the source database
AnswerC

Higher wal_keep_segments retains more WAL for DMS to read; parallel apply speeds up replication on the destination.

Why this answer

Increasing wal_keep_segments on the source ensures that more WAL segments are retained, preventing DMS from failing to fetch required logs due to premature cleanup. Enabling parallel apply on the Cloud SQL destination allows multiple transactions to be applied concurrently, reducing the time needed to catch up with the source's high write throughput.

Exam trap

Candidates may mistakenly believe that increasing max_wal_size or changing replication modes will reduce replication lag in Cloud SQL DMS. The correct approach is to ensure sufficient WAL retention on the source (by increasing wal_keep_segments) and to enable parallel apply on the destination to speed up transaction processing.

How to eliminate wrong answers

Option A is wrong because DMS uses logical replication, not synchronous replication; changing to synchronous replication would require modifying the source's replication mode, which is not supported by DMS and would increase latency on the source. Option B is wrong because reducing max_wal_size would cause more frequent WAL segment switches and potential premature removal of segments, worsening replication lag rather than reducing it. Option D is wrong because maintenance_work_mem affects maintenance operations like VACUUM and index creation, not replication throughput or WAL handling.

335
Multi-Selectmedium

A company is using Cloud Bigtable for a high-throughput write workload. They notice periodic latency spikes. Which two metrics should they monitor to diagnose the issue? (Choose two.)

Select 2 answers
A.Disk bytes used
B.Network throughput
C.Error count
D.Request latency
E.CPU utilization
AnswersC, D

Error count (e.g., deadline exceeded) indicates issues causing latency spikes.

Why this answer

Request latency directly measures performance. Error count indicates failures or throttling. CPU utilization and disk usage are less direct indicators for write spikes.

However, the question asks for two metrics to diagnose latency spikes; the most relevant are request latency and error count.

336
MCQhard

A company uses Cloud SQL for MySQL and wants to achieve high availability with automatic failover across zones while minimizing data loss. Which configuration should they use?

A.Enable read replicas in different zones
B.Use external read replicas with a failover script
C.Use Cloud SQL Enterprise Plus edition
D.Configure a regional Cloud SQL instance with automatic failover
E.Enable point-in-time recovery
AnswerD

Provides zone-level failover with synchronous replication, minimal data loss.

Why this answer

A regional Cloud SQL instance with automatic failover provides synchronous replication of data between two zones within the same region, ensuring zero data loss (RPO=0) and automatic failover with minimal downtime (RTO typically under 60 seconds). This meets the requirement for high availability with automatic failover across zones while minimizing data loss.

Exam trap

The PCD exam often tests the distinction between read replicas (asynchronous, for scaling) and regional instances (synchronous, for HA), leading candidates to mistakenly choose read replicas for high availability.

How to eliminate wrong answers

Option A is wrong because read replicas are asynchronous and do not provide automatic failover; they are designed for read scaling, not high availability with automatic failover. Option B is wrong because external read replicas require manual failover scripting and introduce latency and complexity, and they cannot guarantee minimal data loss due to asynchronous replication. Option C is wrong because Cloud SQL Enterprise Plus edition is a pricing tier that offers improved performance and availability features, but it does not itself enable regional failover; you must still configure a regional instance.

Option E is wrong because point-in-time recovery (PITR) is a backup feature for recovering to a specific timestamp, not a mechanism for automatic failover or high availability.

337
MCQhard

A multi-region application uses Cloud Spanner. The team needs to ensure that a write is immediately visible to all subsequent reads, even those performed in different regions. Which consistency mode should they use?

A.Eventual consistency
B.Global consistency
C.Bounded staleness
D.Strong consistency
AnswerD

Cloud Spanner offers strong consistency by default, ensuring all reads reflect the most recent write.

Why this answer

Strong consistency (D) ensures that once a write is acknowledged, any subsequent read, regardless of region, will reflect that write. Cloud Spanner uses the TrueTime API and Paxos-based replication to provide external consistency (a form of strong consistency) across regions, making it the correct choice for immediate global visibility.

Exam trap

The PCD exam often tests the distinction between 'strong consistency' and 'global consistency' to trap candidates who assume 'global' is a valid Spanner mode, when in fact Spanner uses 'strong' or 'external' consistency for cross-region reads.

How to eliminate wrong answers

Option A is wrong because eventual consistency allows a delay before writes are visible to all readers, which violates the requirement for immediate visibility. Option B is wrong because 'Global consistency' is not a defined consistency mode in Cloud Spanner; the correct term is 'strong consistency' or 'external consistency'. Option C is wrong because bounded staleness allows reads to see data that is up to a specified time in the past, which does not guarantee immediate visibility of the most recent write.

338
MCQmedium

Refer to the exhibit. The developer receives an error when creating the delivery pipeline. What is the most likely cause?

A.The prod target is missing a verification step.
B.The dev target has four percentages, but only two are allowed.
C.The canary percentages for the prod target do not sum to 100.
D.The pipeline name is too long.
AnswerC

The increments should sum to 100; here they sum to 90, causing validation error.

Why this answer

In a canary deployment pipeline, the percentages assigned to the canary and primary stages must sum to 100% to represent the full traffic split. If they do not sum to 100, the pipeline fails as the deployment service cannot determine how to route the remaining traffic, causing the error.

Exam trap

In Google Cloud Deploy, when configuring a canary deployment, the percentages for the canary and primary stages must sum to 100%. Candidates may overlook this validation rule and focus on unrelated details like the number of stages or pipeline name length.

How to eliminate wrong answers

Option A is wrong because the prod target does not require a verification step; verification steps are optional and their absence would not cause a pipeline creation error. Option B is wrong because the dev target can have up to four percentages (e.g., for canary stages), and there is no restriction limiting it to only two; the error is unrelated to the number of percentages. Option D is wrong because pipeline names have a character limit (typically 100 characters in AWS CodePipeline, for example), and the name shown is well within that limit, so length is not the cause.

339
MCQeasy

A database team is planning to migrate a 500 GB MySQL database to Cloud SQL. They require minimal downtime. Which Database Migration Service job type should they use?

A.One-time migration job
B.Continuous migration job
C.Cloud SQL replication from external primary
D.Bulk export and import
AnswerB

Continuous migration provides CDC for minimal downtime cutover.

Why this answer

Continuous migration job performs an initial full dump and then continuously replicates changes via CDC, allowing a near-zero downtime cutover by promoting the replica.

340
MCQhard

You want to configure Cloud SQL for MySQL with high availability (HA). The application requires that failover be automatic and that the failover replica is in a different zone within the same region. Which configuration should you use?

A.Use Cloud SQL with a cross-region replica and configure failover with gcloud
B.Enable the high availability option when creating the Cloud SQL instance
C.Set up a Cloud SQL instance with multiple read replicas and use failover via the Cloud SQL Proxy
D.Create a read replica in a different zone and configure automatic failover using a load balancer
AnswerB

Enabling HA when creating the instance automatically provisions a standby in a different zone and enables automatic failover.

Why this answer

Enabling the high availability (HA) option when creating a Cloud SQL for MySQL instance automatically provisions a standby replica in a different zone within the same region. This configuration provides automatic failover without manual intervention, meeting the requirement for HA with zone-level redundancy.

Exam trap

A common misconception is that read replicas or cross-region replicas can provide automatic failover, but only the dedicated HA option with a synchronous standby replica provides automatic, zone-isolated failover within the same region.

How to eliminate wrong answers

Option A is wrong because cross-region replicas are used for disaster recovery and read scaling, not for automatic failover within the same region; failover with gcloud would require manual steps and does not provide the automatic, zone-isolated HA required. Option C is wrong because multiple read replicas are for read scaling and do not support automatic failover; Cloud SQL Proxy is a connection proxy, not a failover mechanism. Option D is wrong because a read replica in a different zone cannot be promoted automatically for failover; Cloud SQL HA uses a synchronous standby replica, not a read replica, and a load balancer does not handle database-level failover.

341
MCQmedium

A company deploys a web app on Cloud Run and configures a custom domain mapping with a managed SSL certificate. After mapping, the domain returns 404 errors. The Cloud Run service is accessible via its default URL. What is the most likely issue?

A.The SSL certificate is not yet provisioned.
B.The Cloud Run service does not have the correct IAM permissions.
C.The DNS CNAME record is not configured correctly.
D.The domain mapping is pointing to a different Cloud Run service or region.
AnswerD

Domain mapping must match the exact service name and region.

Why this answer

The most likely issue is that the custom domain mapping is pointing to a different Cloud Run service or region. When a custom domain is mapped to Cloud Run, the DNS CNAME must point to the domain mapping's resolved target (e.g., `ghs.googlehosted.com`), not to the default Cloud Run URL. If the mapping points to a different service or region, the request reaches Cloud Run but the service cannot handle it, resulting in a 404 error from the Cloud Run frontend.

The default URL works because it bypasses the custom domain mapping and routes directly to the correct service.

Exam trap

Google often tests the distinction between DNS resolution failures (which prevent reaching the server) and HTTP-level errors (which indicate the server received the request but cannot fulfill it), leading candidates to incorrectly blame DNS when the actual issue is a misconfigured domain mapping.

How to eliminate wrong answers

Option A is wrong because a managed SSL certificate not yet provisioned would cause an SSL/TLS error (e.g., certificate not trusted or connection refused), not a 404 HTTP status code. Option B is wrong because IAM permissions control access to the Cloud Run service itself (e.g., who can invoke it), not the routing of custom domain requests; a 404 indicates the request reached Cloud Run but no matching service was found. Option C is wrong because an incorrectly configured DNS CNAME record would prevent the domain from resolving to Cloud Run at all, resulting in a DNS resolution failure or a timeout, not an HTTP 404 from the Cloud Run platform.

342
MCQmedium

A company is deploying AlloyDB for PostgreSQL in multiple regions to support disaster recovery. They need the secondary region to be able to serve reads and automatically scale read capacity. Which configuration should they use?

A.Create a primary cluster in the primary region and a primary cluster in the secondary region, then set up bidirectional replication
B.Use AlloyDB Omni in the secondary region to replicate data from the primary region
C.Create a primary cluster in the primary region and a read pool cluster in the secondary region with autoscaling enabled on the read pool
D.Create a primary cluster with multiple read pools in the same region and distribute read traffic
AnswerC

AlloyDB read pool clusters in secondary regions can serve reads and autoscale read capacity.

Why this answer

AlloyDB supports cross-region replication using read pool instances in secondary regions. These read pools can have autoscaling enabled to automatically adjust the number of nodes based on load. Primary instances are for writes only.

AlloyDB Omni is for on-premises, not cross-region replication. A single cluster with multiple read pools in the same region does not provide cross-region DR.

343
MCQmedium

You manage a global ecommerce platform using Cloud Spanner. You need to support a query that joins two tables on a foreign key relationship. The tables are parent and child in an interleaved table hierarchy. Which statement about performance is TRUE?

A.Interleaved tables cannot be joined
B.The join will be fast because interleaving stores child rows with the parent row in the same split
C.The join will be slow because interleaving increases split overhead
D.The join is only fast if you use a global secondary index
AnswerB

Interleaving ensures co-location, making joins on the parent key efficient.

Why this answer

Cloud Spanner interleaved tables physically co-locate child rows with their parent row within the same split (and often the same tablet). This means a join on the interleaved foreign key can be executed with minimal cross-node communication, as the data needed for the join is stored together, resulting in very fast query performance.

Exam trap

The trap here is that candidates may think interleaving is only for hierarchical data storage and not for query performance, or they may confuse interleaving with traditional foreign key relationships that require distributed joins.

How to eliminate wrong answers

Option A is wrong because interleaved tables can absolutely be joined; in fact, they are designed to optimize joins on the interleaved key. Option C is wrong because interleaving reduces split overhead by storing related rows together, not increasing it; splits are based on the parent key, and child rows are stored contiguously within the same split. Option D is wrong because the join is fast due to physical co-location, not because of a global secondary index; in fact, using a global secondary index could introduce additional latency if it requires cross-split lookups.

344
MCQhard

You are designing a cross-database solution where Cloud Spanner is the source of truth for transactional data. You need to stream all changes from Spanner to BigQuery for near-real-time analytics. Which approach should you use?

A.Enable Spanner change streams and read directly via Dataflow into BigQuery
B.Set up a trigger in Spanner to call a Cloud Function that inserts into BigQuery
C.Configure Datastream to connect to Spanner and replicate to BigQuery
D.Use Cloud Scheduler to periodically query Spanner for new rows and insert into BigQuery
AnswerA

Spanner change streams are designed to expose changes; Dataflow can stream them into BigQuery.

Why this answer

Spanner change streams capture row-level changes and can be routed through Pub/Sub to a Dataflow pipeline that writes to BigQuery.

345
MCQeasy

An engineer is planning a database migration and needs to assess the source database's size, schema complexity, stored procedures, and dependencies. Which activity is this part of?

A.Cutover planning
B.Schema conversion
C.Performance tuning
D.Database assessment
AnswerD

Assessment involves evaluating source database attributes to inform migration approach.

Why this answer

Migration planning includes assessing the source database to understand its characteristics and plan the migration strategy.

346
Multi-Selectmedium

A team is building a microservices architecture on Google Cloud. They want services to communicate asynchronously to avoid tight coupling. They also need to guarantee at-least-once delivery of messages. Which two services should they use together? (Choose TWO.)

Select 2 answers
A.Cloud Run (HTTP)
B.Cloud Endpoints
C.Cloud Tasks
D.Cloud Pub/Sub
E.Cloud Datastore
AnswersC, D

Cloud Tasks provides asynchronous task queues with retry and at-least-once delivery.

Why this answer

To achieve asynchronous communication with at-least-once delivery, the team should use Cloud Tasks (option C) for reliable task execution with retries and Cloud Pub/Sub (option D) for asynchronous messaging with guaranteed at-least-once delivery. Cloud Run (HTTP) is synchronous, Cloud Endpoints is an API gateway, and Cloud Datastore is a database, so none of these meet the async and delivery requirements.

347
MCQhard

An organization runs a stateful application on GKE that uses PersistentVolumes. They want to perform a rolling update of the application without disrupting the underlying persistent data. What should they use?

A.A ReplicaSet with a headless service.
B.A StatefulSet with a PersistentVolumeClaim template.
C.A DaemonSet with a PodDisruptionBudget.
D.A Deployment with a PersistentVolumeClaim template.
AnswerB

StatefulSet ensures each pod gets its own PVC and updates gracefully, preserving data.

Why this answer

A StatefulSet is the correct choice because it is designed for stateful applications that require stable, unique network identifiers and persistent storage. By including a PersistentVolumeClaim template in the StatefulSet spec, each Pod gets its own dedicated PersistentVolume that persists across rescheduling and rolling updates, ensuring data is not disrupted.

Exam trap

The PCD exam often tests the misconception that a Deployment with a PersistentVolumeClaim template can handle stateful workloads, but the trap is that Deployments treat all Pods as interchangeable and would force all Pods to share the same PVC, causing data loss or corruption during updates.

How to eliminate wrong answers

Option A is wrong because a ReplicaSet with a headless service provides stable network identities but does not manage persistent storage; it is typically used with Deployments for stateless apps. Option C is wrong because a DaemonSet ensures one Pod per node and is intended for node-level services like logging or monitoring, not for managing persistent storage with rolling updates. Option D is wrong because a Deployment with a PersistentVolumeClaim template would cause all Pods to share the same PersistentVolumeClaim, leading to data corruption or conflicts during rolling updates, as Deployments are designed for stateless workloads.

348
Multi-Selectmedium

A company is designing a polyglot persistence architecture. They need to use Cloud SQL for transactions, Bigtable for real-time analytics, and BigQuery for reporting. They also need to keep data across these systems eventually consistent. Which TWO approaches should they use?

Select 2 answers
A.Implement a saga pattern with compensating transactions for each write.
B.Use two-phase commit across all databases.
C.Use Cloud Spanner as a single database to avoid polyglot complexity.
D.Write to all three databases in a single transaction using distributed transactions.
E.Write to Cloud SQL and use Datastream to replicate changes to Bigtable and BigQuery.
AnswersA, E

Saga pattern is a standard approach for eventual consistency across polyglot stores.

349
MCQmedium

A development team wants to connect their Cloud SQL for PostgreSQL instance from a Compute Engine VM without exposing it to the public internet. They also want to avoid managing IP allowlists. Which method should they use?

A.Use Private IP only
B.Configure a public IP with SSL enforcement
C.Assign a static IP to the VM and add it to authorized networks
D.Use Cloud SQL Auth Proxy
AnswerD

Auth Proxy handles authentication and encryption, no public IP needed.

Why this answer

The Cloud SQL Auth Proxy provides secure, IAM-based access to Cloud SQL instances without requiring public IP or allowlists. It runs on the client and uses an encrypted tunnel. It works over Private IP if the VM is in the same VPC, but does not require it.

350
MCQhard

An online gaming platform uses Cloud Spanner as its globally distributed database. They notice that write latency increases significantly during peak hours. The application performs many single-row writes with high consistency requirements. Which design change would most effectively reduce write latency?

A.Increase the number of nodes in the Spanner instance.
B.Use interleaved tables to colocate related rows.
C.Switch to eventual consistency mode for writes.
D.Split the table into multiple smaller tables.
AnswerB

Interleaved tables store parent and child rows in the same split, reducing the number of participants in a transaction and decreasing write latency.

Why this answer

Interleaved tables in Cloud Spanner physically colocate parent and child rows, reducing the number of splits and cross-node round trips for related single-row writes. This minimizes distributed transaction overhead and write latency, especially under high consistency requirements, without requiring additional nodes or sacrificing consistency.

Exam trap

The trap here is that candidates often assume scaling nodes (Option A) is the universal fix for latency, but Cloud Spanner's write latency is dominated by distributed coordination, not node count, making interleaved tables a more targeted solution.

How to eliminate wrong answers

Option A is wrong because increasing nodes primarily improves read throughput and storage capacity, not write latency; in fact, more nodes can increase distributed coordination overhead for single-row writes. Option C is wrong because Cloud Spanner does not support eventual consistency for writes—it always provides strong external consistency via the TrueTime API, and switching consistency models is not a valid design change. Option D is wrong because splitting a table into multiple smaller tables does not reduce write latency; it can increase the number of distributed transactions and cross-node coordination, worsening latency.

351
MCQmedium

You need to migrate an on-premises MySQL 5.7 database (2 TB) to Cloud SQL for MySQL with minimal downtime. Database Migration Service (DMS) is chosen. What is the correct sequence of steps to ensure a successful continuous migration?

A.Set up a connection profile for the source, create a DMS migration job (full dump + CDC), monitor the initial dump, then promote the replica to complete migration.
B.Use mysqldump to export the database, import to Cloud SQL, then set up DMS for CDC only.
C.Create a DMS continuous migration job directly without a connection profile.
D.First promote the Cloud SQL replica, then create the connection profile.
AnswerA

This is the correct sequence for DMS continuous migration.

Why this answer

DMS continuous migration first performs a full dump (initial snapshot), then switches to CDC to replicate ongoing changes. After the initial dump, you validate the replica and promote it to make it the primary. The correct order: create connection profile for source, create migration job with full dump + CDC, monitor initial dump, then promote when ready.

352
MCQeasy

A team wants to use Cloud Scheduler to trigger a Cloud Function that calls an external API every hour. The Cloud Function requires an API key for the external service. How should the team securely provide the API key to the function?

A.Pass the API key as an environment variable in the function's runtime environment.
B.Store the API key in Secret Manager and access it via the Secret Manager API in the function code.
C.Hardcode the API key in the Cloud Function source code.
D.Store the key in Cloud Storage with customer-supplied encryption key (CSEK).
AnswerB

Secret Manager provides secure storage and access control for secrets.

Why this answer

Secret Manager is Google Cloud's recommended service for storing secrets like API keys. It integrates natively with Cloud Functions, allowing secure access without exposing the key in environment variables or code. Option A is insecure because environment variables can be visible in the function configuration.

Option C is insecure because hardcoding exposes the key in the source code. Option D is not the best practice; while Cloud Storage with CSEK provides encryption, it is not designed for secrets management and requires more complex access control.

353
MCQhard

You are migrating an on-premises Oracle database to Cloud SQL for PostgreSQL. You need to assess the migration feasibility and convert the schema. Which tools should you use?

A.Use mysqldump to export and import to PostgreSQL.
B.Use Ora2Pg for schema conversion and DMS for data migration.
C.Use pg_dump to export the Oracle database and import into Cloud SQL.
D.Use DMS directly with Oracle source; it automatically converts schema.
AnswerB

Ora2Pg converts Oracle schema to PostgreSQL; DMS performs the data migration with CDC.

Why this answer

Ora2Pg is an open-source tool that converts Oracle schema to PostgreSQL. Database Migration Service (DMS) supports migration from Oracle to Cloud SQL for PostgreSQL. For assessment, you can use tools like Oracle Migration Toolkit or Ora2Pg's assessment mode.

354
MCQmedium

A company is using Cloud Spanner for a global user database. They need to read recent orders for a user with strong consistency. The application currently uses stale reads with a max staleness of 10 seconds. Some users see inconsistent data. What is the BEST approach to guarantee strong consistency without significantly impacting latency?

A.Use global secondary indexes with STORING clause
B.Use strong reads with a read timestamp
C.Use mutations API instead of DML
D.Reduce max staleness to 1 second
AnswerB

Strong reads with a read timestamp provide consistent data at a point in time, guaranteeing strong consistency.

Why this answer

Strong reads with a read timestamp ensure the most recent data. Bounded staleness is a weaker consistency model. Using DML or mutations does not affect read consistency.

355
MCQeasy

A mobile application developer needs a serverless NoSQL database that supports offline data synchronization across devices and real-time updates. Which Google Cloud database service should they use?

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

Firestore is a serverless NoSQL document database with offline support, real-time listeners, and security rules, ideal for mobile apps.

Why this answer

Firestore is a serverless, NoSQL document database that provides built-in offline data synchronization across devices and real-time updates via snapshot listeners. It automatically handles conflict resolution and data replication, making it ideal for mobile applications that need to work offline and sync when connectivity is restored.

Exam trap

The exam often tests the distinction between NoSQL databases optimized for real-time mobile sync (Firestore) versus those designed for high-throughput analytics (Bigtable) or global relational consistency (Spanner), leading candidates to choose a scalable but inappropriate service.

How to eliminate wrong answers

Option A is wrong because Cloud Bigtable is a wide-column NoSQL database designed for high-throughput analytical workloads, not for mobile apps requiring offline sync and real-time updates. Option C is wrong because Cloud SQL is a relational database service that does not support offline data synchronization or real-time updates natively. Option D is wrong because Cloud Spanner is a globally distributed relational database that provides strong consistency and horizontal scaling, but it does not offer built-in offline sync or real-time change listeners for mobile clients.

356
MCQhard

A team is using Datastream to replicate from MySQL to BigQuery. They notice that the BigQuery table is missing some updates that occurred in the source. Which is the most likely cause?

A.BigQuery does not support streaming inserts from Datastream
B.The Datastream connection profile uses read replicas that are lagging
C.The source MySQL binary log retention period is too short, causing log truncation before Datastream reads the changes
D.Cloud SQL does not support MySQL
AnswerC

If binlogs are purged before Datastream processes them, updates are lost.

Why this answer

Datastream uses transaction logs and may skip events if the source binary logs are not retained long enough, or if there is a schema mismatch.

357
Multi-Selecthard

A team is deploying a microservice application on Google Kubernetes Engine (GKE). They want to ensure high availability and minimize downtime during rolling updates. Which TWO actions should they take? (Choose two.)

Select 2 answers
A.Use Horizontal Pod Autoscaler to automatically adjust the number of pods based on CPU utilization.
B.Enable liveness probes to automatically restart pods that become unresponsive.
C.Configure pod disruption budgets to limit the number of pods that can be unavailable simultaneously.
D.Set readiness probes to ensure that pods are only considered ready when they can serve traffic.
E.Enable node auto-repair to automatically replace unhealthy nodes.
AnswersC, D

Correct: Pod disruption budgets help maintain availability during voluntary disruptions like rolling updates.

Why this answer

PodDisruptionBudgets (PDBs) allow you to specify the minimum number of pods that must remain available during voluntary disruptions like rolling updates, ensuring high availability. Option D is correct because readiness probes control when a pod is added to a Service's endpoints; during rolling updates, they prevent traffic from being sent to a pod until it is ready, minimizing downtime.

Exam trap

The PCD exam often tests the distinction between liveness and readiness probes, and candidates mistakenly choose liveness probes (Option B) for availability during updates, but readiness probes are the correct choice for controlling traffic flow during rolling updates.

358
MCQhard

You are designing a Bigtable row key for an IoT telemetry application that writes one row per device per minute. Devices are identified by a 12-character device ID. To avoid write hotspots, which row key design is most appropriate?

A.Row key: timestamp + deviceID (e.g., '2024-03-15T10:30:00#abc123')
B.Row key: deviceID + timestamp (e.g., 'abc123#2024-03-15T10:30:00')
C.Row key: hash(deviceID) + deviceID + timestamp
D.Row key: reversed deviceID + timestamp (e.g., '321cba#2024-03-15T10:30:00')
AnswerD

Reversing the device ID randomizes the prefix, distributing writes across tablets. Timestamp suffix still allows range scans.

Why this answer

To distribute writes evenly across Bigtable tablets, the row key should have a non-monotonic prefix. Reversing the device ID (or salting) helps. Field promotion is not needed here.

359
Multi-Selecthard

A financial services company is migrating a globally distributed trading application to Cloud Spanner. They need strong consistency and low-latency reads across regions. Which THREE configurations should they choose? (Select THREE.)

Select 3 answers
A.Use stale reads with bounded staleness
B.Use interleaved tables for related data
C.Multi-region instance configuration
D.Use strong reads (read timestamp set to now)
E.Regional instance configuration to reduce latency
AnswersB, C, D

Interleaving reduces round-trips for parent-child queries, improving latency.

Why this answer

Interleaved tables physically co-locate parent and child rows in Cloud Spanner, enabling efficient joins and low-latency reads for related data. This is critical for a globally distributed trading application that requires strong consistency and fast access to hierarchical data, such as orders and their line items, without cross-node coordination.

Exam trap

Google Cloud Spanner often tests the misconception that stale reads can provide both strong consistency and low latency, but in Cloud Spanner, only strong reads (with timestamp set to now) guarantee strong consistency, while stale reads are designed for eventual consistency use cases.

360
MCQhard

You are designing a Cloud Spanner schema for a global user profile table. User IDs are integers from a sequence. You need to avoid hot spots during writes. Which primary key design is best?

A.Use a composite primary key: (HashPrefix(UserId), UserId) where HashPrefix is from a small set
B.Use a UUID as the primary key
C.Use the sequential integer user ID alone as the primary key
D.Use a timestamp as the primary key
AnswerA

Adding a hash prefix distributes writes across splits, reducing hot spots. This is a recommended pattern.

Why this answer

Using a composite key with a hash prefix spreads writes across splits evenly. Sequential integer keys cause hot spots on the last split.

361
MCQmedium

A corporation needs to back up its Cloud Spanner database for disaster recovery. They require the ability to restore to a specific point in time within the last 7 days. What backup strategy should they implement?

A.Use Cloud Scheduler to run incremental backups daily.
B.Enable cross-region replicas and restore from the replica.
C.Export the database to Cloud Storage every hour using Dataflow.
D.Use Spanner's built-in point-in-time recovery (PITR) which retains versions for 7 days.
AnswerD

Spanner PITR allows you to query or restore data as of any time within the retention window (1-7 days).

Why this answer

Cloud Spanner supports full database backups exported to Avro in Cloud Storage. Incremental backups are not supported natively; point-in-time recovery is achieved via versioning (up to 7 days) but backups are full. For granular recovery, you can use the built-in versioning or schedule frequent exports.

362
Multi-Selectmedium

Which TWO of the following are best practices when deploying applications on Google Kubernetes Engine (GKE)?

Select 2 answers
A.Store sensitive configuration data in environment variables.
B.Skip liveness and readiness probes for stateless applications.
C.Use pod anti-affinity to spread pods across nodes.
D.Define resource requests and limits for all containers.
E.Use the default Compute Engine service account for pods.
AnswersC, D

Improves availability by distributing replicas.

Why this answer

Pod anti-affinity ensures pods are scheduled across different nodes, improving fault tolerance and high availability. This is a best practice for stateless applications to avoid a single point of failure during node failures. Option D is correct because defining resource requests and limits allows the Kubernetes scheduler to make informed placement decisions and prevents resource starvation, ensuring predictable application performance.

Exam trap

Google Cloud often tests the misconception that liveness and readiness probes are optional for stateless workloads, but in GKE they are critical for self-healing and traffic management, even for stateless applications.

363
MCQhard

Your organization uses Cloud Functions (1st gen) to process events from Cloud Storage. Recently, you migrated to Cloud Functions (2nd gen) to take advantage of longer timeouts and concurrency. After the migration, some invocations fail with 'DeadlineExceeded' errors even though the total execution time is below the 60-minute limit. What is the most likely cause?

A.The function does not have enough memory allocated for the new workload
B.The function is processing multiple concurrent requests per instance, causing a single request to exceed the HTTP timeout due to contention
C.The function is being cold-started more frequently due to reduced min instances
D.The function timeout is still set to the 1st gen default of 9 minutes
AnswerB

2nd gen enables concurrency; if function code is not thread-safe or uses blocking operations, concurrent requests can cause delays.

Why this answer

Cloud Functions (2nd gen) supports concurrent request processing per instance. When multiple requests are handled simultaneously by the same instance, they share the instance's resources, including the HTTP timeout. If one request consumes excessive time due to contention (e.g., waiting for CPU or I/O), other concurrent requests may hit the HTTP request timeout (default 60 minutes for 2nd gen) even if their individual execution time is shorter.

This is a common issue when migrating from 1st gen (which processes one request at a time) to 2nd gen with concurrency enabled.

Exam trap

The PCD exam often tests the misconception that 'DeadlineExceeded' errors are always due to the function timeout setting, but here the trap is that the error arises from concurrent request contention within a single instance, not from an insufficient timeout value.

How to eliminate wrong answers

Option A is wrong because insufficient memory typically causes out-of-memory errors or performance degradation, not 'DeadlineExceeded' errors, which are timeout-related. Option C is wrong because cold starts affect initial latency but do not cause 'DeadlineExceeded' errors for requests that are already running; cold starts may increase latency but not exceed the 60-minute timeout. Option D is wrong because Cloud Functions (2nd gen) has a maximum timeout of 60 minutes by default, and the question states the total execution time is below that limit, so the timeout setting is not the issue; the error is due to concurrent request contention, not a misconfigured timeout.

364
MCQmedium

A company is using Cloud Bigtable for ad tech data. They have a single table with a column family containing frequently accessed columns and another with rarely accessed columns. To optimize performance, what column family design change should they implement?

A.Move rarely accessed columns to a different table
B.Combine all columns into one column family
C.Use a single column family and set garbage collection to delete rarely accessed columns
D.Move frequently accessed columns to a separate column family
AnswerD

This allows reading only the hot column family, reducing I/O and improving latency.

Why this answer

Separating frequently accessed columns into their own column family reduces the amount of data read per request, improving performance.

365
MCQmedium

A startup is building a social media application with a global user base. They need a database that can handle millions of concurrent users, provide strong consistency, and scale horizontally. They expect high write throughput and need to run complex SQL queries. Which database is most suitable?

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

Spanner offers horizontal scaling, strong consistency, and full SQL support, suitable for global high-write applications.

Why this answer

Cloud Spanner is the only GCP database that provides horizontal scaling, strong consistency, and SQL capabilities for high write throughput globally.

366
MCQmedium

A company runs a stateful application on Compute Engine instances with persistent disks. The application must be highly available and be able to recover from a zonal failure with minimal data loss. The current architecture uses a single instance in one zone. Which design should the team implement?

A.Use a standard persistent disk and configure a global load balancer to failover.
B.Create a snapshot schedule and restore the snapshot to a new instance in another zone on failure.
C.Use a regional persistent disk attached to a managed instance group across two zones.
D.Migrate to Cloud Filestore for shared file storage across zones.
AnswerC

Regional persistent disks replicate synchronously across zones, enabling fast failover.

Why this answer

A regional persistent disk synchronously replicates data across two zones, and when attached to a managed instance group (MIG) spanning those zones, it provides automatic failover with minimal data loss. This design ensures that if one zone fails, the MIG can detach the disk from the failed instance and attach it to a healthy instance in the surviving zone, preserving state with near-zero RPO.

Exam trap

The trap here is that candidates often confuse high availability with backup strategies (snapshots) or assume that a load balancer alone can handle storage failover, failing to recognize that stateful applications require synchronous data replication across zones to achieve minimal data loss.

How to eliminate wrong answers

Option A is wrong because a standard persistent disk is zonal, not regional, and a global load balancer alone cannot failover the disk or its data; the load balancer handles traffic but the disk remains tied to the original zone, so a zonal failure still causes data loss. Option B is wrong because snapshot schedules are asynchronous and point-in-time, meaning any data written between the last snapshot and the failure is lost, resulting in higher RPO than the minimal data loss requirement. Option D is wrong because Cloud Filestore is a managed NFS service designed for shared file storage, not for block-level persistent disks; it introduces network latency and does not provide the same low-level synchronous replication as a regional persistent disk, and it is not directly attachable to Compute Engine instances as a boot disk.

367
MCQmedium

A company is using Cloud Build for CI and wants to store build artifacts in Artifact Registry. They want to ensure that only successful builds are promoted to production. What should they do?

A.Use Cloud Build to deploy to a staging environment, then manually promote to production.
B.Use Cloud Build steps that push to Artifact Registry only if all previous steps succeed by using `waitFor` and checking exit codes.
C.Use Cloud Build triggers with a condition that only builds on the main branch are deployed.
D.Use Cloud Build with a custom script that pushes regardless of build status.
AnswerB

Cloud Build inherently stops on failure, ensuring only successful builds push artifacts.

Why this answer

Cloud Build steps run sequentially and only if previous steps succeed by default, so pushing to Artifact Registry only if tests pass. Option A is not sufficient because builds on main can still fail. Option C involves manual intervention.

Option D is incorrect as it ignores build status.

368
Drag & Dropmedium

Drag and drop the steps to configure a Cloud CDN with a Cloud Load Balancer 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 CDN is enabled on a backend bucket of a load balancer, then DNS is configured.

369
MCQeasy

A developer is designing a serverless event-driven application that processes messages from Pub/Sub and writes results to BigQuery. The workload is unpredictable but must scale to zero when idle. Which compute option should they choose?

A.Cloud Run with Pub/Sub push subscription
B.Cloud Functions with Pub/Sub trigger
C.Compute Engine with managed instance groups
D.Google Kubernetes Engine with Horizontal Pod Autoscaler
AnswerB

Cloud Functions is serverless, scales to zero, and has native Pub/Sub integration.

Why this answer

Cloud Functions with a Pub/Sub trigger is the correct choice because it is purpose-built for event-driven, serverless workloads that scale to zero when idle. It automatically scales from zero to thousands of concurrent invocations based on the volume of Pub/Sub messages, and it natively integrates with Pub/Sub via a background function that is invoked for each message, making it ideal for unpredictable, bursty workloads that must process messages and write results to BigQuery.

Exam trap

The PCD exam often tests the misconception that Cloud Run is always the best serverless option, but the trap here is that Cloud Functions is the native, simpler choice for pure event-driven Pub/Sub processing, while Cloud Run is better suited for HTTP request-driven workloads or when you need longer request timeouts or custom runtimes.

How to eliminate wrong answers

Option A is wrong because Cloud Run with a Pub/Sub push subscription requires a running container instance to receive push requests, and while it can scale to zero, it introduces additional latency and complexity compared to a native Pub/Sub trigger, and it is not the simplest or most cost-effective choice for a purely event-driven, message-processing workload. Option C is wrong because Compute Engine with managed instance groups requires provisioning and maintaining VMs, does not scale to zero (minimum 1 VM), and incurs costs even when idle, making it unsuitable for a serverless, scale-to-zero requirement. Option D is wrong because Google Kubernetes Engine with Horizontal Pod Autoscaler requires a running cluster with node pools, does not scale to zero (minimum 1 node), and adds operational overhead for managing Kubernetes infrastructure, which is unnecessary for a simple Pub/Sub-to-BigQuery pipeline.

370
MCQmedium

You need to deploy a critical update to a production service on GKE with zero downtime. Which deployment strategy should you use?

A.Recreate strategy
B.Blue/green deployment using a Kubernetes Service and label selector
C.Canary deployment with 10% traffic
D.Rolling update with maxSurge=25%, maxUnavailable=25%
AnswerB

Switches traffic after all new pods are healthy.

Why this answer

Blue/green deployment creates two identical environments (blue and green) and switches traffic atomically by updating the Kubernetes Service's label selector to point to the new version. This ensures zero downtime because the old version remains fully serving until the new version is verified, and traffic cutover is instantaneous with no overlapping broken requests.

Exam trap

A common pitfall on the Google PCD exam is assuming that a rolling update with maxUnavailable=0% guarantees zero downtime, but the given parameters (maxUnavailable=25%) allow some pods to be terminated before new ones are ready, risking downtime. Blue/green deployment with a Service label switch provides atomic traffic cutover with no downtime.

How to eliminate wrong answers

Option A is wrong because the Recreate strategy terminates all existing pods before creating new ones, causing downtime during the scale-down and scale-up phases. Option C is wrong because a canary deployment with 10% traffic intentionally routes a small percentage of users to the new version, which is not a zero-downtime strategy for a critical update—it is used for gradual validation and risk reduction, not immediate full cutover. Option D is wrong because a rolling update with maxSurge=25% and maxUnavailable=25% allows up to 25% of pods to be unavailable during the update, which violates the zero-downtime requirement for a critical production service.

371
MCQmedium

A company is using Cloud Bigtable for an ad-tech application with billions of ad impressions per day. They need to perform point reads on individual rows as well as scans over time ranges. Which column family design is recommended?

A.Separate frequently accessed columns into one column family and infrequently accessed into another
B.Use multiple tables for different access patterns
C.Store each column as a separate column family
D.Store all columns in a single column family for simplicity
AnswerA

This design optimizes scans and cache usage by reducing I/O.

Why this answer

To optimize performance, frequently accessed columns (e.g., for point reads) should be in a separate column family from infrequently accessed columns (e.g., audit data). This reduces the amount of data scanned during scans and improves cache efficiency.

372
MCQeasy

A data engineer wants to perform version-controlled schema migrations as part of a CI/CD pipeline for a Cloud SQL for PostgreSQL database. Which tools should they use?

A.Database Migration Service
B.gcloud sql import
C.Liquibase or Flyway
D.Cloud Build and Cloud Scheduler
AnswerC

Both are schema migration tools that support versioning, rollback, and CI/CD integration.

Why this answer

Liquibase and Flyway are industry-standard tools for version-controlled database schema migrations. They integrate with CI/CD pipelines and support PostgreSQL.

373
MCQmedium

An e-commerce platform uses Cloud Spanner for its inventory system. They notice that the processing units utilization is consistently above 90% during peak hours, causing increased read latency. They want to automatically scale capacity based on load. What should they configure?

A.Switch from processing units to nodes for better performance
B.Manually increase the number of nodes
C.Enable auto-scaling by setting min and max processing units with a high-priority CPU target
D.Reduce the number of processing units to lower cost
AnswerC

Auto-scaling adjusts processing units based on CPU utilization.

Why this answer

Cloud Spanner supports auto-scaling by configuring min and max processing units and a high-priority CPU target utilization. When utilization exceeds the target, Spanner automatically adds processing units up to the max. This is the correct approach.

374
MCQeasy

A company wants to run analytical queries across data stored in Cloud SQL (MySQL), Cloud Storage (Parquet files), and Bigtable without moving any data. Which BigQuery feature enables this?

A.BigQuery Omni
B.Cloud Data Fusion
C.BigQuery BI Engine
D.Federated queries using external tables
AnswerD

BigQuery federated queries allow querying Cloud SQL, Cloud Storage, and Bigtable directly using external tables without data movement.

375
Multi-Selectmedium

A financial services company uses BigQuery for analytics but needs to store transactional data with strong consistency and sub-millisecond latency. They are considering Cloud SQL, Cloud Spanner, Bigtable, Memorystore, and Firestore. Which service meets all requirements?

Select 1 answer
A.Cloud Spanner
B.Cloud SQL
C.Bigtable
D.Memorystore
E.Firestore
AnswersA

Cloud Spanner meets both strong consistency and sub-millisecond latency for transactional data, making it ideal for financial systems.

Why this answer

Cloud Spanner is the only Google Cloud service that provides both strong consistency and sub-millisecond latency for transactional workloads. It uses TrueTime for global strong consistency and supports ACID transactions with low latency. Cloud SQL offers strong consistency but cannot achieve sub-millisecond latency at scale due to single-region limits.

Bigtable provides low latency but only eventual consistency. Memorystore is a caching layer, not a transactional database. Firestore provides strong consistency but typically does not guarantee sub-millisecond latency for high-throughput transactional data, especially under financial workload requirements.

Exam trap

A common misconception is that Cloud SQL can meet sub-millisecond latency at scale, but candidates forget that Cloud SQL is limited by single-region deployment and cannot horizontally scale writes, making it unsuitable for high-throughput transactional systems.

Page 4

Page 5 of 13

Page 6