Google Professional Cloud Developer Practice Test 39
Question 380
A Firestore event handler passes unit tests but fails when serialized document timestamps use an unexpected field type. The team has tried a correction. Which measurable outcome most directly demonstrates that this issue is resolved? Select ONE best answer.
- Only reviewed commits with passing checks reach production and each deployment has a reproducible source reference.
- Equivalent source and locks produce the expected artifact while warm builds improve latency without hidden dependency drift.
- Interface regressions are caught before production without claiming emulators prove every IAM, quota, or availability condition.
- Reviewers can trace an artifact to its build inputs and trusted builder without relying on a mutable filename.
Explanation
Correct Answer
C:Interface regressions are caught before production without claiming emulators prove every IAM, quota, or availability condition. Service emulators exercise protocol and data behavior but do not eliminate the need for selective production-like integration checks. The original diagnosis should have included this step: inspect API serialization, emulator feature support, test data setup, and the next production-like test boundary.
Incorrect Answers
A:Only reviewed commits with passing checks reach production and each deployment has a reproducible source reference. It would not establish the success condition for integration testing with service emulators. Applying it first would leave integration testing with service emulators unresolved.
B:Equivalent source and locks produce the expected artifact while warm builds improve latency without hidden dependency drift. It would not establish the success condition for integration testing with service emulators. Applying it first would leave integration testing with service emulators unresolved.
D:Reviewers can trace an artifact to its build inputs and trusted builder without relying on a mutable filename. It would not establish the success condition for integration testing with service emulators. Applying it first would leave integration testing with service emulators unresolved.
Question 381
An application uses an emulator that lacks a production constraint and incorrectly treats emulator success as a release approval. Before choosing a remediation, which investigation best isolates the specific cause or unmet dependency? Select ONE best answer.
- Inspect API serialization, emulator feature support, test data setup, and the next production-like test boundary.
- Inspect flag targeting, defaults, kill-switch behavior, and test coverage of enabled and disabled code paths.
- Inspect attestor configuration, attestation target digest, build service identity, and deployment policy conditions.
- Inspect local image build triggers, Kubernetes manifests, cluster target, and development synchronization settings.
Explanation
Correct Answer
A:Inspect API serialization, emulator feature support, test data setup, and the next production-like test boundary. Service emulators exercise protocol and data behavior but do not eliminate the need for selective production-like integration checks. A focused follow-up is to add a test that writes a fixture, reads it back, and verifies application decoding with a real-service smoke check where required. Before choosing a remediation, which investigation best isolates the specific cause or unmet dependency.
Incorrect Answers
B:Inspect flag targeting, defaults, kill-switch behavior, and test coverage of enabled and disabled code paths. Feature flags separate code deployment from feature exposure, but untested flag branches can still create production failures. That check does not establish the specific cause behind integration testing with service emulators.
C:Inspect attestor configuration, attestation target digest, build service identity, and deployment policy conditions. Binary Authorization requires digest-specific trust evidence and an enforcement policy, not just an assertion that a build succeeded. That check does not establish the specific cause behind integration testing with service emulators.
D:Inspect local image build triggers, Kubernetes manifests, cluster target, and development synchronization settings. Cloud Code and Skaffold can streamline iterative container development but must be scoped to the correct cluster and configuration profile. That check does not establish the specific cause behind integration testing with service emulators.
Question 382
An application uses an emulator that lacks a production constraint and incorrectly treats emulator success as a release approval. The team is choosing a sustainable solution. Which design best meets the stated requirement without broad unrelated changes? Select ONE best answer.
- Run integration tests against suitable emulators plus bounded staging tests for unsupported cloud-specific behavior.
- Isolate business logic using controlled stubs or mocks while keeping separate cloud integration coverage.
- Roll out features through controlled identities and verify both states before exposing real users.
- Separate per-environment configuration and inject secrets through approved runtime facilities without source control exposure.
Explanation
Correct Answer
A:Run integration tests against suitable emulators plus bounded staging tests for unsupported cloud-specific behavior. Service emulators exercise protocol and data behavior but do not eliminate the need for selective production-like integration checks. Before rollout, inspect API serialization, emulator feature support, test data setup, and the next production-like test boundary. An application uses an emulator that lacks a production constraint and incorrectly treats emulator success as a release approval. The team is choosing a sustainable solution.
Incorrect Answers
B:Isolate business logic using controlled stubs or mocks while keeping separate cloud integration coverage. This design addresses unit testing with isolated dependencies, where unit tests target a bounded code unit; production network dependencies should be tested through separate controlled integration layers. A more direct response is to run integration tests against suitable emulators plus bounded staging tests for unsupported cloud-specific behavior.
C:Roll out features through controlled identities and verify both states before exposing real users. This design addresses feature-flag regression testing, where feature flags separate code deployment from feature exposure, but untested flag branches can still create production failures. A more direct response is to run integration tests against suitable emulators plus bounded staging tests for unsupported cloud-specific behavior.
D:Separate per-environment configuration and inject secrets through approved runtime facilities without source control exposure. This design addresses development secrets and environment isolation, where environment configuration and secret injection must be isolated; a dev label on a file does not constrain the credentials it contains. A more direct response is to run integration tests against suitable emulators plus bounded staging tests for unsupported cloud-specific behavior.
Question 383
An application uses an emulator that lacks a production constraint and incorrectly treats emulator success as a release approval. An approved limited change can be tested in a safe environment. Which implementation action most directly addresses this scenario? Select ONE best answer.
- Mock external clients at a defined interface and assert expected function outputs for representative cases.
- Add a test that writes a fixture, reads it back, and verifies application decoding with a real-service smoke check where required.
- Rotate leaked secrets and configure isolated test project credentials before running integration jobs.
- Add automated flag-on and flag-off tests, then validate a small authorized cohort with immediate rollback capability.
Explanation
Correct Answer
B:Add a test that writes a fixture, reads it back, and verifies application decoding with a real-service smoke check where required. Service emulators exercise protocol and data behavior but do not eliminate the need for selective production-like integration checks. Validate the change by checking that interface regressions are caught before production without claiming emulators prove every IAM, quota, or availability condition. An approved limited change can be tested in a safe environment.
Incorrect Answers
A:Mock external clients at a defined interface and assert expected function outputs for representative cases. This action changes a different concern, unit testing with isolated dependencies. The case instead calls for the following: add a test that writes a fixture, reads it back, and verifies application decoding with a real-service smoke check where required.
C:Rotate leaked secrets and configure isolated test project credentials before running integration jobs. This action changes a different concern, development secrets and environment isolation. The case instead calls for the following: add a test that writes a fixture, reads it back, and verifies application decoding with a real-service smoke check where required.
D:Add automated flag-on and flag-off tests, then validate a small authorized cohort with immediate rollback capability. This action changes a different concern, feature-flag regression testing. The case instead calls for the following: add a test that writes a fixture, reads it back, and verifies application decoding with a real-service smoke check where required.
Question 384
An application uses an emulator that lacks a production constraint and incorrectly treats emulator success as a release approval. The team has tried a correction. Which measurable outcome most directly demonstrates that this issue is resolved? Select ONE best answer.
- Staging and production resolve to identical approved image bytes until an explicit change is authorized.
- Developers have sufficient tools and permissions without storing project keys or relying on an unsuitable ephemeral workspace.
- Interface regressions are caught before production without claiming emulators prove every IAM, quota, or availability condition.
- The pipeline gains safe parallelism while no failed or unfinished mandatory check can produce an approved release.
Explanation
Correct Answer
C:Interface regressions are caught before production without claiming emulators prove every IAM, quota, or availability condition. Service emulators exercise protocol and data behavior but do not eliminate the need for selective production-like integration checks. The original diagnosis should have included this step: inspect API serialization, emulator feature support, test data setup, and the next production-like test boundary. An application uses an emulator that lacks a production constraint and incorrectly treats emulator success as a release approval. The team has tried a correction.
Incorrect Answers
A:Staging and production resolve to identical approved image bytes until an explicit change is authorized. That result could support testing of artifact Registry image digest reproducibility: Tags can be moved to new images; a content digest identifies the exact stored container artifact for verification and rollback. It cannot substitute for the required control: interface regressions are caught before production without claiming emulators prove every IAM, quota, or availability condition.
B:Developers have sufficient tools and permissions without storing project keys or relying on an unsuitable ephemeral workspace. That result could support testing of Cloud Shell versus Cloud Workstations: Cloud Shell offers managed interactive temporary shell sessions, while Cloud Workstations provides customizable managed development environments. It cannot substitute for the required control: interface regressions are caught before production without claiming emulators prove every IAM, quota, or availability condition.
D:The pipeline gains safe parallelism while no failed or unfinished mandatory check can produce an approved release. It would not establish the success condition for integration testing with service emulators. It cannot substitute for the required control: interface regressions are caught before production without claiming emulators prove every IAM, quota, or availability condition.
Question 385
A new Cloud Run revision returns valid HTTP status codes but breaks clients by omitting a required JSON field. Before choosing a remediation, which investigation best isolates the specific cause or unmet dependency? Select ONE best answer.
- Inspect Dockerfile stages, copied artifacts, build-time secrets, runtime libraries, and final image composition.
- Inspect generated code against current API references, tests, permissions, and the application's domain invariants.
- Inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases.
- Inspect build steps, image artifact outputs, stage dependencies, and failure propagation.
Explanation
Correct Answer
C:Inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases. This checks the actual operating conditions relevant to Cloud Run HTTP API contract tests, rather than changing a service before the failure is understood.
Incorrect Answers
A:Inspect Dockerfile stages, copied artifacts, build-time secrets, runtime libraries, and final image composition. Multi-stage builds separate build tools from runtime contents and can reduce attack surface when stage copies are constrained. The first evidence should address cloud run http api contract tests, not this separate diagnostic path.
B:Inspect generated code against current API references, tests, permissions, and the application's domain invariants. AI coding assistance can accelerate development but generated suggestions do not establish their own correctness or safety. The first evidence should address cloud run http api contract tests, not this separate diagnostic path.
D:Inspect build steps, image artifact outputs, stage dependencies, and failure propagation. A build pipeline must explicitly encode its ordering and failure gates; saving a Dockerfile alone does not enforce release quality. The first evidence should address cloud run http api contract tests, not this separate diagnostic path.
Question 386
A new Cloud Run revision returns valid HTTP status codes but breaks clients by omitting a required JSON field. The team is choosing a sustainable solution. Which design best meets the stated requirement without broad unrelated changes? Select ONE best answer.
- Separate per-environment configuration and inject secrets through approved runtime facilities without source control exposure.
- Use explicit project, identity, and configuration context for reproducible development commands and automation.
- Enforce contract tests for backward-compatible request and response shapes before traffic migration.
- Use protected branches with mandatory code review and verified CI status before release promotions.
Explanation
Correct Answer
C:Enforce contract tests for backward-compatible request and response shapes before traffic migration. Deployable container health is not equivalent to API compatibility; contract testing validates consumer-visible behavior. Before rollout, inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases.
Incorrect Answers
A:Separate per-environment configuration and inject secrets through approved runtime facilities without source control exposure. This design addresses development secrets and environment isolation, where environment configuration and secret injection must be isolated; a dev label on a file does not constrain the credentials it contains. The reported condition is about cloud run http api contract tests, not this adjacent change.
B:Use explicit project, identity, and configuration context for reproducible development commands and automation. This design addresses google Cloud CLI project and identity context, where google Cloud CLI settings influence which identity and project receive operations; implicit defaults can cause unintended resource changes. The reported condition is about cloud run http api contract tests, not this adjacent change.
D:Use protected branches with mandatory code review and verified CI status before release promotions. The reported condition is about cloud run http api contract tests, not this adjacent change.
Question 387
A new Cloud Run revision returns valid HTTP status codes but breaks clients by omitting a required JSON field. An approved limited change can be tested in a safe environment. Which implementation action most directly addresses this scenario? Select ONE best answer.
- Provision the selected environment and validate workspace setup, credential access, and cleanup behavior.
- Run old and new client fixtures against tagged revisions and reject a release that breaks the approved contract.
- Restrict tool commands to approved functions and test attempted access to forbidden files or resources.
- Record the digest at build completion and pin it in deployment manifests and release evidence.
Explanation
Correct Answer
B:Run old and new client fixtures against tagged revisions and reject a release that breaks the approved contract. Deployable container health is not equivalent to API compatibility; contract testing validates consumer-visible behavior. Validate the change by checking that existing clients remain interoperable and failures return correctly structured error responses.
Incorrect Answers
A:Provision the selected environment and validate workspace setup, credential access, and cleanup behavior. This action changes a different concern, Cloud Shell versus Cloud Workstations. Applying it first would leave cloud run http api contract tests unresolved.
C:Restrict tool commands to approved functions and test attempted access to forbidden files or resources. This action changes a different concern, MCP server development tool boundary. Applying it first would leave cloud run http api contract tests unresolved.
D:Record the digest at build completion and pin it in deployment manifests and release evidence. This action changes a different concern, artifact Registry image digest reproducibility. Applying it first would leave cloud run http api contract tests unresolved.
Question 388
A new Cloud Run revision returns valid HTTP status codes but breaks clients by omitting a required JSON field. The team has tried a correction. Which measurable outcome most directly demonstrates that this issue is resolved? Select ONE best answer.
- Only intended users see the new behavior and disabling the flag safely restores the prior path.
- Staging and production resolve to identical approved image bytes until an explicit change is authorized.
- The container starts without excessive privileges and retains access only to necessary files and ports.
- Existing clients remain interoperable and failures return correctly structured error responses.
Explanation
Correct Answer
D:Existing clients remain interoperable and failures return correctly structured error responses. This is evidence that the particular acceptance condition for Cloud Run HTTP API contract tests has been met, rather than a general availability metric. The original diagnosis should have included this step: inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases.
Incorrect Answers
A:Only intended users see the new behavior and disabling the flag safely restores the prior path. That result could support testing of feature-flag regression testing: Feature flags separate code deployment from feature exposure, but untested flag branches can still create production failures. That may help elsewhere, but it does not make the change required for cloud run http api contract tests.
B:Staging and production resolve to identical approved image bytes until an explicit change is authorized. That result could support testing of artifact Registry image digest reproducibility: Tags can be moved to new images; a content digest identifies the exact stored container artifact for verification and rollback. That may help elsewhere, but it does not make the change required for cloud run http api contract tests.
C:The container starts without excessive privileges and retains access only to necessary files and ports. That result could support testing of non-root minimal container runtime: Least-privilege container identity and reduced packages narrow the impact of a compromised application process. That may help elsewhere, but it does not make the change required for cloud run http api contract tests.
Question 389
A service upgrade changes authentication failure behavior and older mobile clients mistakenly treat the response as success. Before choosing a remediation, which investigation best isolates the specific cause or unmet dependency? Select ONE best answer.
- Inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases.
- Inspect attestor configuration, attestation target digest, build service identity, and deployment policy conditions.
- Inspect Cloud Build trigger events, branch or tag regexes, file filters, and repository connection permissions.
- Inspect API serialization, emulator feature support, test data setup, and the next production-like test boundary.
Explanation
Correct Answer
A:Inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases. This checks the actual operating conditions relevant to Cloud Run HTTP API contract tests, rather than changing a service before the failure is understood. Before choosing a remediation, which investigation best isolates the specific cause or unmet dependency.
Incorrect Answers
B:Inspect attestor configuration, attestation target digest, build service identity, and deployment policy conditions. Binary Authorization requires digest-specific trust evidence and an enforcement policy, not just an assertion that a build succeeded. The more informative check is to inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases.
C:Inspect Cloud Build trigger events, branch or tag regexes, file filters, and repository connection permissions. Cloud Build triggers select source events and revisions; trigger scope is independent of the container build command itself. The more informative check is to inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases.
D:Inspect API serialization, emulator feature support, test data setup, and the next production-like test boundary. Service emulators exercise protocol and data behavior but do not eliminate the need for selective production-like integration checks. The more informative check is to inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases.
Question 390
A service upgrade changes authentication failure behavior and older mobile clients mistakenly treat the response as success. The team is choosing a sustainable solution. Which design best meets the stated requirement without broad unrelated changes? Select ONE best answer.
- Use explicit project, identity, and configuration context for reproducible development commands and automation.
- Use a supported minimal trusted base and non-root execution where practical, without removing required runtime assets.
- Enforce contract tests for backward-compatible request and response shapes before traffic migration.
- Isolate business logic using controlled stubs or mocks while keeping separate cloud integration coverage.
Explanation
Correct Answer
C:Enforce contract tests for backward-compatible request and response shapes before traffic migration. In this scenario, a service upgrade changes authentication failure behavior and older mobile clients mistakenly treat the response as success. Before rollout, inspect API schema versions, response bodies, status semantics, and authorized versus unauthorized test cases.
Incorrect Answers
A:Use explicit project, identity, and configuration context for reproducible development commands and automation. This design addresses google Cloud CLI project and identity context, where google Cloud CLI settings influence which identity and project receive operations; implicit defaults can cause unintended resource changes. The case instead calls for the following: enforce contract tests for backward-compatible request and response shapes before traffic migration.
B:Use a supported minimal trusted base and non-root execution where practical, without removing required runtime assets. This design addresses non-root minimal container runtime, where least-privilege container identity and reduced packages narrow the impact of a compromised application process. The case instead calls for the following: enforce contract tests for backward-compatible request and response shapes before traffic migration.
D:Isolate business logic using controlled stubs or mocks while keeping separate cloud integration coverage. This design addresses unit testing with isolated dependencies, where unit tests target a bounded code unit; production network dependencies should be tested through separate controlled integration layers. The case instead calls for the following: enforce contract tests for backward-compatible request and response shapes before traffic migration.