Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 2
Question 10
A developer service calls an external throttled API and must recover from transient 429 responses without a request storm. Which implementation approach BEST addresses this requirement?
- Retry every 4xx response forever.
- Issue all retry attempts in parallel immediately.
- Remove timeouts and hold threads indefinitely.
- Use bounded exponential backoff with jitter, an explicit timeout, and an idempotent request design.
Explanation
Correct Answer
D:Use bounded exponential backoff with jitter, an explicit timeout, and an idempotent request design. Jittered bounded retries spread transient failure load instead of synchronized retry spikes. A confirming test would show: Retry telemetry shows spaced attempts with eventual success or a controlled terminal error.
Incorrect Answers
A:Retry every 4xx response forever. This suggestion does not establish the required SDK adaptive retries; the relevant risk is that immediate unbounded retries amplify throttling and can repeat non-idempotent operations.
B:Issue all retry attempts in parallel immediately. This suggestion does not establish the required SDK adaptive retries; the relevant risk is that immediate unbounded retries amplify throttling and can repeat non-idempotent operations.
C:Remove timeouts and hold threads indefinitely. This suggestion does not establish the required SDK adaptive retries; the relevant risk is that immediate unbounded retries amplify throttling and can repeat non-idempotent operations.
Question 11
An API connects to RDS with a password that must rotate without a source-code change. Which implementation approach BEST addresses this requirement?
- Store the secret in Secrets Manager and use a supported rotation workflow with least-privilege GetSecretValue.
- Use a plaintext build log as the secret vault.
- Require customers to read the secret from a public URL.
- Commit rotated passwords to the Git repository.
Explanation
Correct Answer
A:Store the secret in Secrets Manager and use a supported rotation workflow with least-privilege GetSecretValue. Secrets Manager versions and rotation workflows manage sensitive values outside deployment artifacts. A confirming test would show: Rotated secret versions become available to authorized consumers and the application refreshes its cached credential.
Incorrect Answers
B:Use a plaintext build log as the secret vault. This suggestion does not establish the required Secrets Manager rotation; the relevant risk is that a long-lived credential hardcoded into a container image stays stale after rotation.
C:Require customers to read the secret from a public URL. This suggestion does not establish the required Secrets Manager rotation; the relevant risk is that a long-lived credential hardcoded into a container image stays stale after rotation.
D:Commit rotated passwords to the Git repository. This suggestion does not establish the required Secrets Manager rotation; the relevant risk is that a long-lived credential hardcoded into a container image stays stale after rotation.
Question 12
A support portal must list cases by status across customers but the base primary key is case ID. Which implementation approach BEST addresses this requirement?
- Add a Local Secondary Index to an existing table after creation.
- Add a Global Secondary Index with the required alternate partition and sort keys.
- Expect a projection expression to convert a nonkey field into a key.
- Use strongly consistent reads on every GSI query.
Explanation
Correct Answer
B:Add a Global Secondary Index with the required alternate partition and sort keys. A GSI supports an alternate key-based access pattern with separately managed capacity and eventual consistency. A confirming test would show: Queries against the index return the requested items without scanning unrelated base-table partitions.
Incorrect Answers
A:Add a Local Secondary Index to an existing table after creation. This suggestion does not establish the required DynamoDB GSI access pattern; the relevant risk is that querying a nonkey base attribute without an index forces a scan or invalid key expression.
C:Expect a projection expression to convert a nonkey field into a key. This suggestion does not establish the required DynamoDB GSI access pattern; the relevant risk is that querying a nonkey base attribute without an index forces a scan or invalid key expression.
D:Use strongly consistent reads on every GSI query. This suggestion does not establish the required DynamoDB GSI access pattern; the relevant risk is that querying a nonkey base attribute without an index forces a scan or invalid key expression.
Question 13
A SAM update rolls back because a new Lambda event source resource cannot be created. Which implementation approach BEST addresses this requirement?
- Change only the API base URL for an IAM resource creation error.
- Raise a DynamoDB item TTL to repair a template validation failure.
- Ignore stack events and deploy the same malformed template repeatedly.
- Inspect CloudFormation stack events and failed resource status to identify the underlying deployment error.
Explanation
Correct Answer
D:Inspect CloudFormation stack events and failed resource status to identify the underlying deployment error. Stack resource events reveal deployment-level failures that application logs might never contain. A confirming test would show: The failed resource event includes a concrete status reason that matches the attempted operation.
Incorrect Answers
A:Change only the API base URL for an IAM resource creation error. This suggestion does not establish the required failed CloudFormation deployment; the relevant risk is that debugging handler business code cannot fix a stack resource creation permission error.
B:Raise a DynamoDB item TTL to repair a template validation failure. This suggestion does not establish the required failed CloudFormation deployment; the relevant risk is that debugging handler business code cannot fix a stack resource creation permission error.
C:Ignore stack events and deploy the same malformed template repeatedly. This suggestion does not establish the required failed CloudFormation deployment; the relevant risk is that debugging handler business code cannot fix a stack resource creation permission error.
Question 14
A CPU-heavy Lambda builds thumbnails and consistently uses its full timeout despite low memory consumption. Which implementation approach BEST addresses this requirement?
- Add a public S3 ACL to accelerate processing.
- Increase the Lambda memory setting experimentally and benchmark latency and cost at several settings.
- Double the function timeout without changing CPU allocation.
- Increase API Gateway stage cache size to give Lambda more CPU.
Explanation
Correct Answer
B:Increase the Lambda memory setting experimentally and benchmark latency and cost at several settings. Lambda CPU allocation scales with configured memory and can speed CPU-bound functions. A confirming test would show: Duration and billed-duration measurements improve at a tested memory setting without breaching budget.
Incorrect Answers
A:Add a public S3 ACL to accelerate processing. This suggestion does not establish the required Lambda memory CPU tuning; the relevant risk is that holding memory at the minimum can constrain compute even when the function has spare heap.
C:Double the function timeout without changing CPU allocation. This suggestion does not establish the required Lambda memory CPU tuning; the relevant risk is that holding memory at the minimum can constrain compute even when the function has spare heap.
D:Increase API Gateway stage cache size to give Lambda more CPU. This suggestion does not establish the required Lambda memory CPU tuning; the relevant risk is that holding memory at the minimum can constrain compute even when the function has spare heap.
Question 15
One API Gateway deployment serves test and production stages that use different backend Lambda aliases. Which implementation approach BEST addresses this requirement?
- Configure stage-specific variables or integrations pointing to the intended Lambda alias and grant invoke permissions.
- Delete all API stages and keep one mutable production endpoint.
- Change only a deployment description and assume backend ARNs update automatically.
- Treat CloudFront cache invalidation as an integration alias update.
Explanation
Correct Answer
A:Configure stage-specific variables or integrations pointing to the intended Lambda alias and grant invoke permissions. API Gateway stage configuration can parameterize integrations for separate environments. A confirming test would show: Test and production invoke the correct Lambda alias without unintended cross-stage traffic.
Incorrect Answers
B:Delete all API stages and keep one mutable production endpoint. This suggestion does not establish the required API Gateway stage variables; the relevant risk is that a hardcoded backend alias in a shared integration can route test traffic into production.
C:Change only a deployment description and assume backend ARNs update automatically. This suggestion does not establish the required API Gateway stage variables; the relevant risk is that a hardcoded backend alias in a shared integration can route test traffic into production.
D:Treat CloudFront cache invalidation as an integration alias update. This suggestion does not establish the required API Gateway stage variables; the relevant risk is that a hardcoded backend alias in a shared integration can route test traffic into production.
Question 16
A web service downloads private S3 objects that are encrypted using an AWS KMS key. Which implementation approach BEST addresses this requirement?
- Ensure the principal has S3 object permission and the required KMS decrypt permission on the encryption key.
- Set a cache TTL on CloudFront to override KMS authorization.
- Make the object public to grant KMS Decrypt implicitly.
- Change S3 object metadata without altering key permissions.
Explanation
Correct Answer
A:Ensure the principal has S3 object permission and the required KMS decrypt permission on the encryption key. SSE-KMS authorization involves both S3 API access and KMS cryptographic authorization. A confirming test would show: The object can be retrieved and decrypted by the approved principal without broad KMS rights.
Incorrect Answers
B:Set a cache TTL on CloudFront to override KMS authorization. This suggestion does not establish the required S3 SSE-KMS access; the relevant risk is that a role allowed to GetObject but denied KMS Decrypt cannot read the plaintext.
C:Make the object public to grant KMS Decrypt implicitly. This suggestion does not establish the required S3 SSE-KMS access; the relevant risk is that a role allowed to GetObject but denied KMS Decrypt cannot read the plaintext.
D:Change S3 object metadata without altering key permissions. This suggestion does not establish the required S3 SSE-KMS access; the relevant risk is that a role allowed to GetObject but denied KMS Decrypt cannot read the plaintext.
Question 17
An onboarding workflow invokes verification, account creation, and compensation with observable retries. Which implementation approach BEST addresses this requirement?
- Trigger all dependent steps concurrently without preserving ordering.
- Use AWS Step Functions to coordinate states, retries, catches, and compensating tasks explicitly.
- Poll a local variable in a single Lambda for human approval.
- Put the entire state machine inside one synchronous API Gateway mapping.
Explanation
Correct Answer
B:Use AWS Step Functions to coordinate states, retries, catches, and compensating tasks explicitly. A managed state machine expresses multi-step application coordination beyond a single long-running handler. A confirming test would show: Execution history shows state transitions, retries, and the branch taken after an error.
Incorrect Answers
A:Trigger all dependent steps concurrently without preserving ordering. This suggestion does not establish the required Step Functions orchestration; the relevant risk is that a one-shot Lambda chain obscures per-step recovery and can exceed execution constraints.
C:Poll a local variable in a single Lambda for human approval. This suggestion does not establish the required Step Functions orchestration; the relevant risk is that a one-shot Lambda chain obscures per-step recovery and can exceed execution constraints.
D:Put the entire state machine inside one synchronous API Gateway mapping. This suggestion does not establish the required Step Functions orchestration; the relevant risk is that a one-shot Lambda chain obscures per-step recovery and can exceed execution constraints.
Question 18
An application role in account B must decrypt objects encrypted under a customer-managed KMS key in account A. Which implementation approach BEST addresses this requirement?
- Add only s3:GetObject and assume it grants kms:Decrypt.
- Authorize the external principal through the KMS key policy and the caller's IAM permissions for the needed cryptographic operation.
- Turn on public bucket read to bypass the KMS key policy.
- Copy the key's internal material into the application log.
Explanation
Correct Answer
B:Authorize the external principal through the KMS key policy and the caller's IAM permissions for the needed cryptographic operation. Cross-account KMS use needs key-policy authorization in the owning account and corresponding caller permissions. A confirming test would show: The external role can use the approved KMS key while unrelated principals remain denied.
Incorrect Answers
A:Add only s3:GetObject and assume it grants kms:Decrypt. This suggestion does not establish the required KMS key-policy cross-account; the relevant risk is that an S3 object permission alone does not give decrypt access to its KMS key.
C:Turn on public bucket read to bypass the KMS key policy. This suggestion does not establish the required KMS key-policy cross-account; the relevant risk is that an S3 object permission alone does not give decrypt access to its KMS key.
D:Copy the key's internal material into the application log. This suggestion does not establish the required KMS key-policy cross-account; the relevant risk is that an S3 object permission alone does not give decrypt access to its KMS key.
Question 19
A Lambda image processor spills temporary files to /tmp and fails when intermediate images exceed configured space. Which implementation approach BEST addresses this requirement?
- Increase the API Gateway request timeout to add /tmp disk space.
- Put all temporary files in the deployment package directory expecting it to be writable.
- Configure Lambda ephemeral storage capacity appropriately and clean temporary files between invocations.
- Use CloudFront invalidation to enlarge Lambda scratch storage.
Explanation
Correct Answer
C:Configure Lambda ephemeral storage capacity appropriately and clean temporary files between invocations. Lambda ephemeral storage is separately configurable from memory and has finite per-environment capacity. A confirming test would show: Peak /tmp usage remains within configured capacity during the largest supported input.
Incorrect Answers
A:Increase the API Gateway request timeout to add /tmp disk space. This suggestion does not establish the required Lambda ephemeral disk sizing; the relevant risk is that insufficient /tmp space causes disk write failures regardless of the function's available heap.
B:Put all temporary files in the deployment package directory expecting it to be writable. This suggestion does not establish the required Lambda ephemeral disk sizing; the relevant risk is that insufficient /tmp space causes disk write failures regardless of the function's available heap.
D:Use CloudFront invalidation to enlarge Lambda scratch storage. This suggestion does not establish the required Lambda ephemeral disk sizing; the relevant risk is that insufficient /tmp space causes disk write failures regardless of the function's available heap.
Question 20
A deployment build must install dependencies, execute tests, and package a versioned Lambda artifact. Which implementation approach BEST addresses this requirement?
- Mark every test command with ignore-error behavior.
- Use CodeDeploy health checks as a replacement for compiling source.
- Upload artifacts before dependencies are installed.
- Define buildspec phases that install, test, and package artifacts in the correct order with failure propagation.
Explanation
Correct Answer
D:Define buildspec phases that install, test, and package artifacts in the correct order with failure propagation. CodeBuild buildspec phases and exit codes control which artifacts advance in CI. A confirming test would show: The build fails on a seeded test failure and publishes an artifact only after tests succeed.
Incorrect Answers
A:Mark every test command with ignore-error behavior. This suggestion does not establish the required CodeBuild buildspec sequencing; the relevant risk is that packaging before test validation can promote artifacts containing known defects.
B:Use CodeDeploy health checks as a replacement for compiling source. This suggestion does not establish the required CodeBuild buildspec sequencing; the relevant risk is that packaging before test validation can promote artifacts containing known defects.
C:Upload artifacts before dependencies are installed. This suggestion does not establish the required CodeBuild buildspec sequencing; the relevant risk is that packaging before test validation can promote artifacts containing known defects.