AWS Certified Developer - Associate DVA-C02 Practice Test 26
Question 250
An independent QA lead must observe a reproducible before-and-after result with controlled test inputs prior to signing the release. A reservation workflow must conditionally decrement available seats and write its booking record as one unit. What test most directly confirms the intended behavior?
- Cause one conditional action to fail and confirm that none of the transaction's item updates persist.
- Publish a test layer version, invoke with the exact runtime and CPU architecture, and verify dependencies import.
- Publish ordered updates for two account IDs and verify each account's local sequence is processed consistently.
- Inject one poison message in a five-item batch and verify only failed IDs are retried after successful messages commit.
Explanation
Correct Answer
A:The decisive acceptance evidence is: Cause one conditional action to fail and confirm that none of the transaction's item updates persist. It demonstrates: A DynamoDB transaction commits the supported grouped writes together or rejects the entire operation. Scenario: A reservation workflow must conditionally decrement available seats and write its booking record as one unit.
Incorrect Answers
B:Option B is an acceptance test for Lambda layers and runtime dependency packaging: Publish a test layer version, invoke with the exact runtime and CPU architecture, and verify dependencies import. It is not direct evidence for: A reservation workflow must conditionally decrement available seats and write its booking record as one unit.
C:Option C is an acceptance test for Kinesis per-shard ordering: Publish ordered updates for two account IDs and verify each account's local sequence is processed consistently. It is not direct evidence for: A reservation workflow must conditionally decrement available seats and write its booking record as one unit.
D:Option D is an acceptance test for Lambda partial batch failures for SQS: Inject one poison message in a five-item batch and verify only failed IDs are retried after successful messages commit. It is not direct evidence for: A reservation workflow must conditionally decrement available seats and write its booking record as one unit.
Question 251
A staging acceptance reviewer must demonstrate working end-to-end behavior rather than cite a configuration screenshot, using a controlled test before deployment. A support portal searches thousands of free-text tickets by partial phrase and relevance. Which observation is the strongest acceptance evidence?
- Index a controlled set of documents and confirm phrase searches return the expected relevant records.
- Replay the same payment event twice and verify a single business transaction is persisted.
- Publish matching and nonmatching synthetic queue events and confirm only matching records invoke the function.
- Generate a harmless unit-test helper and run lint, tests, and a human diff review prior to deployment.
Explanation
Correct Answer
A:The decisive acceptance evidence is: Index a controlled set of documents and confirm phrase searches return the expected relevant records. It demonstrates: An inverted text index supports term queries and relevance that primary-key lookups alone cannot provide. Scenario: A support portal searches thousands of free-text tickets by partial phrase and relevance.
Incorrect Answers
B:Option B is an acceptance test for SQS idempotent consumer design: Replay the same payment event twice and verify a single business transaction is persisted. It is not direct evidence for: A support portal searches thousands of free-text tickets by partial phrase and relevance.
C:Option C is an acceptance test for Lambda event filtering: Publish matching and nonmatching synthetic queue events and confirm only matching records invoke the function. It is not direct evidence for: A support portal searches thousands of free-text tickets by partial phrase and relevance.
D:Option D is an acceptance test for Amazon Q Developer generated code review: Generate a harmless unit-test helper and run lint, tests, and a human diff review prior to deployment. It is not direct evidence for: A support portal searches thousands of free-text tickets by partial phrase and relevance.
Question 252
A development team must select an AWS application change. An ECS deployment unexpectedly picks up a new library because the image always uses latest as its tag. Which implementation best addresses this situation?
- Build a versioned ECR container image with pinned base image and runtime dependencies for deployment.
- Configure CodeBuild with the required runtime, minimal IAM access, and commands to run unit and integration tests on the intended revision.
- Use blue-green deployment of a previous verified application revision to support rollback when the new environment fails checks.
- Store environment-scoped feature flags in AWS AppConfig and deploy them using a validated application configuration strategy.
Explanation
Correct Answer
A:Immutable image tags or digests help ensure test and production run exactly the reviewed code and package versions. Apply: Build a versioned ECR container image with pinned base image and runtime dependencies for deployment. Acceptance check: Build a test image, inspect its digest, and deploy that exact digest to staging before production promotion. Scenario: An ECS deployment unexpectedly picks up a new library because the image always uses latest as its tag.
Incorrect Answers
B:Option B implements a different developer control (CodeBuild integration test environment): Configure CodeBuild with the required runtime, minimal IAM access, and commands to run unit and integration tests on the intended revision. That does not resolve the specific situation: An ECS deployment unexpectedly picks up a new library because the image always uses latest as its tag.
C:Option C implements a different developer control (CodeDeploy blue-green rollback): Use blue-green deployment of a previous verified application revision to support rollback when the new environment fails checks. That does not resolve the specific situation: An ECS deployment unexpectedly picks up a new library because the image always uses latest as its tag.
D:Option D implements a different developer control (AppConfig environment feature flags): Store environment-scoped feature flags in AWS AppConfig and deploy them using a validated application configuration strategy. That does not resolve the specific situation: An ECS deployment unexpectedly picks up a new library because the image always uses latest as its tag.
Question 253
A production readiness review identifies a potential software defect. An SQS Lambda passes a direct-call test but fails in production because the fixture lacks event records. Which implementation risk must be rejected first?
- Do not point a staging custom domain at production Lambda by accident during testing.
- Do not rebuild an image under the same mutable tag after testing and assume the released bytes are identical.
- Do not test an SQS-triggered Lambda with a bare business JSON object that omits the Records envelope.
- Do not build from an untracked developer workstation or reuse a mutable release tag for unrelated code.
Explanation
Correct Answer
C:Do not test an SQS-triggered Lambda with a bare business JSON object that omits the Records envelope. This is significant because A fixture exercises the exact envelope the event source sends, including metadata and nested record structures. Scenario: An SQS Lambda passes a direct-call test but fails in production because the fixture lacks event records.
Incorrect Answers
A:Option A warns about an unrelated failure boundary (API Gateway stage variables and versions): Do not point a staging custom domain at production Lambda by accident during testing. It is not the key risk in: An SQS Lambda passes a direct-call test but fails in production because the fixture lacks event records.
B:Option B warns about an unrelated failure boundary (ECR image digest deployment): Do not rebuild an image under the same mutable tag after testing and assume the released bytes are identical. It is not the key risk in: An SQS Lambda passes a direct-call test but fails in production because the fixture lacks event records.
D:Option D warns about an unrelated failure boundary (Git commit and release tagging): Do not build from an untracked developer workstation or reuse a mutable release tag for unrelated code. It is not the key risk in: An SQS Lambda passes a direct-call test but fails in production because the fixture lacks event records.
Question 254
An engineering reviewer is evaluating service behavior and authorization boundaries. A service role has a boundary mentioning S3 but no actual S3 Allow statement and receives AccessDenied. Which mechanism explains the appropriate design decision?
- S3 permissions and KMS key permissions are separate, so an otherwise permitted GetObject may fail during decryption.
- Identity claims determine tenant authorization independently of which resource key a user guesses or sends in a URL.
- Input validation and bound parameters prevent user-controlled text from being interpreted as SQL or unsafe output markup.
- An IAM permissions boundary limits the permissions the identity policy can grant; it does not grant permissions by itself.
Explanation
Correct Answer
D:An IAM permissions boundary limits the permissions the identity policy can grant; it does not grant permissions by itself. This is the operating principle for IAM permission boundary intersection. Validation: Attach an excessive policy to a bounded test role and show a forbidden action is still denied. Scenario: A service role has a boundary mentioning S3 but no actual S3 Allow statement and receives AccessDenied.
Incorrect Answers
A:Option A explains S3 SSE-KMS encryption key access rather than this issue: S3 permissions and KMS key permissions are separate, so an otherwise permitted GetObject may fail during decryption. It does not explain: A service role has a boundary mentioning S3 but no actual S3 Allow statement and receives AccessDenied.
B:Option B explains Multi-tenant partitioning guard rather than this issue: Identity claims determine tenant authorization independently of which resource key a user guesses or sends in a URL. It does not explain: A service role has a boundary mentioning S3 but no actual S3 Allow statement and receives AccessDenied.
C:Option C explains Input sanitization before data persistence rather than this issue: Input validation and bound parameters prevent user-controlled text from being interpreted as SQL or unsafe output markup. It does not explain: A service role has a boundary mentioning S3 but no actual S3 Allow statement and receives AccessDenied.
Question 255
A development team must select an AWS application change. A customer API accepts a JWT from an unrelated app client because its authorizer checks only the username field. Which implementation best addresses this situation?
- Authenticate application users through a Cognito user pool and validate issued ID or access tokens against the correct intended audience and issuer.
- Avoid storing raw encryption keys in application code or environment files; retrieve or wrap keys through appropriate KMS-backed mechanisms.
- Attach an ACM-managed certificate matching the custom domain to the intended supported API or load balancer endpoint.
- Limit an application IAM policy to the exact required actions and resource ARN scope, including prefixes when supported.
Explanation
Correct Answer
A:User pools handle application sign-in and token issuance; a backend must verify signatures, issuer, token use, and audience or client identity. Apply: Authenticate application users through a Cognito user pool and validate issued ID or access tokens against the correct intended audience and issuer. Acceptance check: Submit valid, expired, and wrong-client tokens and verify only the intended token is accepted by the backend. Scenario: A customer API accepts a JWT from an unrelated app client because its authorizer checks only the username field.
Incorrect Answers
B:Option B 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 customer API accepts a JWT from an unrelated app client because its authorizer checks only the username field.
C:Option C implements a different developer control (AWS Certificate Manager HTTPS certificate binding): Attach an ACM-managed certificate matching the custom domain to the intended supported API or load balancer endpoint. That does not resolve the specific situation: A customer API accepts a JWT from an unrelated app client because its authorizer checks only the username field.
D:Option D 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 customer API accepts a JWT from an unrelated app client because its authorizer checks only the username field.
Question 256
An AWS developer is reviewing the next application release. A release declares success despite a failing 10-percent canary because no CloudWatch alarm is attached. Which technical change most directly meets the requirement?
- Use a Lambda canary deployment strategy with weighted traffic shifting and rollback triggers for a risky release.
- Review a CloudFormation change set before updating a shared application stack to identify replacements and permission changes.
- Place an authorized manual approval gate between successful automated test and production deployment actions.
- Use a staging environment with stubbed vendor responses to verify both success and failure branches of an integration.
Explanation
Correct Answer
A:CodeDeploy can send a limited share of traffic to a new version and shift more only after healthy checks. Apply: Use a Lambda canary deployment strategy with weighted traffic shifting and rollback triggers for a risky release. Acceptance check: Deploy a deliberately failing canary and verify the alarm stops traffic shifting and restores the stable version. Scenario: A release declares success despite a failing 10-percent canary because no CloudWatch alarm is attached.
Incorrect Answers
B:Option B implements a different developer control (SAM and CloudFormation change set review): Review a CloudFormation change set before updating a shared application stack to identify replacements and permission changes. That does not resolve the specific situation: A release declares success despite a failing 10-percent canary because no CloudWatch alarm is attached.
C:Option C implements a different developer control (CodePipeline cross-stage approval): Place an authorized manual approval gate between successful automated test and production deployment actions. That does not resolve the specific situation: A release declares success despite a failing 10-percent canary because no CloudWatch alarm is attached.
D:Option D implements a different developer control (Integration test API dependency contract): Use a staging environment with stubbed vendor responses to verify both success and failure branches of an integration. That does not resolve the specific situation: A release declares success despite a failing 10-percent canary because no CloudWatch alarm is attached.
Question 257
An engineering reviewer is evaluating service behavior and authorization boundaries. A service trace logs private access tokens as metadata rather than safe nonsecret correlation fields. Which mechanism explains the appropriate design decision?
- Subscription filtering reduces irrelevant deliveries and downstream processing while preserving intended event fanout.
- Structured log fields and time filters let engineers isolate relevant exceptions rather than searching every log line manually.
- Sampling limits tracing volume while secure context propagation and data minimization preserve observability integrity.
- AccessDenied often reflects the precise action, resource, and policy boundary rather than an application coding syntax error.
Explanation
Correct Answer
C:Sampling limits tracing volume while secure context propagation and data minimization preserve observability integrity. This is the operating principle for App-level trace sampling and privacy. Validation: Generate repeated traceable requests and confirm sampled segments include correlation but not secrets. Scenario: A service trace logs private access tokens as metadata rather than safe nonsecret correlation fields.
Incorrect Answers
A:Option A explains SNS subscription filter policy rather than this issue: Subscription filtering reduces irrelevant deliveries and downstream processing while preserving intended event fanout. It does not explain: A service trace logs private access tokens as metadata rather than safe nonsecret correlation fields.
B:Option B explains CloudWatch Logs Insights fault search rather than this issue: Structured log fields and time filters let engineers isolate relevant exceptions rather than searching every log line manually. It does not explain: A service trace logs private access tokens as metadata rather than safe nonsecret correlation fields.
D:Option D explains IAM AccessDenied CloudTrail triage rather than this issue: AccessDenied often reflects the precise action, resource, and policy boundary rather than an application coding syntax error. It does not explain: A service trace logs private access tokens as metadata rather than safe nonsecret correlation fields.
Question 258
An engineering reviewer is evaluating service behavior and authorization boundaries. A Lambda package runs unit tests yet times out when processing a real-size document with insufficient memory. Which mechanism explains the appropriate design decision?
- AppConfig can change runtime configuration separately from packaged code and use monitored rollout/rollback controls.
- CodeDeploy can send a limited share of traffic to a new version and shift more only after healthy checks.
- An artifact can build successfully while its runtime resource limits lead to OOM or throttled execution after release.
- Separate API stages let developers exercise route changes without directing tests at production functions and data.
Explanation
Correct Answer
C:An artifact can build successfully while its runtime resource limits lead to OOM or throttled execution after release. This is the operating principle for Application deployment memory sizing. Validation: Deploy a representative load test with the proposed runtime limits and inspect memory and CPU saturation. Scenario: A Lambda package runs unit tests yet times out when processing a real-size document with insufficient memory.
Incorrect Answers
A:Option A explains AppConfig progressive rollout rollback rather than this issue: AppConfig can change runtime configuration separately from packaged code and use monitored rollout/rollback controls. It does not explain: A Lambda package runs unit tests yet times out when processing a real-size document with insufficient memory.
B:Option B explains CodeDeploy canary Lambda traffic shifting rather than this issue: CodeDeploy can send a limited share of traffic to a new version and shift more only after healthy checks. It does not explain: A Lambda package runs unit tests yet times out when processing a real-size document with insufficient memory.
D:Option D explains API Gateway staging endpoint verification rather than this issue: Separate API stages let developers exercise route changes without directing tests at production functions and data. It does not explain: A Lambda package runs unit tests yet times out when processing a real-size document with insufficient memory.
Question 259
A staging acceptance reviewer must demonstrate working end-to-end behavior rather than cite a configuration screenshot, using a controlled test before deployment. A search API concatenates a user-entered surname into an SQL WHERE clause and behaves unexpectedly for an apostrophe. Which observation is the strongest acceptance evidence?
- Submit strings with quotes and markup into a safe test API and confirm storage and output remain correctly encoded.
- Invoke the same API with two customer identities and verify neither can retrieve the other's object identifiers.
- Invoke a test function and verify a sensitive value is never emitted in its response or CloudWatch logs.
- Sign in as an authenticated test user and verify their temporary AWS credentials can reach only the expected S3 resources.
Explanation
Correct Answer
A:The decisive acceptance evidence is: Submit strings with quotes and markup into a safe test API and confirm storage and output remain correctly encoded. It demonstrates: Input validation and bound parameters prevent user-controlled text from being interpreted as SQL or unsafe output markup. Scenario: A search API concatenates a user-entered surname into an SQL WHERE clause and behaves unexpectedly for an apostrophe.
Incorrect Answers
B:Option B is an acceptance test for Fine-grained application tenant authorization: Invoke the same API with two customer identities and verify neither can retrieve the other's object identifiers. It is not direct evidence for: A search API concatenates a user-entered surname into an SQL WHERE clause and behaves unexpectedly for an apostrophe.
C:Option C is an acceptance test for Secrets in Lambda environment variables: Invoke a test function and verify a sensitive value is never emitted in its response or CloudWatch logs. It is not direct evidence for: A search API concatenates a user-entered surname into an SQL WHERE clause and behaves unexpectedly for an apostrophe.
D:Option D is an acceptance test for Cognito identity pool scoped AWS access: Sign in as an authenticated test user and verify their temporary AWS credentials can reach only the expected S3 resources. It is not direct evidence for: A search API concatenates a user-entered surname into an SQL WHERE clause and behaves unexpectedly for an apostrophe.
Question 260
A staging acceptance reviewer must demonstrate working end-to-end behavior rather than cite a configuration screenshot, using a controlled test before deployment. A CodeBuild project uploads an artifact despite the npm test command failing in a hidden shell substep. Which observation is the strongest acceptance evidence?
- Deliberately break a test and confirm the build fails before any deployment stage starts.
- Run a fixture representing missing and valid fields and assert deterministic output and error handling.
- Enable a test flag only in staging and confirm production's flag stays unchanged during rollback.
- Launch a new test stack and compare its logical resources and configured permissions with the reviewed template.
Explanation
Correct Answer
A:The decisive acceptance evidence is: Deliberately break a test and confirm the build fails before any deployment stage starts. It demonstrates: Buildspec phases and runtime images determine how repeatably CI executes tests and packages artifacts. Scenario: A CodeBuild project uploads an artifact despite the npm test command failing in a hidden shell substep.
Incorrect Answers
B:Option B is an acceptance test for SAM local unit tests and mocks: Run a fixture representing missing and valid fields and assert deterministic output and error handling. It is not direct evidence for: A CodeBuild project uploads an artifact despite the npm test command failing in a hidden shell substep.
C:Option C is an acceptance test for AppConfig environment feature flags: Enable a test flag only in staging and confirm production's flag stays unchanged during rollback. It is not direct evidence for: A CodeBuild project uploads an artifact despite the npm test command failing in a hidden shell substep.
D:Option D is an acceptance test for Deploy test environment with CloudFormation: Launch a new test stack and compare its logical resources and configured permissions with the reviewed template. It is not direct evidence for: A CodeBuild project uploads an artifact despite the npm test command failing in a hidden shell substep.