AWS Certified Developer - Associate DVA-C02 Practice Test 36
Question 350
A development team must select an AWS application change. A JSON transformation Lambda runs slowly with memory available but CPU-constrained execution. Which implementation best addresses this situation?
- Use a strongly consistent read on a supported DynamoDB table or local secondary index when immediate read-after-write is required.
- Benchmark Lambda memory settings with representative inputs to improve CPU-bound runtime and total cost.
- Return the required statusCode and correctly encoded body fields from a Lambda proxy integration.
- Attach Lambda to appropriate VPC subnets and security groups with verified routes to its private database.
Explanation
Correct Answer
B:Lambda memory allocation also changes available CPU resources, so larger memory may lower duration at acceptable cost. Apply: Benchmark Lambda memory settings with representative inputs to improve CPU-bound runtime and total cost. Acceptance check: Compare duration, memory usage, and invocation cost for two sizes using the same representative workload. Scenario: A JSON transformation Lambda runs slowly with memory available but CPU-constrained execution.
Incorrect Answers
A:Option A implements a different developer control (DynamoDB strong read consistency): Use a strongly consistent read on a supported DynamoDB table or local secondary index when immediate read-after-write is required. That does not resolve the specific situation: A JSON transformation Lambda runs slowly with memory available but CPU-constrained execution.
C:Option C implements a different developer control (API Gateway Lambda proxy response format): Return the required statusCode and correctly encoded body fields from a Lambda proxy integration. That does not resolve the specific situation: A JSON transformation Lambda runs slowly with memory available but CPU-constrained execution.
D:Option D implements a different developer control (Lambda VPC connectivity to private data): Attach Lambda to appropriate VPC subnets and security groups with verified routes to its private database. That does not resolve the specific situation: A JSON transformation Lambda runs slowly with memory available but CPU-constrained execution.
Question 351
An AWS developer is reviewing the next application release. A Lambda logs its entire process environment whenever a database connection fails, disclosing secrets. Which technical change most directly meets the requirement?
- Avoid storing raw encryption keys in application code or environment files; retrieve or wrap keys through appropriate KMS-backed mechanisms.
- Limit an application IAM policy to the exact required actions and resource ARN scope, including prefixes when supported.
- Configure an API Gateway JWT authorizer that enforces the expected issuer, audience, and route-specific scopes.
- Reference Secrets Manager or Parameter Store for secret values and restrict environment access and log exposure.
Explanation
Correct Answer
D:Application secrets should have controlled retrieval, audit, and rotation rather than appearing in plaintext code or build artifacts. Apply: Reference Secrets Manager or Parameter Store for secret values and restrict environment access and log exposure. Acceptance check: Invoke a test function and verify a sensitive value is never emitted in its response or CloudWatch logs. Scenario: A Lambda logs its entire process environment whenever a database connection fails, disclosing secrets.
Incorrect Answers
A:Option A implements a different developer control (Encryption key in application config): Avoid storing raw encryption keys in application code or environment files; retrieve or wrap keys through appropriate KMS-backed mechanisms. That does not resolve the specific situation: A Lambda logs its entire process environment whenever a database connection fails, disclosing secrets.
B:Option B implements a different developer control (IAM least-privilege resource ARN): Limit an application IAM policy to the exact required actions and resource ARN scope, including prefixes when supported. That does not resolve the specific situation: A Lambda logs its entire process environment whenever a database connection fails, disclosing secrets.
C:Option C implements a different developer control (API Gateway JWT authorizer scope): Configure an API Gateway JWT authorizer that enforces the expected issuer, audience, and route-specific scopes. That does not resolve the specific situation: A Lambda logs its entire process environment whenever a database connection fails, disclosing secrets.
Question 352
An incident review asks which unsafe assumption in an AWS implementation must be prevented. A web app embeds a permanent IAM key to write profile images directly to a private S3 bucket. Which overlooked failure condition is the central concern?
- Do not grant an external tenant access simply by knowing a role ARN or without a scoped trust policy.
- Do not build SQL queries by concatenating untrusted customer input or rely solely on a web UI's client-side validation.
- Do not commit symmetric encryption keys into a container image that is replicated across development accounts.
- Do not issue unrestricted IAM access keys to browser applications just to enable S3 uploads.
Explanation
Correct Answer
D:Do not issue unrestricted IAM access keys to browser applications just to enable S3 uploads. This is significant because Identity pools support federated identities receiving temporary roles, distinct from user-pool authentication token issuance. Scenario: A web app embeds a permanent IAM key to write profile images directly to a private S3 bucket.
Incorrect Answers
A:Option A warns about an unrelated failure boundary (Cross-account STS role trust): Do not grant an external tenant access simply by knowing a role ARN or without a scoped trust policy. It is not the key risk in: A web app embeds a permanent IAM key to write profile images directly to a private S3 bucket.
B:Option B warns about an unrelated failure boundary (Input sanitization before data persistence): Do not build SQL queries by concatenating untrusted customer input or rely solely on a web UI's client-side validation. It is not the key risk in: A web app embeds a permanent IAM key to write profile images directly to a private S3 bucket.
C:Option C warns about an unrelated failure boundary (Encryption key in application config): Do not commit symmetric encryption keys into a container image that is replicated across development accounts. It is not the key risk in: A web app embeds a permanent IAM key to write profile images directly to a private S3 bucket.
Question 353
A development team must select an AWS application change. An API produces intermittent 500 errors but developers scan all log groups without matching the request ID. Which implementation best addresses this situation?
- Add an SNS subscription filter policy that forwards only matching event attributes or message bodies to a target queue.
- Emit valid CloudWatch Embedded Metric Format log objects for business-level custom metrics.
- Use a CloudWatch Logs Insights query with correlated request IDs and error filters to find the failing application invocation.
- Cache expensive hot reads with a defined TTL and invalidate affected keys after underlying writes.
Explanation
Correct Answer
C:Structured log fields and time filters let engineers isolate relevant exceptions rather than searching every log line manually. Apply: Use a CloudWatch Logs Insights query with correlated request IDs and error filters to find the failing application invocation. Acceptance check: Trigger a safe known error then query its request ID and confirm the exception and affected service appear. Scenario: An API produces intermittent 500 errors but developers scan all log groups without matching the request ID.
Incorrect Answers
A:Option A implements a different developer control (SNS subscription filter policy): Add an SNS subscription filter policy that forwards only matching event attributes or message bodies to a target queue. That does not resolve the specific situation: An API produces intermittent 500 errors but developers scan all log groups without matching the request ID.
B:Option B implements a different developer control (CloudWatch embedded metric format): Emit valid CloudWatch Embedded Metric Format log objects for business-level custom metrics. That does not resolve the specific situation: An API produces intermittent 500 errors but developers scan all log groups without matching the request ID.
D:Option D implements a different developer control (ElastiCache invalidation and TTL): Cache expensive hot reads with a defined TTL and invalidate affected keys after underlying writes. That does not resolve the specific situation: An API produces intermittent 500 errors but developers scan all log groups without matching the request ID.
Question 354
A development team must select an AWS application change. One malformed event moves into an SQS DLQ after multiple delivery attempts and operators need its failure cause. Which implementation best addresses this situation?
- Correlate a failed AWS API call with CloudTrail event fields and IAM evaluation to locate missing action or resource authorization.
- Inspect source queue receive counts and dead-letter queue payloads to identify repeatedly failing consumer messages.
- Create a CloudWatch alarm with meaningful error-rate or latency thresholds and an SNS notification for operational response.
- Emit valid CloudWatch Embedded Metric Format log objects for business-level custom metrics.
Explanation
Correct Answer
B:A redrive policy moves messages that repeatedly fail processing so they can be analyzed and replayed safely. Apply: Inspect source queue receive counts and dead-letter queue payloads to identify repeatedly failing consumer messages. Acceptance check: Send one poison message in a test queue and verify maxReceiveCount leads to the configured DLQ. Scenario: One malformed event moves into an SQS DLQ after multiple delivery attempts and operators need its failure cause.
Incorrect Answers
A:Option A implements a different developer control (IAM AccessDenied CloudTrail triage): Correlate a failed AWS API call with CloudTrail event fields and IAM evaluation to locate missing action or resource authorization. That does not resolve the specific situation: One malformed event moves into an SQS DLQ after multiple delivery attempts and operators need its failure cause.
C:Option C implements a different developer control (CloudWatch alarm notification): Create a CloudWatch alarm with meaningful error-rate or latency thresholds and an SNS notification for operational response. That does not resolve the specific situation: One malformed event moves into an SQS DLQ after multiple delivery attempts and operators need its failure cause.
D:Option D implements a different developer control (CloudWatch embedded metric format): Emit valid CloudWatch Embedded Metric Format log objects for business-level custom metrics. That does not resolve the specific situation: One malformed event moves into an SQS DLQ after multiple delivery attempts and operators need its failure cause.
Question 355
A development team must select an AWS application change. A Kinesis Lambda stops making progress because one malformed telemetry record is retried forever. Which implementation best addresses this situation?
- Configure Kinesis-triggered Lambda batch retry limits and failure handling so poison events do not block a shard indefinitely.
- Return the required statusCode and correctly encoded body fields from a Lambda proxy integration.
- Handle S3 object-created notifications through an idempotent processor keyed to the object event or processing state.
- Use Amazon Q Developer as a coding assistant, then manually inspect, test, and security-review generated changes before merging.
Explanation
Correct Answer
A:A stream event-source mapping advances checkpoints after processing; repeated failed batches can stall progress on an affected shard. Apply: Configure Kinesis-triggered Lambda batch retry limits and failure handling so poison events do not block a shard indefinitely. Acceptance check: Inject one bad Kinesis event and confirm bounded retry behavior, checkpoint position, and failure destination evidence. Scenario: A Kinesis Lambda stops making progress because one malformed telemetry record is retried forever.
Incorrect Answers
B:Option B implements a different developer control (API Gateway Lambda proxy response format): Return the required statusCode and correctly encoded body fields from a Lambda proxy integration. That does not resolve the specific situation: A Kinesis Lambda stops making progress because one malformed telemetry record is retried forever.
C:Option C implements a different developer control (S3 object events and duplicate handling): Handle S3 object-created notifications through an idempotent processor keyed to the object event or processing state. That does not resolve the specific situation: A Kinesis Lambda stops making progress because one malformed telemetry record is retried forever.
D:Option D implements a different developer control (Amazon Q Developer generated code review): Use Amazon Q Developer as a coding assistant, then manually inspect, test, and security-review generated changes before merging. That does not resolve the specific situation: A Kinesis Lambda stops making progress because one malformed telemetry record is retried forever.
Question 356
A staging acceptance reviewer must demonstrate working end-to-end behavior rather than cite a configuration screenshot, using a controlled test before deployment. A checkout request spans API Gateway, Lambda, and DynamoDB but only overall latency is recorded. Which observation is the strongest acceptance evidence?
- Generate a test request that invokes API Gateway and Lambda and verify trace spans identify the slow call.
- Invoke a malformed request and a forced Lambda error and verify status, request ID, and integration log differences.
- Trigger a safe known error then query its request ID and confirm the exception and affected service appear.
- Publish events with different types and verify each queue receives only its matching type.
Explanation
Correct Answer
A:The decisive acceptance evidence is: Generate a test request that invokes API Gateway and Lambda and verify trace spans identify the slow call. It demonstrates: A distributed trace relates individual service segments and timing to one end-to-end user request. Scenario: A checkout request spans API Gateway, Lambda, and DynamoDB but only overall latency is recorded.
Incorrect Answers
B:Option B is an acceptance test for API Gateway 4xx versus 5xx root cause: Invoke a malformed request and a forced Lambda error and verify status, request ID, and integration log differences. It is not direct evidence for: A checkout request spans API Gateway, Lambda, and DynamoDB but only overall latency is recorded.
C:Option C is an acceptance test for CloudWatch Logs Insights fault search: Trigger a safe known error then query its request ID and confirm the exception and affected service appear. It is not direct evidence for: A checkout request spans API Gateway, Lambda, and DynamoDB but only overall latency is recorded.
D:Option D is an acceptance test for SNS subscription filter policy: Publish events with different types and verify each queue receives only its matching type. It is not direct evidence for: A checkout request spans API Gateway, Lambda, and DynamoDB but only overall latency is recorded.
Question 357
An engineering reviewer is evaluating service behavior and authorization boundaries. A VPC-attached function loses calls to a public API after moving to private subnets without suitable egress. Which mechanism explains the appropriate design decision?
- Query narrows access by indexed key whereas Scan reads broadly and incurs unnecessary capacity and latency.
- VPC-connected Lambda network interfaces need reachable routes and security-group permissions for database connections.
- A narrow or concentrated partition key can create hot partitions and throttling even when table capacity is sufficient.
- Eventually consistent reads can temporarily return stale data, while supported strong reads trade capacity for freshness.
Explanation
Correct Answer
B:VPC-connected Lambda network interfaces need reachable routes and security-group permissions for database connections. This is the operating principle for Lambda VPC connectivity to private data. Validation: Invoke from the Lambda VPC configuration and test an authorized connection to the required database port. Scenario: A VPC-attached function loses calls to a public API after moving to private subnets without suitable egress.
Incorrect Answers
A:Option A explains DynamoDB query versus scan rather than this issue: Query narrows access by indexed key whereas Scan reads broadly and incurs unnecessary capacity and latency. It does not explain: A VPC-attached function loses calls to a public API after moving to private subnets without suitable egress.
C:Option C explains DynamoDB partition key hot spots rather than this issue: A narrow or concentrated partition key can create hot partitions and throttling even when table capacity is sufficient. It does not explain: A VPC-attached function loses calls to a public API after moving to private subnets without suitable egress.
D:Option D explains DynamoDB strong read consistency rather than this issue: Eventually consistent reads can temporarily return stale data, while supported strong reads trade capacity for freshness. It does not explain: A VPC-attached function loses calls to a public API after moving to private subnets without suitable egress.
Question 358
An independent QA lead must observe a reproducible before-and-after result with controlled test inputs prior to signing the release. A queue's visible backlog shrinks but failed invoices disappear into its DLQ without alerting. What test most directly confirms the intended behavior?
- Send one poison message in a test queue and verify maxReceiveCount leads to the configured DLQ.
- Generate a test request that invokes API Gateway and Lambda and verify trace spans identify the slow call.
- Benchmark fixed representative input across several memory configurations and compare p95 duration and unit cost.
- Send a synthetic failed-checkout metric and confirm its namespace, dimension, and value are queryable.
Explanation
Correct Answer
A:The decisive acceptance evidence is: Send one poison message in a test queue and verify maxReceiveCount leads to the configured DLQ. It demonstrates: A redrive policy moves messages that repeatedly fail processing so they can be analyzed and replayed safely. Scenario: A queue's visible backlog shrinks but failed invoices disappear into its DLQ without alerting.
Incorrect Answers
B:Option B is an acceptance test for X-Ray distributed trace diagnosis: Generate a test request that invokes API Gateway and Lambda and verify trace spans identify the slow call. It is not direct evidence for: A queue's visible backlog shrinks but failed invoices disappear into its DLQ without alerting.
C:Option C is an acceptance test for Lambda performance memory cost tuning: Benchmark fixed representative input across several memory configurations and compare p95 duration and unit cost. It is not direct evidence for: A queue's visible backlog shrinks but failed invoices disappear into its DLQ without alerting.
D:Option D is an acceptance test for CloudWatch embedded metric format: Send a synthetic failed-checkout metric and confirm its namespace, dimension, and value are queryable. It is not direct evidence for: A queue's visible backlog shrinks but failed invoices disappear into its DLQ without alerting.
Question 359
An AWS developer is reviewing the next application release. A single-page app stores bearer tokens forever even after an administrator revokes the user's session. Which technical change most directly meets the requirement?
- Validate and sanitize untrusted request fields with context-appropriate encoding and parameterized database queries.
- Store supported application secrets as encrypted Parameter Store SecureString parameters and control read/decrypt permissions.
- Configure an API Gateway JWT authorizer that enforces the expected issuer, audience, and route-specific scopes.
- Handle short-lived application access tokens and controlled refresh without reusing an expired bearer token indefinitely.
Explanation
Correct Answer
D:Access tokens have bounded validity, and refresh flows must respect revocation and client configuration. Apply: Handle short-lived application access tokens and controlled refresh without reusing an expired bearer token indefinitely. Acceptance check: Expire a test access token and confirm the client obtains a permitted replacement or reauthenticates. Scenario: A single-page app stores bearer tokens forever even after an administrator revokes the user's session.
Incorrect Answers
A:Option A implements a different developer control (Input sanitization before data persistence): Validate and sanitize untrusted request fields with context-appropriate encoding and parameterized database queries. That does not resolve the specific situation: A single-page app stores bearer tokens forever even after an administrator revokes the user's session.
B:Option B implements a different developer control (AWS Systems Manager Parameter Store secure strings): Store supported application secrets as encrypted Parameter Store SecureString parameters and control read/decrypt permissions. That does not resolve the specific situation: A single-page app stores bearer tokens forever even after an administrator revokes the user's session.
C:Option C implements a different developer control (API Gateway JWT authorizer scope): Configure an API Gateway JWT authorizer that enforces the expected issuer, audience, and route-specific scopes. That does not resolve the specific situation: A single-page app stores bearer tokens forever even after an administrator revokes the user's session.
Question 360
A staging acceptance reviewer must demonstrate working end-to-end behavior rather than cite a configuration screenshot, using a controlled test before deployment. A developer's SAM deployment overwrites the production environment because the same stack name is used. Which observation is the strongest acceptance evidence?
- Generate a test change set and verify an intended safe update does not replace the production database.
- Publish two versions and verify the staging alias routes to the expected one without modifying production.
- Deploy a minimal test package and invoke the configured handler while checking import resolution.
- Deploy a test stack and verify its queue, role, and API identifiers differ from production.
Explanation
Correct Answer
D:The decisive acceptance evidence is: Deploy a test stack and verify its queue, role, and API identifiers differ from production. It demonstrates: Infrastructure parameters let the same reviewed template create isolated environments with different endpoints and policies. Scenario: A developer's SAM deployment overwrites the production environment because the same stack name is used.
Incorrect Answers
A:Option A is an acceptance test for SAM and CloudFormation change set review: Generate a test change set and verify an intended safe update does not replace the production database. It is not direct evidence for: A developer's SAM deployment overwrites the production environment because the same stack name is used.
B:Option B is an acceptance test for Lambda aliases for versioned test routing: Publish two versions and verify the staging alias routes to the expected one without modifying production. It is not direct evidence for: A developer's SAM deployment overwrites the production environment because the same stack name is used.
C:Option C is an acceptance test for Lambda dependency archive packaging: Deploy a minimal test package and invoke the configured handler while checking import resolution. It is not direct evidence for: A developer's SAM deployment overwrites the production environment because the same stack name is used.