Amazon AWS Certified Developer - Associate DVA-C02 Practice Test 5
Question 40
A request crosses API Gateway and several Lambda-backed service calls but its latency cannot be attributed. Which implementation approach BEST addresses this requirement?
- Enable supported tracing and propagate trace context through service calls and instrumentation.
- Turn off tracing in every downstream service.
- Replace trace context with a fixed user password.
- Generate an unrelated trace ID for every internal call.
Explanation
Correct Answer
A:Enable supported tracing and propagate trace context through service calls and instrumentation. Trace propagation links work across components; isolated logs alone cannot reconstruct spans reliably. A confirming test would show: A trace view shows related segments or subsegments with timing for the connected service path.
Incorrect Answers
B:Turn off tracing in every downstream service. This suggestion does not establish the required X-Ray trace propagation; the relevant risk is that missing trace context between calls breaks a distributed trace even when local segments exist.
C:Replace trace context with a fixed user password. This suggestion does not establish the required X-Ray trace propagation; the relevant risk is that missing trace context between calls breaks a distributed trace even when local segments exist.
D:Generate an unrelated trace ID for every internal call. This suggestion does not establish the required X-Ray trace propagation; the relevant risk is that missing trace context between calls breaks a distributed trace even when local segments exist.
Question 41
An asynchronously invoked Lambda repeatedly fails and operators need the failed event context. Which implementation approach BEST addresses this requirement?
- Configure a synchronous API Gateway response header as an async destination.
- Increase provisioned concurrency to guarantee application correctness.
- Delete application logs to reduce retry errors.
- Configure an asynchronous on-failure destination and permitted target delivery for terminal failures.
Explanation
Correct Answer
D:Configure an asynchronous on-failure destination and permitted target delivery for terminal failures. Asynchronous Lambda destinations provide structured success or failure outcomes for supported invocation modes. A confirming test would show: The failure destination receives an invocation record after retries or age limits are exhausted.
Incorrect Answers
A:Configure a synchronous API Gateway response header as an async destination. This suggestion does not establish the required Lambda asynchronous failure destination; the relevant risk is that a missing destination silently loses terminal failure context beyond default handling.
B:Increase provisioned concurrency to guarantee application correctness. This suggestion does not establish the required Lambda asynchronous failure destination; the relevant risk is that a missing destination silently loses terminal failure context beyond default handling.
C:Delete application logs to reduce retry errors. This suggestion does not establish the required Lambda asynchronous failure destination; the relevant risk is that a missing destination silently loses terminal failure context beyond default handling.
Question 42
A Lambda function reads customer profiles from one DynamoDB table but receives AccessDenied for GetItem. Which implementation approach BEST addresses this requirement?
- Embed a permanent administrator access key in source code.
- Attach a least-privilege policy to the Lambda execution role for the required API actions and resource ARN.
- Grant public bucket access to fix an IAM role policy.
- Change the Lambda handler name without checking permissions.
Explanation
Correct Answer
B:Attach a least-privilege policy to the Lambda execution role for the required API actions and resource ARN. Lambda code obtains AWS credentials from its execution role rather than hardcoded keys. A confirming test would show: CloudTrail or SDK results confirm the expected action succeeds while unrelated resources remain denied.
Incorrect Answers
A:Embed a permanent administrator access key in source code. This suggestion does not establish the required Lambda execution role least privilege; the relevant risk is that the execution role lacks a required resource permission and AWS denies the API call.
C:Grant public bucket access to fix an IAM role policy. This suggestion does not establish the required Lambda execution role least privilege; the relevant risk is that the execution role lacks a required resource permission and AWS denies the API call.
D:Change the Lambda handler name without checking permissions. This suggestion does not establish the required Lambda execution role least privilege; the relevant risk is that the execution role lacks a required resource permission and AWS denies the API call.
Question 43
A team uses Amazon Q Developer to propose a test suite for a refactored Python handler. Which implementation approach BEST addresses this requirement?
- Commit customer secrets as fixtures to improve realism.
- Review AI-generated tests for assertions, data privacy, and realistic events before adding them to CI.
- Assume generated tests always cover every production edge case.
- Disable code review because test source was AI-generated.
Explanation
Correct Answer
B:Review AI-generated tests for assertions, data privacy, and realistic events before adding them to CI. Generated tests require human review and meaningful assertions to avoid false confidence. A confirming test would show: The accepted tests fail on a known bug and pass once the defect is fixed without leaking secrets.
Incorrect Answers
A:Commit customer secrets as fixtures to improve realism. This suggestion does not establish the required AI-assisted test review; the relevant risk is that an AI test that only checks process exit can pass while functional behavior is wrong.
C:Assume generated tests always cover every production edge case. This suggestion does not establish the required AI-assisted test review; the relevant risk is that an AI test that only checks process exit can pass while functional behavior is wrong.
D:Disable code review because test source was AI-generated. This suggestion does not establish the required AI-assisted test review; the relevant risk is that an AI test that only checks process exit can pass while functional behavior is wrong.
Question 44
A product API needs all purchases for a known customer ID and must avoid reading an entire table. Which implementation approach BEST addresses this requirement?
- Use DynamoDB Query with the customer partition key and an appropriate sort-key condition.
- Call BatchWriteItem to retrieve customer records.
- Put the customer identifier only into an unused document attribute.
- Filter a full-table Scan after reading every item.
Explanation
Correct Answer
A:Use DynamoDB Query with the customer partition key and an appropriate sort-key condition. Query uses key conditions while Scan examines items beyond the requested partition. A confirming test would show: Read capacity and response results are limited to the target key range rather than the whole table.
Incorrect Answers
B:Call BatchWriteItem to retrieve customer records. This suggestion does not establish the required DynamoDB Query versus Scan; the relevant risk is that using Scan for a predictable partition lookup wastes read capacity and creates latency.
C:Put the customer identifier only into an unused document attribute. This suggestion does not establish the required DynamoDB Query versus Scan; the relevant risk is that using Scan for a predictable partition lookup wastes read capacity and creates latency.
D:Filter a full-table Scan after reading every item. This suggestion does not establish the required DynamoDB Query versus Scan; the relevant risk is that using Scan for a predictable partition lookup wastes read capacity and creates latency.
Question 45
A team needs to test v2 of an API while consumers still use the production stage. Which implementation approach BEST addresses this requirement?
- Delete the API deployment after each individual request.
- Deploy API changes to an isolated API Gateway stage with stage-specific configuration.
- Point every test client at production without a stage boundary.
- Treat API custom-domain DNS as a replacement for deployed stages.
Explanation
Correct Answer
B:Deploy API changes to an isolated API Gateway stage with stage-specific configuration. API Gateway stages provide deployment boundaries and can hold environment-specific settings. A confirming test would show: Test requests route to the test deployment while production routes keep serving the previous version.
Incorrect Answers
A:Delete the API deployment after each individual request. This suggestion does not establish the required API Gateway staging endpoints; the relevant risk is that updating the production stage for every test exposes incomplete behavior to consumers.
C:Point every test client at production without a stage boundary. This suggestion does not establish the required API Gateway staging endpoints; the relevant risk is that updating the production stage for every test exposes incomplete behavior to consumers.
D:Treat API custom-domain DNS as a replacement for deployed stages. This suggestion does not establish the required API Gateway staging endpoints; the relevant risk is that updating the production stage for every test exposes incomplete behavior to consumers.
Question 46
A table stores millions of tenant messages but most writes share one constant partition key. Which implementation approach BEST addresses this requirement?
- Choose a high-cardinality partition-key design that spreads requests while preserving required access patterns.
- Replace Query with Scan and assume hot-key writes disappear.
- Add a DynamoDB TTL attribute to raise per-key write throughput.
- Use one constant partition key for every customer.
Explanation
Correct Answer
A:Choose a high-cardinality partition-key design that spreads requests while preserving required access patterns. DynamoDB partition-key choice influences physical request distribution and hot-key throttling. A confirming test would show: Consumed capacity and throttling metrics distribute more evenly across partition keys.
Incorrect Answers
B:Replace Query with Scan and assume hot-key writes disappear. This suggestion does not establish the required DynamoDB partition key cardinality; the relevant risk is that a low-cardinality or hot partition key concentrates traffic despite available table capacity.
C:Add a DynamoDB TTL attribute to raise per-key write throughput. This suggestion does not establish the required DynamoDB partition key cardinality; the relevant risk is that a low-cardinality or hot partition key concentrates traffic despite available table capacity.
D:Use one constant partition key for every customer. This suggestion does not establish the required DynamoDB partition key cardinality; the relevant risk is that a low-cardinality or hot partition key concentrates traffic despite available table capacity.
Question 47
A consumer app needs password sign-in and standards-based tokens for its own users. Which implementation approach BEST addresses this requirement?
- Store all user passwords in Lambda environment variables.
- Use an Amazon Cognito user pool as the user directory and authenticate users to obtain tokens.
- Publish unauthenticated API requests as sufficient proof of identity.
- Use an identity pool alone as a password-based user directory.
Explanation
Correct Answer
B: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. A confirming test would show: 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 suggestion does not establish the required Cognito user pool authentication; the relevant risk is that confusing a user pool with an identity pool leaves the app without the expected login and user-directory flow.
C:Publish unauthenticated API requests as sufficient proof of identity. This suggestion does not establish the required Cognito user pool authentication; the relevant risk is that confusing a user pool with an identity pool leaves the app without the expected login and user-directory flow.
D:Use an identity pool alone as a password-based user directory. This suggestion does not establish the required Cognito user pool authentication; the relevant risk is that confusing a user pool with an identity pool leaves the app without the expected login and user-directory flow.
Question 48
An application writes free-form messages that make it hard to filter errors by tenant-safe operation code. Which implementation approach BEST addresses this requirement?
- Disable error logs and rely solely on customer screenshots.
- Serialize full bearer tokens into every structured log record.
- Emit consistent structured JSON logs with timestamp, request ID, operation, severity, and redacted error fields.
- Use an S3 bucket name as the only error severity field.
Explanation
Correct Answer
C:Emit consistent structured JSON logs with timestamp, request ID, operation, severity, and redacted error fields. Structured fields make telemetry queryable while avoiding sensitive payload exposure. A confirming test would show: Log queries can reliably filter the same fields across success and failure events.
Incorrect Answers
A:Disable error logs and rely solely on customer screenshots. This suggestion does not establish the required structured JSON logging; the relevant risk is that unstructured logs with missing correlation fields make incident reconstruction slow.
B:Serialize full bearer tokens into every structured log record. This suggestion does not establish the required structured JSON logging; the relevant risk is that unstructured logs with missing correlation fields make incident reconstruction slow.
D:Use an S3 bucket name as the only error severity field. This suggestion does not establish the required structured JSON logging; the relevant risk is that unstructured logs with missing correlation fields make incident reconstruction slow.
Question 49
A mobile app authenticated by an external provider needs short-lived access to upload its own images to S3. Which implementation approach BEST addresses this requirement?
- Use only a user pool token as an S3 SigV4 signing secret.
- Exchange trusted identities through a Cognito identity pool for role-scoped temporary AWS credentials.
- Embed root account access keys in the app bundle.
- Mark every bucket public to bypass client authorization.
Explanation
Correct Answer
B:Exchange trusted identities through a Cognito identity pool for role-scoped temporary AWS credentials. Cognito identity pools broker temporary AWS credentials for supported identity providers. A confirming test would show: Federated users obtain expiring role credentials constrained to the intended S3 paths.
Incorrect Answers
A:Use only a user pool token as an S3 SigV4 signing secret. This suggestion does not establish the required Cognito identity pool AWS access; the relevant risk is that shipping permanent IAM access keys in a client creates unrestricted reusable credentials.
C:Embed root account access keys in the app bundle. This suggestion does not establish the required Cognito identity pool AWS access; the relevant risk is that shipping permanent IAM access keys in a client creates unrestricted reusable credentials.
D:Mark every bucket public to bypass client authorization. This suggestion does not establish the required Cognito identity pool AWS access; the relevant risk is that shipping permanent IAM access keys in a client creates unrestricted reusable credentials.
Question 50
A search box must find phrases and relevance-ranked matches across an indexed document corpus. Which implementation approach BEST addresses this requirement?
- Run a full table Scan on each keystroke and call it full-text ranking.
- Put every document into a single DynamoDB partition and use Query for relevance.
- Index searchable fields in Amazon OpenSearch Service and query the text index with an appropriate analyzer.
- Use S3 object version IDs as a linguistic analyzer.
Explanation
Correct Answer
C:Index searchable fields in Amazon OpenSearch Service and query the text index with an appropriate analyzer. Full-text search uses analyzed inverted indexes rather than DynamoDB exact-key access. A confirming test would show: Search results return ranked text matches according to indexed tokens and query clauses.
Incorrect Answers
A:Run a full table Scan on each keystroke and call it full-text ranking. This suggestion does not establish the required OpenSearch full-text queries; the relevant risk is that a DynamoDB key-only Query cannot perform arbitrary relevance-ranked text search.
B:Put every document into a single DynamoDB partition and use Query for relevance. This suggestion does not establish the required OpenSearch full-text queries; the relevant risk is that a DynamoDB key-only Query cannot perform arbitrary relevance-ranked text search.
D:Use S3 object version IDs as a linguistic analyzer. This suggestion does not establish the required OpenSearch full-text queries; the relevant risk is that a DynamoDB key-only Query cannot perform arbitrary relevance-ranked text search.