Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 15
Question 140
A streaming application needs per-customer record order while spreading load across independent partitions. Which developer action MOST directly meets the stated constraint?
- Expect global order across unrelated shards.
- Select a stable partition key for each entity and distribute different keys across Kinesis shards.
- Write a stable event ID with a conditional DynamoDB write and skip a side effect when that ID was processed.
- Publish all records with a single literal partition key.
Explanation
Correct Answer
B:Select a stable partition key for each entity and distribute different keys across Kinesis shards. Kinesis ordering is guaranteed within a shard and partition key choices determine shard affinity. For this second operating case, verify that records for one entity remain ordered while shard-level incoming and processing rates stay within quotas.
Incorrect Answers
A:Expect global order across unrelated shards. This shortcut would leave the Kinesis shard partitioning requirement unresolved; using one constant partition key creates a hot shard even when more shards are available.
C:This technique primarily addresses idempotent event handling; it would not demonstrate Kinesis shard partitioning or directly prove that records for one entity remain ordered while shard-level incoming and processing rates stay within quotas.
D:Publish all records with a single literal partition key. This shortcut would leave the Kinesis shard partitioning requirement unresolved; using one constant partition key creates a hot shard even when more shards are available.
Question 141
An image-processing queue has a handful of permanently invalid payloads that consume every available retry. Which developer action MOST directly meets the stated constraint?
- Increase batch size indefinitely without isolating failures.
- Select a stable partition key for each entity and distribute different keys across Kinesis shards.
- Configure a source queue redrive policy and a dead-letter queue with an appropriate maxReceiveCount.
- Delete all failures before preserving diagnostics.
Explanation
Correct Answer
C:Configure a source queue redrive policy and a dead-letter queue with an appropriate maxReceiveCount. A dead-letter queue isolates messages that cannot be processed after bounded delivery attempts. For this second operating case, verify that poisoned messages appear in the DLQ after the chosen receives while valid events continue.
Incorrect Answers
A:Increase batch size indefinitely without isolating failures. This shortcut would leave the SQS dead-letter queues requirement unresolved; without redrive, poison messages are repeatedly delivered and hide useful errors.
B:This technique primarily addresses Kinesis shard partitioning; it would not demonstrate SQS dead-letter queues or directly prove that poisoned messages appear in the DLQ after the chosen receives while valid events continue.
D:Delete all failures before preserving diagnostics. This shortcut would leave the SQS dead-letter queues requirement unresolved; without redrive, poison messages are repeatedly delivered and hide useful errors.
Question 142
A browser-based app stores temporary tokens and should not reuse one after its expiry time. Which developer action MOST directly meets the stated constraint?
- Validate token expiry and use the provider's supported refresh flow rather than accepting expired tokens.
- Set access tokens to never expire because users dislike sign-in.
- Assume a scoped IAM role through STS with a trust policy permitting the source principal.
- Accept tokens without verifying their signature.
Explanation
Correct Answer
A:Validate token expiry and use the provider's supported refresh flow rather than accepting expired tokens. Bearer tokens are bounded credentials and server-side expiry checks cannot be replaced by client clock trust. For this second operating case, verify that the client obtains a fresh access token and the protected API rejects an expired one.
Incorrect Answers
B:Set access tokens to never expire because users dislike sign-in. This shortcut would leave the bearer token refresh and expiry requirement unresolved; ignoring exp claims leaves a path for stale tokens to be reused as authorization.
C:This technique primarily addresses IAM STS AssumeRole cross-account; it would not demonstrate bearer token refresh and expiry or directly prove that the client obtains a fresh access token and the protected API rejects an expired one.
D:Accept tokens without verifying their signature. This shortcut would leave the bearer token refresh and expiry requirement unresolved; ignoring exp claims leaves a path for stale tokens to be reused as authorization.
Question 143
A video metadata parser needs faster execution and its CPU allocation is too small at the current memory size. Which developer action MOST directly meets the stated constraint?
- Add a public S3 ACL to accelerate processing.
- Publish compatible dependencies as a versioned Lambda layer and attach the required layer version to functions.
- Increase the Lambda memory setting experimentally and benchmark latency and cost at several settings.
- Double the function timeout without changing CPU allocation.
Explanation
Correct Answer
C: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. For this second operating case, verify that 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 shortcut would leave the Lambda memory CPU tuning requirement unresolved; holding memory at the minimum can constrain compute even when the function has spare heap.
B:This technique primarily addresses Lambda layer dependency management; it would not demonstrate Lambda memory CPU tuning or directly prove that duration and billed-duration measurements improve at a tested memory setting without breaching budget.
D:Double the function timeout without changing CPU allocation. This shortcut would leave the Lambda memory CPU tuning requirement unresolved; holding memory at the minimum can constrain compute even when the function has spare heap.
Question 144
A task board needs lookups by assignee and due-date while the base table is keyed by task ID. Which developer action MOST directly meets the stated constraint?
- Add a Global Secondary Index with the required alternate partition and sort keys.
- Use strongly consistent reads on every GSI query.
- Use DynamoDB ConditionExpression with an expected state or version for the atomic update.
- Add a Local Secondary Index to an existing table after creation.
Explanation
Correct Answer
A: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. For this second operating case, verify that queries against the index return the requested items without scanning unrelated base-table partitions.
Incorrect Answers
B:Use strongly consistent reads on every GSI query. This shortcut would leave the DynamoDB GSI access pattern requirement unresolved; querying a nonkey base attribute without an index forces a scan or invalid key expression.
C:This technique primarily addresses DynamoDB conditional update; it would not demonstrate DynamoDB GSI access pattern or directly prove that queries against the index return the requested items without scanning unrelated base-table partitions.
D:Add a Local Secondary Index to an existing table after creation. This shortcut would leave the DynamoDB GSI access pattern requirement unresolved; querying a nonkey base attribute without an index forces a scan or invalid key expression.
Question 145
A product system routes events to different consumers based on detail-type and account metadata. Which developer action MOST directly meets the stated constraint?
- Configure every event to invoke every target irrespective of type.
- Put events on an EventBridge bus and create rules matching the required event patterns to targets.
- Put filtering logic only in the front-end browser.
- Publish the event to SNS and subscribe separate SQS queues for each independently processed concern.
Explanation
Correct Answer
B:Put events on an EventBridge bus and create rules matching the required event patterns to targets. EventBridge rules route structured events by matching attributes without embedding consumer addresses in producer code. For this second operating case, verify that rule-matching events reach the intended targets while nonmatching event types do not.
Incorrect Answers
A:Configure every event to invoke every target irrespective of type. This shortcut would leave the EventBridge event routing requirement unresolved; a producer hardcoded to one downstream endpoint cannot independently route new event types.
C:Put filtering logic only in the front-end browser. This shortcut would leave the EventBridge event routing requirement unresolved; a producer hardcoded to one downstream endpoint cannot independently route new event types.
D:This technique primarily addresses SNS fanout delivery; it would not demonstrate EventBridge event routing or directly prove that rule-matching events reach the intended targets while nonmatching event types do not.
Question 146
An IaC-managed stack has configuration differences from its recorded template. Which developer action MOST directly meets the stated constraint?
- Run sam validate and template linting before packaging and deploying the application.
- Manually edit each resource again after every pipeline run.
- Assume a successful unit test proves there is no stack drift.
- Run CloudFormation drift detection for supported resource types and reconcile unexpected changes into the source template.
Explanation
Correct Answer
D:Run CloudFormation drift detection for supported resource types and reconcile unexpected changes into the source template. IaC tracks declared infrastructure; out-of-band console edits can cause state divergence. For this second operating case, verify that drift results identify divergent supported properties and a later deployment restores intended state.
Incorrect Answers
A:This technique primarily addresses SAM template validation; it would not demonstrate infrastructure drift detection or directly prove that drift results identify divergent supported properties and a later deployment restores intended state.
B:Manually edit each resource again after every pipeline run. This shortcut would leave the infrastructure drift detection requirement unresolved; manual configuration changes may be overwritten or missed by the next IaC deployment.
C:Assume a successful unit test proves there is no stack drift. This shortcut would leave the infrastructure drift detection requirement unresolved; manual configuration changes may be overwritten or missed by the next IaC deployment.
Question 147
A CDN caches a public product listing that differs according to a small set of approved request headers. Which developer action MOST directly meets the stated constraint?
- Apply an SNS subscription filter policy on the relevant message attributes or payload fields.
- Disable origin validation and accept all cached variants.
- Configure cache keys or origin request policies using the required safe variation dimensions.
- Cache every authenticated response under one key.
Explanation
Correct Answer
C:Configure cache keys or origin request policies using the required safe variation dimensions. Cache-key design determines which requests may share cached content. For this second operating case, verify that cache tests show each allowed variant returns its own response without cross-user leakage.
Incorrect Answers
A:This technique primarily addresses SNS subscription filter policy; it would not demonstrate API response caching variation or directly prove that cache tests show each allowed variant returns its own response without cross-user leakage.
B:Disable origin validation and accept all cached variants. This shortcut would leave the API response caching variation requirement unresolved; ignoring a response-varying header can serve incorrect or sensitive content from cache.
D:Cache every authenticated response under one key. This shortcut would leave the API response caching variation requirement unresolved; ignoring a response-varying header can serve incorrect or sensitive content from cache.
Question 148
A production application rotates a certificate on a load-balanced HTTPS endpoint without a plaintext fallback. Which developer action MOST directly meets the stated constraint?
- Put the certificate's private key in client JavaScript.
- Provision and validate the certificate using AWS Certificate Manager and associate the renewed certificate with the endpoint.
- Encrypt in the client with properly protected keys before uploading ciphertext to storage.
- Disable HTTPS verification permanently on every client.
Explanation
Correct Answer
B:Provision and validate the certificate using AWS Certificate Manager and associate the renewed certificate with the endpoint. TLS certificates authenticate endpoint names and protect traffic in transit. For this second operating case, verify that tLS handshakes present a valid chain and expected hostname before and after rotation.
Incorrect Answers
A:Put the certificate's private key in client JavaScript. This shortcut would leave the TLS certificate rotation ACM requirement unresolved; an expired or mismatched certificate causes client TLS verification failures.
C:This technique primarily addresses client-side versus server-side encryption; it would not demonstrate TLS certificate rotation ACM or directly prove that tLS handshakes present a valid chain and expected hostname before and after rotation.
D:Disable HTTPS verification permanently on every client. This shortcut would leave the TLS certificate rotation ACM requirement unresolved; an expired or mismatched certificate causes client TLS verification failures.
Question 149
A support incident needs all function log events associated with one failed customer request. Which developer action MOST directly meets the stated constraint?
- Query CloudWatch Logs Insights with structured fields and the request correlation identifier.
- Increase Lambda memory without examining any error evidence.
- Delete the error log group to restart the handler.
- Trace the caller identity, the requested S3 action, and the KMS key permissions with CloudTrail evidence.
Explanation
Correct Answer
A:Query CloudWatch Logs Insights with structured fields and the request correlation identifier. Correlation IDs allow developers to join related log records and reduce noisy searches. For this second operating case, verify that the query isolates timestamps and the exact error records associated with the failed request.
Incorrect Answers
B:Increase Lambda memory without examining any error evidence. This shortcut would leave the CloudWatch Logs Insights root cause requirement unresolved; searching broad unstructured text without a request key obscures the relevant failure path.
C:Delete the error log group to restart the handler. This shortcut would leave the CloudWatch Logs Insights root cause requirement unresolved; searching broad unstructured text without a request key obscures the relevant failure path.
D:This technique primarily addresses AccessDenied troubleshooting chain; it would not demonstrate CloudWatch Logs Insights root cause or directly prove that the query isolates timestamps and the exact error records associated with the failed request.
Question 150
A mobile app wants managed account registration, confirmation, and JWT access tokens for backend endpoints. Which developer action MOST directly meets the stated constraint?
- Store all user passwords in Lambda environment variables.
- Define an API Gateway resource policy with explicit conditions for approved source VPC endpoints.
- Use an Amazon Cognito user pool as the user directory and authenticate users to obtain tokens.
- Use an identity pool alone as a password-based user directory.
Explanation
Correct Answer
C:Use an Amazon Cognito user pool as the user directory and authenticate users to obtain tokens. Cognito user pools handle user sign-in and tokens, while identity pools serve temporary AWS credentials. For this second operating case, verify that a successfully signed-in user receives correctly issued tokens whose signature, issuer, audience, and expiry validate.
Incorrect Answers
A:Store all user passwords in Lambda environment variables. This shortcut would leave the Cognito user pool authentication requirement unresolved; confusing a user pool with an identity pool leaves the app without the expected login and user-directory flow.
B:This technique primarily addresses API Gateway resource policy; it would not demonstrate Cognito user pool authentication or directly prove that a successfully signed-in user receives correctly issued tokens whose signature, issuer, audience, and expiry validate.
D:Use an identity pool alone as a password-based user directory. This shortcut would leave the Cognito user pool authentication requirement unresolved; confusing a user pool with an identity pool leaves the app without the expected login and user-directory flow.