Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 7
Question 60
A single infrastructure template must deploy a dev and prod stack with different memory settings. Which implementation approach BEST addresses this requirement?
- Duplicate production secrets in template descriptions.
- Change DNS cache time-to-live instead of template parameters.
- Parameterize the CloudFormation or SAM template and supply environment-specific values at deployment.
- Hand-edit each deployed resource in the console after every commit.
Explanation
Correct Answer
C:Parameterize the CloudFormation or SAM template and supply environment-specific values at deployment. Template parameters and mappings allow controlled environment variation from one IaC definition. A confirming test would show: The change set shows the intended resource values for the selected environment without modifying source templates.
Incorrect Answers
A:Duplicate production secrets in template descriptions. This suggestion does not establish the required CloudFormation resource parameters; the relevant risk is that hardcoding production resource names in a shared template can cause cross-environment collisions.
B:Change DNS cache time-to-live instead of template parameters. This suggestion does not establish the required CloudFormation resource parameters; the relevant risk is that hardcoding production resource names in a shared template can cause cross-environment collisions.
D:Hand-edit each deployed resource in the console after every commit. This suggestion does not establish the required CloudFormation resource parameters; the relevant risk is that hardcoding production resource names in a shared template can cause cross-environment collisions.
Question 61
A billing subscriber receives events for all product lines but should process only invoices. Which implementation approach BEST addresses this requirement?
- Apply an SNS subscription filter policy on the relevant message attributes or payload fields.
- Remove all subscriber policies and expect SNS to infer business intent.
- Increase the Lambda timeout so SNS filters events automatically.
- Put every event into one SQS message body without useful filter fields.
Explanation
Correct Answer
A:Apply an SNS subscription filter policy on the relevant message attributes or payload fields. SNS subscription filtering drops irrelevant deliveries before consumer processing. A confirming test would show: Only events matching the subscriber's policy reach its target while other topics of work are skipped.
Incorrect Answers
B:Remove all subscriber policies and expect SNS to infer business intent. This suggestion does not establish the required SNS subscription filter policy; the relevant risk is that without a filter the subscriber receives unrelated messages and spends capacity rejecting them.
C:Increase the Lambda timeout so SNS filters events automatically. This suggestion does not establish the required SNS subscription filter policy; the relevant risk is that without a filter the subscriber receives unrelated messages and spends capacity rejecting them.
D:Put every event into one SQS message body without useful filter fields. This suggestion does not establish the required SNS subscription filter policy; the relevant risk is that without a filter the subscriber receives unrelated messages and spends capacity rejecting them.
Question 62
An HTTP GET response varies by locale and authorization scope but a shared cache currently serves the wrong language. Which implementation approach BEST addresses this requirement?
- Cache every authenticated response under one key.
- Configure cache keys or origin request policies using the required safe variation dimensions.
- Set all Cache-Control headers to public for private account responses.
- Disable origin validation and accept all cached variants.
Explanation
Correct Answer
B:Configure cache keys or origin request policies using the required safe variation dimensions. Cache-key design determines which requests may share cached content. A confirming test would show: Cache tests show each allowed variant returns its own response without cross-user leakage.
Incorrect Answers
A:Cache every authenticated response under one key. This suggestion does not establish the required API response caching variation; the relevant risk is that ignoring a response-varying header can serve incorrect or sensitive content from cache.
C:Set all Cache-Control headers to public for private account responses. This suggestion does not establish the required API response caching variation; the relevant risk is that ignoring a response-varying header can serve incorrect or sensitive content from cache.
D:Disable origin validation and accept all cached variants. This suggestion does not establish the required API response caching variation; the relevant risk is that ignoring a response-varying header can serve incorrect or sensitive content from cache.
Question 63
A customer profile endpoint depends on a vendor scoring API with repeated timeouts. Which implementation approach BEST addresses this requirement?
- Retry every failed request with zero delay forever.
- Use a circuit breaker with bounded timeouts and a documented fallback for the external dependency.
- Remove every timeout from partner calls.
- Make the user interface responsible for restoring backend network connectivity.
Explanation
Correct Answer
B:Use a circuit breaker with bounded timeouts and a documented fallback for the external dependency. Circuit breakers limit cascading latency while allowing controlled recovery after dependency outages. A confirming test would show: During a sustained fault, calls fail fast through the fallback and recover through controlled probes.
Incorrect Answers
A:Retry every failed request with zero delay forever. This suggestion does not establish the required third-party circuit breaker; the relevant risk is that keeping all requests waiting for an unhealthy dependency exhausts caller concurrency.
C:Remove every timeout from partner calls. This suggestion does not establish the required third-party circuit breaker; the relevant risk is that keeping all requests waiting for an unhealthy dependency exhausts caller concurrency.
D:Make the user interface responsible for restoring backend network connectivity. This suggestion does not establish the required third-party circuit breaker; the relevant risk is that keeping all requests waiting for an unhealthy dependency exhausts caller concurrency.
Question 64
A pipeline must verify Lambda handles representative API Gateway authorization and validation errors. Which implementation approach BEST addresses this requirement?
- Disable pipeline test steps when a fixture reveals a defect.
- Replace every event fixture with an empty JSON object.
- Treat a successful Docker image push as proof all event paths work.
- Create versioned JSON test event fixtures and assert both expected outputs and error paths during automated tests.
Explanation
Correct Answer
D:Create versioned JSON test event fixtures and assert both expected outputs and error paths during automated tests. Explicit test fixtures make regression behavior reproducible across deployments. A confirming test would show: Candidate builds pass deterministic positive and negative test cases with expected response contracts.
Incorrect Answers
A:Disable pipeline test steps when a fixture reveals a defect. This suggestion does not establish the required deployment test event generation; the relevant risk is that tests using only happy-path payloads miss error handling and event-shape incompatibilities.
B:Replace every event fixture with an empty JSON object. This suggestion does not establish the required deployment test event generation; the relevant risk is that tests using only happy-path payloads miss error handling and event-shape incompatibilities.
C:Treat a successful Docker image push as proof all event paths work. This suggestion does not establish the required deployment test event generation; the relevant risk is that tests using only happy-path payloads miss error handling and event-shape incompatibilities.
Question 65
A new Lambda release raises error rates and the production alias must promptly return to the prior healthy version. Which implementation approach BEST addresses this requirement?
- Delete the previous healthy version before performing rollback.
- Change the deployment package filename while leaving the alias unchanged.
- Point the production Lambda alias back to the previously tested immutable version.
- Edit published version code in place as though it were mutable.
Explanation
Correct Answer
C:Point the production Lambda alias back to the previously tested immutable version. Lambda aliases can be repointed independently of immutable published version code. A confirming test would show: Invocations through the alias immediately resolve to the prior version and error rates recover.
Incorrect Answers
A:Delete the previous healthy version before performing rollback. This suggestion does not establish the required Lambda alias rollback; the relevant risk is that editing $LATEST does not necessarily change an alias pinned to a published version.
B:Change the deployment package filename while leaving the alias unchanged. This suggestion does not establish the required Lambda alias rollback; the relevant risk is that editing $LATEST does not necessarily change an alias pinned to a published version.
D:Edit published version code in place as though it were mutable. This suggestion does not establish the required Lambda alias rollback; the relevant risk is that editing $LATEST does not necessarily change an alias pinned to a published version.
Question 66
A service must page operators when its Lambda error-rate threshold is exceeded for multiple evaluation periods. Which implementation approach BEST addresses this requirement?
- Create a CloudWatch alarm on the relevant metric and send state-change notifications to an approved SNS topic.
- Use an S3 presigned URL expiration as the incident metric.
- Disable alarms during deployments and never restore them.
- Set every alarm threshold to zero without inspecting normal traffic.
Explanation
Correct Answer
A:Create a CloudWatch alarm on the relevant metric and send state-change notifications to an approved SNS topic. CloudWatch alarm evaluation compares metric periods against thresholds and actions trigger on state transitions. A confirming test would show: A controlled threshold breach moves the alarm to ALARM and the subscribed channel receives a notification.
Incorrect Answers
B:Use an S3 presigned URL expiration as the incident metric. This suggestion does not establish the required CloudWatch alarm notification; the relevant risk is that without the correct metric statistic or alarm action, sustained incidents can remain unnoticed.
C:Disable alarms during deployments and never restore them. This suggestion does not establish the required CloudWatch alarm notification; the relevant risk is that without the correct metric statistic or alarm action, sustained incidents can remain unnoticed.
D:Set every alarm threshold to zero without inspecting normal traffic. This suggestion does not establish the required CloudWatch alarm notification; the relevant risk is that without the correct metric statistic or alarm action, sustained incidents can remain unnoticed.
Question 67
An order API adds an optional field and must not break older mobile clients. Which implementation approach BEST addresses this requirement?
- Run consumer contract tests across supported API versions and stage new behavior before promotion.
- Skip compatibility checks because the code compiles.
- Change the certificate expiry date to repair JSON schema compatibility.
- Rename all response fields to match the newest client only.
Explanation
Correct Answer
A:Run consumer contract tests across supported API versions and stage new behavior before promotion. Contract testing checks wire-level compatibility beyond unit correctness of a single handler. A confirming test would show: Older client fixtures and the revised contract both pass against the candidate API stage.
Incorrect Answers
B:Skip compatibility checks because the code compiles. This suggestion does not establish the required contract testing versioned API; the relevant risk is that changing required response shapes without consumer tests can break callers after deployment.
C:Change the certificate expiry date to repair JSON schema compatibility. This suggestion does not establish the required contract testing versioned API; the relevant risk is that changing required response shapes without consumer tests can break callers after deployment.
D:Rename all response fields to match the newest client only. This suggestion does not establish the required contract testing versioned API; the relevant risk is that changing required response shapes without consumer tests can break callers after deployment.
Question 68
A Lambda SQS consumer must handle the Records envelope and malformed message bodies correctly. Which implementation approach BEST addresses this requirement?
- Build test events using realistic SQS Records metadata and verify handler output plus failure identifiers.
- Assert only that the Lambda function imports successfully.
- Send API Gateway request templates as direct SQS Records fixtures without adaptation.
- Disable tests for malformed records entirely.
Explanation
Correct Answer
A:Build test events using realistic SQS Records metadata and verify handler output plus failure identifiers. Event-driven tests must exercise the actual source envelope and partial failure contract. A confirming test would show: Contract tests prove valid records process once logically and only failed IDs are reported.
Incorrect Answers
B:Assert only that the Lambda function imports successfully. This suggestion does not establish the required SQS handler contract tests; the relevant risk is that testing a bare JSON object instead of an SQS event misses envelope parsing defects.
C:Send API Gateway request templates as direct SQS Records fixtures without adaptation. This suggestion does not establish the required SQS handler contract tests; the relevant risk is that testing a bare JSON object instead of an SQS event misses envelope parsing defects.
D:Disable tests for malformed records entirely. This suggestion does not establish the required SQS handler contract tests; the relevant risk is that testing a bare JSON object instead of an SQS event misses envelope parsing defects.
Question 69
A CPU-bound Lambda runs slowly and has billed time far above the business latency target. Which implementation approach BEST addresses this requirement?
- Add an API Gateway authorizer to increase Lambda CPU shares.
- Reduce memory to the absolute minimum without benchmarking.
- Increase S3 bucket version retention to speed CPU operations.
- Benchmark memory settings and pick a measured memory and CPU allocation optimizing duration and total cost.
Explanation
Correct Answer
D:Benchmark memory settings and pick a measured memory and CPU allocation optimizing duration and total cost. Lambda allocates CPU in proportion to memory, so more memory can reduce compute duration. A confirming test would show: Comparative load tests show latency and billed cost at the chosen memory setting.
Incorrect Answers
A:Add an API Gateway authorizer to increase Lambda CPU shares. This suggestion does not establish the required Lambda duration versus memory tradeoff; the relevant risk is that simply reducing memory can raise duration and total cost for CPU-bound code.
B:Reduce memory to the absolute minimum without benchmarking. This suggestion does not establish the required Lambda duration versus memory tradeoff; the relevant risk is that simply reducing memory can raise duration and total cost for CPU-bound code.
C:Increase S3 bucket version retention to speed CPU operations. This suggestion does not establish the required Lambda duration versus memory tradeoff; the relevant risk is that simply reducing memory can raise duration and total cost for CPU-bound code.
Question 70
Unit tests call a paid third-party API and become flaky during external outages. Which implementation approach BEST addresses this requirement?
- Replace every external test with a generic ping to localhost.
- Put production API credentials in public test fixtures.
- Mock external dependency responses in unit tests and retain separate contract or integration tests.
- Turn off test assertions whenever the partner is unavailable.
Explanation
Correct Answer
C:Mock external dependency responses in unit tests and retain separate contract or integration tests. Mocks isolate code logic while independent integration checks validate real API contracts. A confirming test would show: Tests deterministically exercise success, timeout, and error handling without contacting the live partner.
Incorrect Answers
A:Replace every external test with a generic ping to localhost. This suggestion does not establish the required API external dependency mocks; the relevant risk is that relying only on live third-party calls makes tests slow and nondeterministic.
B:Put production API credentials in public test fixtures. This suggestion does not establish the required API external dependency mocks; the relevant risk is that relying only on live third-party calls makes tests slow and nondeterministic.
D:Turn off test assertions whenever the partner is unavailable. This suggestion does not establish the required API external dependency mocks; the relevant risk is that relying only on live third-party calls makes tests slow and nondeterministic.