AWS Developer Associate (DVA-C02) · 12% practice allocation

AWS DVA-C02: Monitoring and Troubleshooting Practice Questions

5 free sample questions from the Monitoring and Troubleshooting domain, with answers and explanations. The full DVA-C02 bank has 275 questions across 5 domains. Questions are scenario-based and written from the official AWS exam guide.

1.

A developer notices that a CloudWatch dashboard shows a Lambda function's Duration metric averaging 2,800 ms, which is close to the configured 3,000 ms timeout. The function loads a 150 MB ML model from S3 on every invocation. Increasing the timeout is not an option due to downstream API Gateway constraints. Which TWO changes will most directly reduce the average duration? (Select TWO)

  • A. Load the ML model outside the Lambda handler function so it is cached in the execution environment across warm invocations.✓ Correct
  • B. Increase the Lambda function's memory allocation from 512 MB to 3,008 MB.✓ Correct
  • C. Store the ML model in an S3 Glacier Instant Retrieval storage class to reduce retrieval latency.
  • D. Attach an Amazon EFS mount to the Lambda function and load the model from EFS instead of S3.
  • E. Enable Lambda SnapStart for the function to restore pre-initialized execution environments.
  • F. Switch the Lambda function trigger from API Gateway to an Application Load Balancer.
Explanation

Correct — Option B: Lambda CPU allocation scales linearly with memory. Increasing memory from 512 MB to 3,008 MB provides ~6× more CPU, which dramatically speeds up model loading and inference computation, directly reducing duration. Correct — Option A: Initializing the model outside the handler (in the global/module scope) causes it to be loaded once per execution environment. Subsequent warm invocations reuse the cached model object, skipping the S3 download entirely and cutting duration significantly. Wrong — Option C: S3 Glacier Instant Retrieval has the same retrieval speed for standard GET requests as S3 Standard for objects already restored, but Glacier is designed for archival data and would actually add complexity. The bottleneck here is the 150 MB download size, not the storage tier. Wrong — Option E: Lambda SnapStart is currently only supported for Java runtimes; it would not apply to most ML workloads and does not address the S3 download cost per invocation. Wrong — Option F: Changing the trigger from API Gateway to an ALB does not affect the duration of the Lambda function itself. Wrong — Option D: Loading from EFS instead of S3 may reduce latency for small files, but a 150 MB model still needs to be read on every invocation unless the model is also cached outside the handler — the caching strategy (Option A) is the key fix regardless of storage backend.

2.

A developer notices that an AWS Lambda function is experiencing frequent cold starts, causing latency spikes for end users of a production REST API backed by API Gateway. The function uses a 128 MB memory allocation and runs for approximately 800 ms on average. Which combination of actions will MOST effectively reduce cold start impact? (Select TWO)

  • A. Set the Lambda function reserved concurrency to 0 to prevent over-scaling
  • B. Enable X-Ray active tracing on the Lambda function
  • C. Enable Lambda Provisioned Concurrency for the function✓ Correct
  • D. Increase the API Gateway integration timeout to 29 seconds
  • E. Increase the Lambda function's memory allocation to 512 MB or higher✓ Correct
  • F. Switch the Lambda function runtime to a compiled language such as Go or Java with GraalVM native image
Explanation

Increasing memory allocation (E) also proportionally increases CPU allocation, which shortens initialization time and reduces the duration of each cold start. Enabling Provisioned Concurrency (C) pre-initializes a specified number of execution environments, eliminating cold starts entirely for those instances. — Switching runtimes (F) can help in some cases but is not a reliable general solution and carries significant refactoring cost; Java without native compilation actually tends to have worse cold starts. Increasing the API Gateway timeout (D) only masks the latency problem rather than solving it. X-Ray tracing (B) adds observability but does not reduce cold starts — it can even add marginal overhead. Setting reserved concurrency to 0 (A) would disable the function entirely, which is incorrect.

3.

A developer is optimizing an Amazon SQS queue used by a fleet of EC2 consumer instances. The consumers are currently using short polling and the team observes that consumers frequently receive empty responses, wasting CPU cycles and incurring unnecessary API costs. Which changes should the developer make? (Select TWO)

  • A. Configure consumers to use the ReceiveMessage API with a WaitTimeSeconds parameter of 20 in each request.✓ Correct
  • B. Enable SQS FIFO queuing to guarantee message ordering, which reduces empty responses.
  • C. Enable long polling on the SQS queue by setting the ReceiveMessageWaitTimeSeconds attribute to 20 seconds.✓ Correct
  • D. Reduce the number of consumer instances to decrease the frequency of polling API calls.
  • E. Increase the message retention period to 14 days to allow more messages to accumulate before polling.
  • F. Increase the visibility timeout to 12 hours to prevent duplicate processing.
Explanation

