Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free Amazon AWS Certified Developer - Associate DVA-C02 Exam Questions

Last updated: · 11 practice questions with answers and explanations

Page: 1 / 40 Total 600 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Development with AWS Services

Skill tested: Selects DynamoDB write patterns that preserve idempotency during retried Lambda invocations.

A ticketing service receives payment-provider callbacks through an AWS Lambda function. The provider retries a callback when it does not receive a timely response, so the same event can reach the function more than once. The application stores ticket status in a DynamoDB table, and each callback includes a unique event ID. The function must not apply the same status transition twice, and the team wants to avoid a separate read before every write. Which approach best meets these requirements?

Correct Answer: B. Use a conditional DynamoDB write that records the event ID only if it has not already been processed, and treat a conditional-check failure as a duplicate.
Explanation:

A conditional write makes the idempotency check and state change atomic at DynamoDB, so concurrent or retried deliveries cannot both apply the same event. The function can interpret a conditional-check failure as an already-processed event. An unconditional PutItem can overwrite prior state, while a read followed by an unconditional update has a race between those operations. Reserved concurrency limits parallelism but does not prevent later retries from applying the event again.

Question 2

New Multiple answers

Topic: Development with AWS Services

Skill tested: Configures Lambda event source processing to handle partial failures and avoid unnecessary batch retries.

A Lambda function consumes records from an Amazon SQS standard queue in batches. A small number of records occasionally fail because of invalid business data, while the remaining records can be processed successfully. The team needs successful records removed promptly, failed records retried, and persistently failing messages eventually isolated for investigation. The function already returns per-record batch failure information. Which TWO actions should the team take? Select TWO.

Correct Answer: B. Configure a redrive policy with a dead-letter queue and an appropriate maximum receive count.; D. Enable the event source mapping's report-batch-item-failures response type so Lambda uses the function's per-record failure identifiers.
Explanation:

For SQS event source mappings, enabling ReportBatchItemFailures lets the function identify only the records that failed, rather than forcing successful records in the batch to be retried. A redrive policy moves repeatedly unsuccessful messages to a dead-letter queue after the configured receive threshold. A zero visibility timeout can cause rapid repeated delivery and concurrent processing. Failing the whole batch defeats partial-batch handling, and reserved concurrency does not guarantee ordering for a standard queue.

Question 3

New Single answer

Topic: Development with AWS Services

Skill tested: Chooses API Gateway integration behavior appropriate for a synchronous Lambda-backed API.

A mobile application calls a REST API that invokes a Lambda function to validate a request and return a structured response containing an HTTP status code, headers, and JSON body. The API must pass the request payload to the function without maintaining a separate mapping template for each request field. The team also wants the function's response fields to control the client-visible response. Which API Gateway configuration is most appropriate?

Correct Answer: A. Use a Lambda proxy integration and have the function return the expected proxy response structure.
Explanation:

A Lambda proxy integration passes the request context and payload to the function and expects a structured response from the function, including status code, headers, and body. That directly satisfies the requirement to avoid field-by-field request mappings and let the function shape the API response. A non-proxy integration generally relies on configured mappings. Asynchronous invocation is not suitable when the client requires the function's synchronous result, and Lambda does not need to be exposed through a public endpoint for API Gateway integration.

Question 4

New Single answer

Topic: Security

Skill tested: Applies least-privilege IAM permissions to Lambda access to encrypted application secrets.

A Lambda function needs a database password stored as a SecureString parameter in AWS Systems Manager Parameter Store. The parameter uses a customer managed AWS KMS key. The function must retrieve the value at runtime, and the security team requires least-privilege access without embedding credentials in the deployment package. Which configuration should the developer use?

Correct Answer: D. Grant the function execution role permission to read the specific parameter and decrypt with the specific KMS key, and have the function retrieve the value at runtime.
Explanation:

The Lambda execution role is the identity used by the function to call Parameter Store and KMS. Its policy should scope parameter-read permission to the required parameter and kms:Decrypt to the customer managed key; the key policy must also allow the role as appropriate. Runtime retrieval avoids bundling the password in the artifact. Broad account-wide permissions violate least privilege. The Lambda service principal is not the function's runtime identity, and SecureString access remains subject to authorization controls.

Question 5

New Multiple answers

Topic: Security

Skill tested: Combines API Gateway authorization and request validation to protect a public API.

A company exposes a REST API through Amazon API Gateway. Only users authenticated by the company's Amazon Cognito user pool may call protected methods, and malformed JSON requests should be rejected before they invoke Lambda. The team wants API Gateway to perform these checks without adding authentication logic to every function. Which TWO configurations should be applied? Select TWO.

Correct Answer: A. Configure a Cognito user pool authorizer on the protected methods and require valid authorization tokens.; C. Enable API Gateway request validation using request models and required parameters for the relevant methods.
Explanation:

A Cognito user pool authorizer lets API Gateway validate the caller's token before invoking the integration. Request models and configured parameter requirements allow API Gateway request validation to reject malformed or incomplete requests early; validation does not replace application-level validation for business rules. Public Lambda functions would expand exposure and duplicate authorization logic. API keys primarily identify or meter usage and are not user authentication. Access logging records requests but does not enforce either control.

Question 6

New Single answer

Topic: Security

Skill tested: Uses API Gateway resource policies to restrict access to an API by source network.

An internal REST API is deployed in API Gateway and must be callable only by clients whose requests originate from the company's known corporate public IP ranges. The API uses an API Gateway endpoint that is otherwise reachable over the public internet. The company does not want to distribute credentials to these clients or require a VPN redesign. Which control most directly enforces the stated source restriction?

