Google Professional Cloud Developer Practice Test 66
Question 650
Two concurrent request handlers read the same Firestore inventory document and both decrement stock below zero. The team is choosing a sustainable solution. Which design best meets the stated requirement without broad unrelated changes? Select ONE best answer.
- Filter the supported event types and authorize the routing identity for only the intended service.
- Design Bigtable row keys around anticipated access patterns and distribute high-rate writes across the keyspace.
- Combine authorized Cloud SQL connectivity with least-privilege database authentication rather than confusing transport access with SQL grants.
- Use Firestore transactions for supported coordinated document updates with retry-aware application logic.
Explanation
Correct Answer
D:Use Firestore transactions for supported coordinated document updates with retry-aware application logic. Before rollout, inspect transaction boundaries, concurrent read/write conflicts, and whether all dependent records need atomic change.
Incorrect Answers
A:Filter the supported event types and authorize the routing identity for only the intended service. This design addresses Eventarc event-type filtering and authorization, where Eventarc event filters constrain selection while destination IAM controls delivery; a matching event does not bypass invoker authorization. It cannot substitute for the required control: use Firestore transactions for supported coordinated document updates with retry-aware application logic.
B:Design Bigtable row keys around anticipated access patterns and distribute high-rate writes across the keyspace. This design addresses Bigtable row-key hotspot avoidance, where Bigtable performance depends heavily on row-key design; monotonically increasing leading keys can concentrate writes and increase hotspots. It cannot substitute for the required control: use Firestore transactions for supported coordinated document updates with retry-aware application logic.
C:Combine authorized Cloud SQL connectivity with least-privilege database authentication rather than confusing transport access with SQL grants. It cannot substitute for the required control: use Firestore transactions for supported coordinated document updates with retry-aware application logic.
Question 651
Two concurrent request handlers read the same Firestore inventory document and both decrement stock below zero. An approved limited change can be tested in a safe environment. Which implementation action most directly addresses this scenario? Select ONE best answer.
- Configure a test workload identity and a minimally privileged database user, then validate allowed and denied queries.
- Configure a test bucket's lifecycle policy and separately validate the required retention policy against sample objects.
- Instrument exceptions with useful context and verify any AI-assisted proposed fix against logs, traces, and access controls.
- Wrap stock validation and update in a transaction and test parallel competing purchases.
Explanation
Correct Answer
D:Wrap stock validation and update in a transaction and test parallel competing purchases. In this scenario, two concurrent request handlers read the same Firestore inventory document and both decrement stock below zero. Validate the change by checking that at most the permitted purchases succeed and inventory invariants remain consistent under concurrency.
Incorrect Answers
A:Configure a test workload identity and a minimally privileged database user, then validate allowed and denied queries. This action changes a different concern, Cloud SQL Auth Proxy and database authorization. It addresses a different dependency from firestore transactional document updates.
B:Configure a test bucket's lifecycle policy and separately validate the required retention policy against sample objects. This action changes a different concern, Cloud Storage lifecycle and retention controls. It addresses a different dependency from firestore transactional document updates.
C:Instrument exceptions with useful context and verify any AI-assisted proposed fix against logs, traces, and access controls. This action changes a different concern, error Reporting and AI-assisted observability. It addresses a different dependency from firestore transactional document updates.
Question 652
Two concurrent request handlers read the same Firestore inventory document and both decrement stock below zero. The team has tried a correction. Which measurable outcome most directly demonstrates that this issue is resolved? Select ONE best answer.
- At most the permitted purchases succeed and inventory invariants remain consistent under concurrency.
- Malformed messages are isolated with traceable failure evidence while valid messages continue processing.
- The application reaches the intended API in the correct project without granting broad unrelated roles.
- Successfully acknowledged messages avoid redelivery under the supported feature while repeated business operations are handled safely.
Explanation
Correct Answer
A:At most the permitted purchases succeed and inventory invariants remain consistent under concurrency. This is evidence that the particular acceptance condition for Firestore transactional document updates has been met, rather than a general availability metric. The original diagnosis should have included this step: inspect transaction boundaries, concurrent read/write conflicts, and whether all dependent records need atomic change.
Incorrect Answers
B:Malformed messages are isolated with traceable failure evidence while valid messages continue processing. That result could support testing of Pub/Sub dead-letter handling: Dead-letter routing isolates messages that exceed allowed delivery attempts; it does not itself repair invalid data or guarantee business processing. The reported condition is about firestore transactional document updates, not this adjacent change.
C:The application reaches the intended API in the correct project without granting broad unrelated roles. That result could support testing of google Cloud API enablement and service identity: Service enablement and IAM authorization are separate prerequisites for Google Cloud API calls; one does not substitute for the other. The reported condition is about firestore transactional document updates, not this adjacent change.
D:Successfully acknowledged messages avoid redelivery under the supported feature while repeated business operations are handled safely. That result could support testing of Pub/Sub exactly-once feature scope: Pub/Sub exactly-once delivery applies to supported pull subscriptions within documented scope and cannot prevent independent duplicate publishes. The reported condition is about firestore transactional document updates, not this adjacent change.
Question 653
An application updates an account and an order separately and risks leaving inconsistent business state if one write fails. Before choosing a remediation, which investigation best isolates the specific cause or unmet dependency? Select ONE best answer.
- Inspect delivery attempt counts, retry policy, dead-letter topic configuration, and failure classification.
- Inspect bucket lifecycle rules, object age, retention policy locks, and legal retention requirements.
- Inspect available language libraries, API feature coverage, authentication workflow, and transport requirements.
- Inspect transaction boundaries, concurrent read/write conflicts, and whether all dependent records need atomic change.
Explanation
Correct Answer
D:Inspect transaction boundaries, concurrent read/write conflicts, and whether all dependent records need atomic change. This checks the actual operating conditions relevant to Firestore transactional document updates, rather than changing a service before the failure is understood. A focused follow-up is to wrap stock validation and update in a transaction and test parallel competing purchases. Before choosing a remediation, which investigation best isolates the specific cause or unmet dependency.
Incorrect Answers
A:Inspect delivery attempt counts, retry policy, dead-letter topic configuration, and failure classification. Dead-letter routing isolates messages that exceed allowed delivery attempts; it does not itself repair invalid data or guarantee business processing. This is not the decisive inspection for firestore transactional document updates.
B:Inspect bucket lifecycle rules, object age, retention policy locks, and legal retention requirements. Lifecycle policies automate object management, but enforceable retention controls can prevent deletion until the obligation expires. This is not the decisive inspection for firestore transactional document updates.
C:Inspect available language libraries, API feature coverage, authentication workflow, and transport requirements. Client libraries wrap Google Cloud API transport and credentials, while documented REST and gRPC remain supported integration interfaces when applicable. This is not the decisive inspection for firestore transactional document updates.
Question 654
An application updates an account and an order separately and risks leaving inconsistent business state if one write fails. The team is choosing a sustainable solution. Which design best meets the stated requirement without broad unrelated changes? Select ONE best answer.
- Use Firestore transactions for supported coordinated document updates with retry-aware application logic.
- Filter the supported event types and authorize the routing identity for only the intended service.
- Enable the required Google Cloud API in the correct project and separately grant minimum caller access.
- Use Cloud Scheduler for managed recurring triggers and make the target idempotent for retry or duplicate delivery.
Explanation
Correct Answer
A:Use Firestore transactions for supported coordinated document updates with retry-aware application logic. Before rollout, inspect transaction boundaries, concurrent read/write conflicts, and whether all dependent records need atomic change. An application updates an account and an order separately and risks leaving inconsistent business state if one write fails. The team is choosing a sustainable solution.
Incorrect Answers
B:Filter the supported event types and authorize the routing identity for only the intended service. This design addresses Eventarc event-type filtering and authorization, where Eventarc event filters constrain selection while destination IAM controls delivery; a matching event does not bypass invoker authorization. That may help elsewhere, but it does not make the change required for firestore transactional document updates.
C:Enable the required Google Cloud API in the correct project and separately grant minimum caller access. This design addresses google Cloud API enablement and service identity, where service enablement and IAM authorization are separate prerequisites for Google Cloud API calls; one does not substitute for the other. That may help elsewhere, but it does not make the change required for firestore transactional document updates.
D:Use Cloud Scheduler for managed recurring triggers and make the target idempotent for retry or duplicate delivery. This design addresses Cloud Scheduler recurring trigger design, where Cloud Scheduler supplies scheduled triggers; exactly-once business execution still requires receiver-level idempotency. That may help elsewhere, but it does not make the change required for firestore transactional document updates.
Question 655
An application updates an account and an order separately and risks leaving inconsistent business state if one write fails. An approved limited change can be tested in a safe environment. Which implementation action most directly addresses this scenario? Select ONE best answer.
- Configure and test a poison message, including correct permissions for dead-letter forwarding and monitoring.
- Wrap stock validation and update in a transaction and test parallel competing purchases.
- Publish test updates with consistent per-entity keys and verify consumer ordering while independent keys process concurrently.
- Create representative synthetic keys, run hot-key load tests, and measure read latency and tablet distribution.
Explanation
Correct Answer
B:Wrap stock validation and update in a transaction and test parallel competing purchases. In this scenario, an application updates an account and an order separately and risks leaving inconsistent business state if one write fails. Validate the change by checking that at most the permitted purchases succeed and inventory invariants remain consistent under concurrency.
Incorrect Answers
A:Configure and test a poison message, including correct permissions for dead-letter forwarding and monitoring. This action changes a different concern, Pub/Sub dead-letter handling. A more direct response is to recognize that wrap stock validation and update in a transaction and test parallel competing purchases.
C:Publish test updates with consistent per-entity keys and verify consumer ordering while independent keys process concurrently. This action changes a different concern, Pub/Sub ordering keys and partitioned work. A more direct response is to recognize that wrap stock validation and update in a transaction and test parallel competing purchases.
D:Create representative synthetic keys, run hot-key load tests, and measure read latency and tablet distribution. This action changes a different concern, Bigtable row-key hotspot avoidance. A more direct response is to recognize that wrap stock validation and update in a transaction and test parallel competing purchases.
Question 656
An application updates an account and an order separately and risks leaving inconsistent business state if one write fails. The team has tried a correction. Which measurable outcome most directly demonstrates that this issue is resolved? Select ONE best answer.
- Each dependent step runs in the correct order, and failures are handled with recorded state and recovery decisions.
- The reconciliation triggers on the expected business schedule without duplicate side effects across instances.
- Malformed messages are isolated with traceable failure evidence while valid messages continue processing.
- At most the permitted purchases succeed and inventory invariants remain consistent under concurrency.
Explanation
Correct Answer
D:At most the permitted purchases succeed and inventory invariants remain consistent under concurrency. This is evidence that the particular acceptance condition for Firestore transactional document updates has been met, rather than a general availability metric. The original diagnosis should have included this step: inspect transaction boundaries, concurrent read/write conflicts, and whether all dependent records need atomic change. An application updates an account and an order separately and risks leaving inconsistent business state if one write fails. The team has tried a correction.
Incorrect Answers
A:Each dependent step runs in the correct order, and failures are handled with recorded state and recovery decisions. That result could support testing of Workflows multi-step service orchestration: Workflows coordinates multi-step application processes; simply placing independent messages on topics does not create a deterministic state machine. The case instead calls for the following: at most the permitted purchases succeed and inventory invariants remain consistent under concurrency.
B:The reconciliation triggers on the expected business schedule without duplicate side effects across instances. That result could support testing of Cloud Scheduler recurring trigger design: Cloud Scheduler supplies scheduled triggers; exactly-once business execution still requires receiver-level idempotency. The case instead calls for the following: at most the permitted purchases succeed and inventory invariants remain consistent under concurrency.
C:Malformed messages are isolated with traceable failure evidence while valid messages continue processing. That result could support testing of Pub/Sub dead-letter handling: Dead-letter routing isolates messages that exceed allowed delivery attempts; it does not itself repair invalid data or guarantee business processing. The case instead calls for the following: at most the permitted purchases succeed and inventory invariants remain consistent under concurrency.
Question 657
A global product needs consistent SQL transactions over multiple regions but a team assumes a single regional database replica offers the same behavior. Before choosing a remediation, which investigation best isolates the specific cause or unmet dependency? Select ONE best answer.
- Inspect row-key distribution, access queries, tablet hot spots, and key-prefix cardinality.
- Inspect consistency requirements, read/write latency, region layout, SQL joins, and transactional scope.
- Inspect response codes, retry-after guidance, attempt budget, jitter, and idempotency of the failed operation.
- Inspect metric labels, log severity and correlation IDs, trace spans, and latency distribution across services.
Explanation
Correct Answer
B:Inspect consistency requirements, read/write latency, region layout, SQL joins, and transactional scope. This checks the actual operating conditions relevant to Spanner distributed relational transactions, rather than changing a service before the failure is understood. A focused follow-up is to model relational keys and transaction boundaries, and measure cross-region latency on representative commits.
Incorrect Answers
A:Inspect row-key distribution, access queries, tablet hot spots, and key-prefix cardinality. Bigtable performance depends heavily on row-key design; monotonically increasing leading keys can concentrate writes and increase hotspots. It does not isolate the spanner distributed relational transactions issue described.
C:Inspect response codes, retry-after guidance, attempt budget, jitter, and idempotency of the failed operation. Backoff reduces coordinated retries after transient failures; not every error is retryable and repeatable side effects need idempotency. It does not isolate the spanner distributed relational transactions issue described.
D:Inspect metric labels, log severity and correlation IDs, trace spans, and latency distribution across services. Metrics summarize behavior, logs describe events, and traces connect work across service boundaries; their combined context supports root-cause analysis. It does not isolate the spanner distributed relational transactions issue described.
Question 658
A global product needs consistent SQL transactions over multiple regions but a team assumes a single regional database replica offers the same behavior. The team is choosing a sustainable solution. Which design best meets the stated requirement without broad unrelated changes? Select ONE best answer.
- Follow pagination tokens until completion and request only supported required fields to reduce payload volume.
- Prefer maintained Cloud Client Libraries for supported calls and use documented REST or gRPC contracts when needed.
- Use Spanner for supported distributed relational data and strong-consistency requirements when its tradeoffs fit the workload.
- Use Error Reporting and evidence-grounded Cloud Observability assistance as diagnostic inputs, not automatic authorization to change production.
Explanation
Correct Answer
C:Use Spanner for supported distributed relational data and strong-consistency requirements when its tradeoffs fit the workload. This is the bounded design decision for Spanner distributed relational transactions, not a general request to widen access or replace unrelated resources. Before rollout, inspect consistency requirements, read/write latency, region layout, SQL joins, and transactional scope.
Incorrect Answers
A:Follow pagination tokens until completion and request only supported required fields to reduce payload volume. This design addresses Cloud API pagination and field selection, where Cloud APIs frequently paginate collection responses; selecting fewer fields improves efficiency but does not eliminate the need to consume every page. It addresses a different dependency from spanner distributed relational transactions.
B:Prefer maintained Cloud Client Libraries for supported calls and use documented REST or gRPC contracts when needed. It addresses a different dependency from spanner distributed relational transactions.
D:Use Error Reporting and evidence-grounded Cloud Observability assistance as diagnostic inputs, not automatic authorization to change production. This design addresses error Reporting and AI-assisted observability, where error Reporting groups detected exceptions; AI-assisted observability can aid investigation but does not replace validated diagnosis and authorized change control. It addresses a different dependency from spanner distributed relational transactions.
Question 659
A global product needs consistent SQL transactions over multiple regions but a team assumes a single regional database replica offers the same behavior. An approved limited change can be tested in a safe environment. Which implementation action most directly addresses this scenario? Select ONE best answer.
- Publish test updates with consistent per-entity keys and verify consumer ordering while independent keys process concurrently.
- Create representative synthetic keys, run hot-key load tests, and measure read latency and tablet distribution.
- Model relational keys and transaction boundaries, and measure cross-region latency on representative commits.
- Generate a short-lived URL for the intended object and test operation and expiry enforcement.
Explanation
Correct Answer
C:Model relational keys and transaction boundaries, and measure cross-region latency on representative commits. Validate the change by checking that the workload preserves required transaction integrity and meets accepted global-latency targets.
Incorrect Answers
A:Publish test updates with consistent per-entity keys and verify consumer ordering while independent keys process concurrently. This action changes a different concern, Pub/Sub ordering keys and partitioned work. The reported condition is about spanner distributed relational transactions, not this adjacent change.
B:Create representative synthetic keys, run hot-key load tests, and measure read latency and tablet distribution. This action changes a different concern, Bigtable row-key hotspot avoidance. The reported condition is about spanner distributed relational transactions, not this adjacent change.
D:Generate a short-lived URL for the intended object and test operation and expiry enforcement. This action changes a different concern, Cloud Storage signed upload/download workflows. The reported condition is about spanner distributed relational transactions, not this adjacent change.
Question 660
A global product needs consistent SQL transactions over multiple regions but a team assumes a single regional database replica offers the same behavior. The team has tried a correction. Which measurable outcome most directly demonstrates that this issue is resolved? Select ONE best answer.
- An engineer can identify the failing downstream stage and its p95 contribution without exposing confidential request content.
- The client uploads or downloads only its authorized object during the permitted period without bucket-wide credentials.
- Temporary throttling recovers without retry storms and invalid requests fail promptly with actionable diagnostics.
- The workload preserves required transaction integrity and meets accepted global-latency targets.
Explanation
Correct Answer
D:The workload preserves required transaction integrity and meets accepted global-latency targets. This is evidence that the particular acceptance condition for Spanner distributed relational transactions has been met, rather than a general availability metric. The original diagnosis should have included this step: inspect consistency requirements, read/write latency, region layout, SQL joins, and transactional scope.
Incorrect Answers
A:An engineer can identify the failing downstream stage and its p95 contribution without exposing confidential request content. That result could support testing of metrics logs and distributed traces correlation: Metrics summarize behavior, logs describe events, and traces connect work across service boundaries; their combined context supports root-cause analysis. Applying it first would leave spanner distributed relational transactions unresolved.
B:The client uploads or downloads only its authorized object during the permitted period without bucket-wide credentials. Applying it first would leave spanner distributed relational transactions unresolved.
C:Temporary throttling recovers without retry storms and invalid requests fail promptly with actionable diagnostics. That result could support testing of exponential backoff on transient API errors: Backoff reduces coordinated retries after transient failures; not every error is retryable and repeatable side effects need idempotency. Applying it first would leave spanner distributed relational transactions unresolved.