Correct A (option 0): Setting ReceiveMessageWaitTimeSeconds on the queue to 20 enables long polling at the queue level, causing all ReceiveMessage calls to wait up to 20 seconds for a message before returning an empty response, dramatically reducing empty responses and API costs. Correct C (option 2): Even without queue-level long polling, consumers can enable long polling per-request by passing WaitTimeSeconds=20 in each ReceiveMessage API call, achieving the same effect. Both approaches implement long polling, and either or both should be used. Wrong B: Message retention period controls how long messages stay in the queue; it does not affect polling behavior or empty responses. Wrong D: FIFO queues guarantee ordering and exactly-once processing but do not reduce empty responses; they actually have lower throughput limits. Wrong E: Increasing visibility timeout prevents duplicate processing during processing, but does not reduce empty poll responses. Wrong F: Reducing consumer count might lower API call frequency marginally but does not solve the root cause of empty responses; it would also reduce processing throughput.

4.

An e-commerce application uses API Gateway with a Lambda integration. During a marketing campaign, request rates spike to 15,000 requests per second. Developers observe that some customers receive HTTP 429 Too Many Requests errors. The API Gateway account-level throttle limit is 10,000 RPS. The team wants to allow the marketing campaign API stage to handle up to 12,000 RPS while limiting other API stages to 5,000 RPS each. Which combination of configurations achieves this? (Select TWO)

  • A. Submit an AWS Support request to increase the account-level API Gateway throttle limit above 10,000 RPS.✓ Correct
  • B. Configure a Usage Plan with a rate limit of 12,000 RPS and associate it with the marketing campaign API stage.
  • C. Set the stage-level throttle on the marketing campaign stage to 12,000 RPS in the API Gateway stage settings.✓ Correct
  • D. Enable API Gateway caching on the marketing campaign stage with a large TTL to absorb the extra requests.
  • E. Set individual method-level throttling overrides on every method in the marketing campaign stage to 12,000 RPS.
  • F. Configure a Usage Plan with a rate limit of 5,000 RPS and associate it with each of the other API stages.
Explanation

Correct — Option A: The account-level API Gateway throttle limit (default 10,000 RPS) is a hard ceiling that applies across all APIs and stages in the account. To allow any single stage to handle 12,000 RPS, the account-level limit must first be raised via an AWS Support request. Without this, stage-level limits cannot exceed the account limit. Correct — Option C: Stage-level throttling in API Gateway allows you to set a maximum RPS for a specific stage. Setting it to 12,000 RPS on the marketing campaign stage (after raising the account limit) ensures that stage can handle the traffic. Wrong — Option B: Usage Plans with rate limits are designed for API key-based client throttling, not for setting overall stage capacity limits. A Usage Plan rate limit applies per API key, not as an aggregate stage limit. Wrong — Option D: API Gateway caching reduces backend calls by serving cached responses, but it does not prevent the 429 throttle responses that are enforced before the cache layer is consulted; also, campaign requests are likely unique (personalized), making caching ineffective. Wrong — Option E: Method-level throttle overrides apply per method, not as an aggregate; setting 12,000 RPS per method does not cap the stage aggregate at 12,000 RPS and is unnecessarily granular. Wrong — Option F: Limiting other stages via Usage Plans (per API key) rather than stage-level throttling provides inconsistent enforcement and is not the correct mechanism for aggregate stage-level rate limiting.

5.

A developer has deployed a Lambda function that processes orders. Some orders fail due to downstream service errors, and the developer wants to automatically route failed event payloads to an SQS queue for later inspection without writing retry logic inside the function code. The function is invoked asynchronously. Which configuration achieves this with the least development effort?

  • A. Configure a Dead-Letter Queue (DLQ) on the SQS event source mapping for the Lambda function.
  • B. Add a try/except block in the function code that catches all exceptions and explicitly publishes the failed payload to SQS using the AWS SDK.
  • C. Configure a Lambda Destination for the function's ON_FAILURE condition, pointing to the SQS queue.✓ Correct
  • D. Enable Lambda Provisioned Concurrency and add an SQS queue ARN as the function's error destination in the function's environment variables.
Explanation

Correct: Lambda Destinations allow you to route asynchronous invocation results (success or failure) to a destination such as SQS, SNS, EventBridge, or another Lambda function — with no code changes required inside the function. Configuring ON_FAILURE automatically sends the failed event payload and execution metadata to the specified SQS queue. Wrong — Option A: A DLQ can be configured on the Lambda function itself (not the SQS event source mapping) for asynchronous invocations, but Lambda Destinations are the preferred modern approach and include richer metadata. More importantly, a DLQ on an SQS event source mapping applies to SQS-triggered (synchronous poll-based) invocations, not asynchronous invocations — so this option conflates two different concepts. Wrong — Option B: Writing explicit SDK calls inside the function code works but requires development effort and introduces more code complexity, violating the 'least development effort' requirement. Wrong — Option D: Provisioned Concurrency is a performance feature for reducing cold starts; it has no built-in error routing capability, and Lambda does not read destination ARNs from environment variables.

Test yourself across every DVA-C02 domain

The free DVA-C02 practice test mixes about 20 questions weighted like the exam. The full 275-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

Monitoring and Troubleshooting study guide (DVA-C02) →

Other DVA-C02 domains

← All AWS Developer Associate study resources