Correct Answer: A. Attach an API Gateway resource policy that allows requests from the approved source IP ranges and denies other sources.
Explanation:

An API Gateway resource policy can restrict access to an API using source IP conditions, directly enforcing the network-origin requirement at the API boundary. A usage plan API key is not a dependable substitute for source-based access control and is not user authentication. Lambda functions do not have security groups unless configured within a VPC, and security groups would not filter the original client source at the API Gateway endpoint. Access logging provides visibility, not access enforcement.

Question 7

New Single answer

Topic: Deployment

Skill tested: Builds Lambda deployment artifacts with runtime-compatible dependencies and package structure.

A development team deploys a Python Lambda function as a ZIP package. The function works on a developer workstation but fails in AWS with an import error for a native library. The library was installed locally on a different operating system and packaged alongside the handler. The team must keep using ZIP-based deployment and wants repeatable builds in its CI pipeline. What is the best corrective action?

Correct Answer: A. Install the native dependency in a build environment compatible with the Lambda runtime and architecture, then package it with the handler in the required directory structure.
Explanation:

Native Python extensions must be built for an environment compatible with the Lambda runtime and selected instruction-set architecture. A repeatable CI build should install dependencies in a compatible build environment and create a ZIP with the handler and dependencies arranged so the runtime can import them. More timeout does not make an incompatible binary loadable. Environment variables cannot contain library code, and packaging a workstation installation may preserve the same OS or ABI mismatch and include unnecessary files.

Question 8

New Multiple answers

Topic: Deployment

Skill tested: Uses deployment automation and staged testing to validate Lambda changes before production traffic.

A team deploys a Lambda-backed API with AWS CodeDeploy. Production traffic must remain on the current Lambda version unless the new version passes automated integration tests. If testing fails after traffic shifting begins, the prior version should receive traffic again. The team can make a small API request against a candidate version before shifting production traffic. Which TWO actions best satisfy these requirements? Select TWO.

Correct Answer: B. Use a deployment configuration with traffic shifting and automatic rollback on deployment failure, with alarms or hook failures as rollback triggers.; C. Publish a new Lambda version and configure a Lambda alias for the production endpoint.
Explanation:

Published versions provide immutable candidates, while an alias gives the production integration a stable reference that CodeDeploy can shift between versions. A canary or linear deployment configuration combined with rollback triggers lets CodeDeploy restore the previous version when deployment alarms or lifecycle checks fail. The scenario's pre-shift validation can be implemented with a lifecycle hook, but the selected pair focuses on versioned alias traffic management and automated rollback. Updating the alias manually first exposes unvalidated code; $LATEST is mutable and does not provide rollback history.

Question 9

New Single answer

Topic: Deployment

Skill tested: Selects API Gateway stage deployment practices that separate tested changes from production.

A service team manages an API Gateway REST API and publishes changes frequently. Developers need to test method, integration, and authorizer changes without changing the API used by production clients. Production updates must occur only after validation, and the team wants to retain a clear deployment boundary for each environment. Which approach is most appropriate?

Correct Answer: C. Create separate API Gateway stages for nonproduction and production, deploy changes to the test stage first, and promote a validated deployment to production.
Explanation:

API Gateway stages provide deployment-specific environments and can be associated with separate stage settings and endpoints. Deploying and validating changes in a nonproduction stage keeps production configuration unchanged until promotion is approved. Editing production in place exposes clients to unvalidated changes, while access logs are diagnostic rather than an isolation mechanism. Separate Lambda functions do not isolate API Gateway method or authorizer configuration, and usage plans control access and throttling rather than stage configuration.

Question 10

New Single answer

Topic: Troubleshooting and Optimization

Skill tested: Diagnoses Lambda throttling by distinguishing concurrency limits from function execution failures.

An API experiences intermittent HTTP 429 responses during predictable traffic peaks. Lambda metrics show a high Throttles count, while the function's Errors metric remains low and successful invocations have normal duration. The function has reserved concurrency configured, and other functions in the account have unused concurrency capacity. The team wants to remove the throttling without allowing this workload to consume concurrency reserved for critical functions. What should the team do first?

Correct Answer: A. Increase the function's reserved concurrency to a value that fits within the account's available unreserved concurrency and the workload's needs.
Explanation:

A high Throttles count with few function errors indicates invocations are being rejected before execution because concurrency capacity is unavailable. Raising this function's reserved concurrency, within the available account concurrency, can give it adequate capacity while preserving explicitly reserved capacity for critical functions. Removing reservations broadly undermines the stated isolation requirement. Function timeouts and API Gateway integration timeouts affect execution duration or client waiting, not the concurrency allocation that causes throttling.

Question 11

New Single answer

Topic: Troubleshooting and Optimization

Skill tested: Uses structured Lambda logs and correlation identifiers to trace failures across API requests.

A production API invokes several Lambda functions in sequence. Users report occasional incorrect responses, but each function currently writes unstructured text to CloudWatch Logs and does not include a shared request identifier. The operations team must trace a single client request across functions and quickly filter logs for failures, without adding a separate tracing service. What is the most appropriate instrumentation change?

Correct Answer: D. Emit structured JSON log records from each function, include a propagated request or correlation ID, and record relevant error context.
Explanation:

Structured JSON logs make fields searchable in CloudWatch Logs, and propagating a shared correlation identifier lets operators follow one request across multiple function invocations. Recording error context supports root-cause analysis without requiring a separate tracing system. Memory allocation does not change how logs are correlated. Lambda execution environments are not a shared durable filesystem across functions, and API Gateway access logs do not automatically contain downstream functions' application-level error details.