Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 64
Question 630
A team uses AI assistance to propose AWS SDK code but must prevent unchecked suggestions from reaching production. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Treat AI output as authoritative without executing tests.
- Use Amazon Q Developer for suggestions and review generated code with tests, IAM checks, and human approval.
- Disable version control because suggestions are machine-generated.
- Test results and code review demonstrate generated changes meet requirements without new permissions exposure.
- Grant administrator access to every generated component.
Explanation
Correct Answers
B:Use Amazon Q Developer for suggestions and review generated code with tests, IAM checks, and human approval. This is the concrete implementation required for Amazon Q Developer review.
D:Test results and code review demonstrate generated changes meet requirements without new permissions exposure.
Incorrect Answers
A:Treat AI output as authoritative without executing tests. This is not a suitable implementation or validation step for Amazon Q Developer review; it would leave the risk that accepting generated code without review can introduce incorrect APIs or excessive permissions.
C:Disable version control because suggestions are machine-generated. This is not a suitable implementation or validation step for Amazon Q Developer review; it would leave the risk that accepting generated code without review can introduce incorrect APIs or excessive permissions.
E:Grant administrator access to every generated component. This is not a suitable implementation or validation step for Amazon Q Developer review; it would leave the risk that accepting generated code without review can introduce incorrect APIs or excessive permissions.
Question 631
Unit tests call a paid third-party API and become flaky during external outages. Select THREE statements that together form a sound implementation and validation plan for this requirement.
- 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.
- Turn off test assertions whenever the partner is unavailable.
- Put production API credentials in public test fixtures.
- Tests deterministically exercise success, timeout, and error handling without contacting the live partner.
- Replace every external test with a generic ping to localhost.
Explanation
Correct Answers
A:Mock external dependency responses in unit tests and retain separate contract or integration tests. This is the concrete implementation required for API external dependency mocks.
B:Mocks isolate code logic while independent integration checks validate real API contracts. This states the AWS behavior that makes the implementation valid.
E:Tests deterministically exercise success, timeout, and error handling without contacting the live partner.
Incorrect Answers
C:Turn off test assertions whenever the partner is unavailable. This is not a suitable implementation or validation step for API external dependency mocks; it would leave the risk that relying only on live third-party calls makes tests slow and nondeterministic.
D:Put production API credentials in public test fixtures. This is not a suitable implementation or validation step for API external dependency mocks; it would leave the risk that relying only on live third-party calls makes tests slow and nondeterministic.
F:Replace every external test with a generic ping to localhost. This is not a suitable implementation or validation step for API external dependency mocks; it would leave the risk that relying only on live third-party calls makes tests slow and nondeterministic.
Question 632
A checkout Lambda receives the same order-paid event twice when its upstream emitter retries after a timeout. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Keep processed-event IDs only in a Lambda process variable.
- Replaying the identical event leaves one committed business operation and one idempotency record.
- Write a stable event ID with a conditional DynamoDB write and skip a side effect when that ID was processed.
- Increase the Lambda timeout without tracking event identity.
- Disable every retry including recoverable failures.
Explanation
Correct Answers
B:Replaying the identical event leaves one committed business operation and one idempotency record. This is the workload-specific evidence needed to validate the change.
C:Write a stable event ID with a conditional DynamoDB write and skip a side effect when that ID was processed. This is the concrete implementation required for idempotent event handling.
Incorrect Answers
A:Keep processed-event IDs only in a Lambda process variable. This is not a suitable implementation or validation step for idempotent event handling; it would leave the risk that duplicate deliveries bypass a stable deduplication check and cause the same side effect twice.
D:Increase the Lambda timeout without tracking event identity. This is not a suitable implementation or validation step for idempotent event handling; it would leave the risk that duplicate deliveries bypass a stable deduplication check and cause the same side effect twice.
E:Disable every retry including recoverable failures. This is not a suitable implementation or validation step for idempotent event handling; it would leave the risk that duplicate deliveries bypass a stable deduplication check and cause the same side effect twice.
Question 633
A product service loses most of its cache entries at once and the backing database receives thousands of simultaneous reloads. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Cache-miss burst metrics shrink and backend query rates stay controlled during expiration.
- Set all popular cache keys to expire at the same exact second.
- Remove cache invalidation and hold every value forever.
- Increase retry storms at the database when cache misses surge.
- Add expiration jitter and single-flight request coalescing or locking around cache repopulation.
Explanation
Correct Answers
A:Cache-miss burst metrics shrink and backend query rates stay controlled during expiration. This is the workload-specific evidence needed to validate the change.
E:Add expiration jitter and single-flight request coalescing or locking around cache repopulation. This is the concrete implementation required for application cache stampede.
Incorrect Answers
B:Set all popular cache keys to expire at the same exact second. This is not a suitable implementation or validation step for application cache stampede; it would leave the risk that simultaneous expiry of a hot key can cause redundant backend load even with a high steady-state hit rate.
C:Remove cache invalidation and hold every value forever. This is not a suitable implementation or validation step for application cache stampede; it would leave the risk that simultaneous expiry of a hot key can cause redundant backend load even with a high steady-state hit rate.
D:Increase retry storms at the database when cache misses surge. This is not a suitable implementation or validation step for application cache stampede; it would leave the risk that simultaneous expiry of a hot key can cause redundant backend load even with a high steady-state hit rate.
Question 634
A JSON API must admit only callers with valid bearer access tokens issued by a trusted user directory. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Valid JWTs reach integrations while expired, bad-signature, or wrong-audience tokens are rejected.
- Configure a JWT authorizer with the trusted issuer and audience and bind it to protected API routes.
- Turn off all authorizers once TLS is enabled.
- Accept every token whose JSON payload includes a username.
- Compare only whether bearer-token length is greater than ten.
Explanation
Correct Answers
A:Valid JWTs reach integrations while expired, bad-signature, or wrong-audience tokens are rejected. This is the workload-specific evidence needed to validate the change.
B:Configure a JWT authorizer with the trusted issuer and audience and bind it to protected API routes. This is the concrete implementation required for API Gateway JWT authorizer.
Incorrect Answers
C:Turn off all authorizers once TLS is enabled. This is not a suitable implementation or validation step for API Gateway JWT authorizer; it would leave the risk that merely checking that Authorization is nonempty accepts fabricated or expired tokens.
D:Accept every token whose JSON payload includes a username. This is not a suitable implementation or validation step for API Gateway JWT authorizer; it would leave the risk that merely checking that Authorization is nonempty accepts fabricated or expired tokens.
E:Compare only whether bearer-token length is greater than ten. This is not a suitable implementation or validation step for API Gateway JWT authorizer; it would leave the risk that merely checking that Authorization is nonempty accepts fabricated or expired tokens.
Question 635
A CPU-heavy Lambda builds thumbnails and consistently uses its full timeout despite low memory consumption. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Increase API Gateway stage cache size to give Lambda more CPU.
- Add a public S3 ACL to accelerate processing.
- Increase the Lambda memory setting experimentally and benchmark latency and cost at several settings.
- Duration and billed-duration measurements improve at a tested memory setting without breaching budget.
- Double the function timeout without changing CPU allocation.
Explanation
Correct Answers
C:Increase the Lambda memory setting experimentally and benchmark latency and cost at several settings. This is the concrete implementation required for Lambda memory CPU tuning.
D:Duration and billed-duration measurements improve at a tested memory setting without breaching budget.
Incorrect Answers
A:Increase API Gateway stage cache size to give Lambda more CPU. This is not a suitable implementation or validation step for Lambda memory CPU tuning; it would leave the risk that holding memory at the minimum can constrain compute even when the function has spare heap.
B:Add a public S3 ACL to accelerate processing. This is not a suitable implementation or validation step for Lambda memory CPU tuning; it would leave the risk that holding memory at the minimum can constrain compute even when the function has spare heap.
E:Double the function timeout without changing CPU allocation. This is not a suitable implementation or validation step for Lambda memory CPU tuning; it would leave the risk that holding memory at the minimum can constrain compute even when the function has spare heap.
Question 636
A serverless API experiences slow first requests after idle periods with large dependency packages. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Inspect Lambda init-duration and handler-duration metrics and reduce startup work or use provisioned concurrency when justified.
- Store imported modules in an API Gateway stage variable.
- Increase SQS message retention to remove Lambda initialization.
- Disable CloudWatch logs to guarantee warm execution.
- Telemetry separates initialization delay from handler time and shows improvement after the change.
Explanation
Correct Answers
A:Inspect Lambda init-duration and handler-duration metrics and reduce startup work or use provisioned concurrency when justified. This is the concrete implementation required for Lambda Init Duration diagnosis.
E:Telemetry separates initialization delay from handler time and shows improvement after the change. This is the workload-specific evidence needed to validate the change.
Incorrect Answers
B:Store imported modules in an API Gateway stage variable. This is not a suitable implementation or validation step for Lambda Init Duration diagnosis; it would leave the risk that optimizing only DynamoDB Query speed cannot eliminate time spent before the handler begins.
C:Increase SQS message retention to remove Lambda initialization. This is not a suitable implementation or validation step for Lambda Init Duration diagnosis; it would leave the risk that optimizing only DynamoDB Query speed cannot eliminate time spent before the handler begins.
D:Disable CloudWatch logs to guarantee warm execution. This is not a suitable implementation or validation step for Lambda Init Duration diagnosis; it would leave the risk that optimizing only DynamoDB Query speed cannot eliminate time spent before the handler begins.
Question 637
A developer service calls an external throttled API and must recover from transient 429 responses without a request storm. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Use bounded exponential backoff with jitter, an explicit timeout, and an idempotent request design.
- Remove timeouts and hold threads indefinitely.
- Issue all retry attempts in parallel immediately.
- Retry telemetry shows spaced attempts with eventual success or a controlled terminal error.
- Retry every 4xx response forever.
Explanation
Correct Answers
A:Use bounded exponential backoff with jitter, an explicit timeout, and an idempotent request design. This is the concrete implementation required for SDK adaptive retries.
D:Retry telemetry shows spaced attempts with eventual success or a controlled terminal error. This is the workload-specific evidence needed to validate the change.
Incorrect Answers
B:Remove timeouts and hold threads indefinitely. This is not a suitable implementation or validation step for SDK adaptive retries; it would leave the risk that immediate unbounded retries amplify throttling and can repeat non-idempotent operations.
C:Issue all retry attempts in parallel immediately. This is not a suitable implementation or validation step for SDK adaptive retries; it would leave the risk that immediate unbounded retries amplify throttling and can repeat non-idempotent operations.
E:Retry every 4xx response forever. This is not a suitable implementation or validation step for SDK adaptive retries; it would leave the risk that immediate unbounded retries amplify throttling and can repeat non-idempotent operations.
Question 638
A Lambda image processor spills temporary files to /tmp and fails when intermediate images exceed configured space. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Configure Lambda ephemeral storage capacity appropriately and clean temporary files between invocations.
- Put all temporary files in the deployment package directory expecting it to be writable.
- Peak /tmp usage remains within configured capacity during the largest supported input.
- Increase the API Gateway request timeout to add /tmp disk space.
- Use CloudFront invalidation to enlarge Lambda scratch storage.
Explanation
Correct Answers
A:Configure Lambda ephemeral storage capacity appropriately and clean temporary files between invocations. This is the concrete implementation required for Lambda ephemeral disk sizing.
C:Peak /tmp usage remains within configured capacity during the largest supported input. This is the workload-specific evidence needed to validate the change.
Incorrect Answers
B:Put all temporary files in the deployment package directory expecting it to be writable. This is not a suitable implementation or validation step for Lambda ephemeral disk sizing; it would leave the risk that insufficient /tmp space causes disk write failures regardless of the function's available heap.
D:Increase the API Gateway request timeout to add /tmp disk space. This is not a suitable implementation or validation step for Lambda ephemeral disk sizing; it would leave the risk that insufficient /tmp space causes disk write failures regardless of the function's available heap.
E:Use CloudFront invalidation to enlarge Lambda scratch storage. This is not a suitable implementation or validation step for Lambda ephemeral disk sizing; it would leave the risk that insufficient /tmp space causes disk write failures regardless of the function's available heap.
Question 639
A serverless handler loads a vendor token but currently prints all environment variables on errors. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Add more verbose logs of complete bearer tokens.
- Rely on a KMS key to retroactively hide already logged plaintext.
- Make the log group public so failures are easier to share.
- Controlled failure tests produce usable trace metadata but no credential material in logs.
- Redact secret-bearing environment values and authorization headers from structured application logs.
Explanation
Correct Answers
D:Controlled failure tests produce usable trace metadata but no credential material in logs. This is the workload-specific evidence needed to validate the change.
E:Redact secret-bearing environment values and authorization headers from structured application logs. This is the concrete implementation required for Lambda environment secret leakage.
Incorrect Answers
A:Add more verbose logs of complete bearer tokens. This is not a suitable implementation or validation step for Lambda environment secret leakage; it would leave the risk that dumping secrets into CloudWatch Logs exposes credentials to log readers.
B:Rely on a KMS key to retroactively hide already logged plaintext. This is not a suitable implementation or validation step for Lambda environment secret leakage; it would leave the risk that dumping secrets into CloudWatch Logs exposes credentials to log readers.
C:Make the log group public so failures are easier to share. This is not a suitable implementation or validation step for Lambda environment secret leakage; it would leave the risk that dumping secrets into CloudWatch Logs exposes credentials to log readers.
Question 640
A single infrastructure template must deploy a dev and prod stack with different memory settings. Select TWO statements that together form a sound implementation and validation plan for this requirement.
- Hand-edit each deployed resource in the console after every commit.
- Parameterize the CloudFormation or SAM template and supply environment-specific values at deployment.
- Duplicate production secrets in template descriptions.
- Change DNS cache time-to-live instead of template parameters.
- The change set shows the intended resource values for the selected environment without modifying source templates.
Explanation
Correct Answers
B:Parameterize the CloudFormation or SAM template and supply environment-specific values at deployment. This is the concrete implementation required for CloudFormation resource parameters.
E:The change set shows the intended resource values for the selected environment without modifying source templates.
Incorrect Answers
A:Hand-edit each deployed resource in the console after every commit. This is not a suitable implementation or validation step for CloudFormation resource parameters; it would leave the risk that hardcoding production resource names in a shared template can cause cross-environment collisions.
C:Duplicate production secrets in template descriptions. This is not a suitable implementation or validation step for CloudFormation resource parameters; it would leave the risk that hardcoding production resource names in a shared template can cause cross-environment collisions.
D:Change DNS cache time-to-live instead of template parameters. This is not a suitable implementation or validation step for CloudFormation resource parameters; it would leave the risk that hardcoding production resource names in a shared template can cause cross-environment collisions.