AWS Certified Developer - Associate · Domain 4 · 18% of exam

Troubleshooting and Optimization

Drill 20 practice questions focused entirely on Troubleshooting and Optimization for the AWS DVA-C02 exam. Tap an answer for instant feedback and a full explanation — no sign-up, always free.

Verified answer20 questions
Question 1 of 20

A developer maintains a REST API on Amazon API Gateway that serves a product catalog. The GET /products endpoint receives thousands of identical requests per minute, and each request invokes a Lambda function that reads from a database. The catalog data changes only a few times per day. The team wants to reduce Lambda invocations, lower latency, and cut cost with minimal code changes. What is the MOST appropriate solution?

Reviewed for accuracy · Report an issue
Question 2 of 20

A developer runs a media website on an Application Load Balancer backed by EC2 instances. Product images and CSS/JS files rarely change but are requested millions of times daily by users across many countries. Origin CPU is saturated serving these static files, and users far from the region report slow page loads. Which change most effectively reduces origin load and improves global latency for these assets?

Reviewed for accuracy · Report an issue
Question 3 of 20

A developer supports a Lambda function that processes uploaded orders. During flash sales, customers report failed order submissions. In CloudWatch, the developer observes that the function's Throttles metric spikes to hundreds per minute while the Errors metric remains near zero, and the ConcurrentExecutions metric flatlines at a fixed value during the spikes. What is the most likely root cause of the failed submissions?

Reviewed for accuracy · Report an issue
Question 4 of 20

A developer maintains a REST API backed by Lambda and DynamoDB. Support tickets report that the API feels slow for some users, but the CloudWatch alarm monitoring the Average of the API Gateway Latency metric never triggers because the mean stays low. The team wants an alarm that reliably catches the intermittent slowness affecting a minority of requests. What is the most effective change?

Reviewed for accuracy · Report an issue
Question 5 of 20

A developer needs to publish custom application metrics (such as order value and items-per-order) from a high-throughput Lambda function. The function already writes structured JSON logs to CloudWatch Logs. Calling the PutMetricData API on every invocation has caused throttling and added latency to the function. What is the MOST efficient way to emit these custom metrics while avoiding the API throttling and extra latency?

Reviewed for accuracy · Report an issue
Question 6 of 20

A developer runs a Lambda function triggered by API Gateway. Users intermittently receive 502 errors during traffic peaks. The developer suspects the function is failing to keep up with demand. Which CloudWatch metric should the developer examine first to confirm whether requests are being rejected before they can execute?

Reviewed for accuracy · Report an issue
Question 7 of 20

A developer is investigating an increase in HTTP 500 errors reported by an application running on AWS Lambda behind API Gateway. The Lambda function writes structured JSON logs (including a 'level' field and 'errorType' field) to Amazon CloudWatch Logs. The developer needs to quickly identify which specific error type is most frequently associated with the failures over the last hour, without exporting logs to another service. What is the FASTEST way to do this?

Reviewed for accuracy · Report an issue
Question 8 of 20

A developer runs a Java application on Amazon EC2 that writes plain-text logs to a CloudWatch Logs log group. Operations wants to be paged whenever the phrase "OutOfMemoryError" appears more than 3 times within a 5-minute window. There is currently no numeric metric that tracks these occurrences. What is the most appropriate way to enable this alerting with the least custom code?

Reviewed for accuracy · Report an issue
Question 9 of 20

A developer's Lambda function currently writes plain-text log lines such as 'Processed order 12345 in 240ms'. The operations team wants to build CloudWatch Logs Insights queries and metric filters that can reliably extract the order ID, duration, and status without brittle string parsing. What is the MOST effective change the developer should make to the logging approach?

Reviewed for accuracy · Report an issue
Question 10 of 20

A developer manages a Lambda-based order processing service whose traffic varies predictably across the day, with higher volume during business hours and much lower volume overnight. The team wants a CloudWatch alarm on the function's error count that adapts to these normal traffic patterns and only alerts when errors deviate meaningfully from expected behavior, without constant false alarms from a fixed threshold. What should the developer configure?

Reviewed for accuracy · Report an issue
Question 11 of 20

A developer maintains a distributed application composed of an API Gateway REST API, a front-end Lambda function, an SQS queue, and a downstream processing Lambda function. Customers occasionally report failed requests, but the team cannot trace an individual customer request across all four components because each service logs independently to its own CloudWatch Logs group. What is the MOST effective way to enable end-to-end tracing of a single request across these services?

Reviewed for accuracy · Report an issue
Question 12 of 20

A developer built a reporting feature that repeatedly retrieves all orders for a specific customer from a DynamoDB table. The table's partition key is OrderId and it has no secondary indexes. The feature currently uses a Scan operation with a FilterExpression on CustomerId, and users report that the report takes several seconds and consumes a large amount of read capacity as the table grows. What is the most effective way to reduce both latency and read consumption?

Reviewed for accuracy · Report an issue
Question 13 of 20

A developer maintains a product catalog service backed by DynamoDB with provisioned capacity. Read traffic has grown, and the table is now consuming most of its provisioned read capacity units (RCUs), driving up cost. Analysis shows the application always calls GetItem with ConsistentRead set to true, but the catalog data changes only a few times per day and stale reads of a second or two are acceptable. What change will most cost-effectively reduce read capacity consumption?

Reviewed for accuracy · Report an issue
Question 14 of 20

A developer's Lambda function reads customer profile items from a DynamoDB table using Query. Each item is roughly 40 KB and contains many nested attributes, but the function only needs the customer's name and email for a notification workflow. CloudWatch shows the function is consuming far more read capacity than expected and DynamoDB read costs are high. Which change most effectively reduces the consumed read capacity for these queries?

Reviewed for accuracy · Report an issue
Question 15 of 20

A gaming application computes a global leaderboard by running an expensive aggregation query against an Amazon RDS database. The query runs on every page load, and during peak hours the database CPU is saturated, causing slow response times for all users. The leaderboard only needs to be accurate to within about 60 seconds. A developer wants to reduce database load with minimal code changes. What is the most effective approach?

Reviewed for accuracy · Report an issue
Question 16 of 20

A developer runs a product catalog service backed by Amazon RDS and uses Amazon ElastiCache for Redis with a lazy-loading (cache-aside) strategy. Users frequently report seeing outdated product prices for several minutes after an admin updates them in the database. The team needs to ensure the cache reflects price changes immediately after a database write, while keeping the cache populated. Which change best addresses this?

Reviewed for accuracy · Report an issue
Question 17 of 20

A developer's Lambda function connects to an Amazon RDS PostgreSQL database. Under moderate load, X-Ray traces show that each invocation spends 200-400ms establishing a new database connection, and the RDS instance is reporting an unusually high number of active connections that occasionally exhausts the connection limit. The developer wants to reduce both the per-invocation latency and the connection count without changing the database engine. Which change is the MOST effective?

Reviewed for accuracy · Report an issue
Question 18 of 20

A developer maintains a Node.js Lambda function that makes many outbound HTTPS calls to a downstream REST API during each invocation. X-Ray traces show that a significant portion of each request's latency is spent establishing new TLS connections for every call. The function reuses the same HTTP client library across calls within an invocation. What is the MOST effective change to reduce this connection-establishment overhead?

Reviewed for accuracy · Report an issue
Question 19 of 20

A developer notices that a Lambda function backing a low-traffic REST API occasionally returns responses in over 4 seconds, while most requests complete in under 200 ms. AWS X-Ray tracing is enabled. When inspecting the slow traces in the X-Ray console, which segment detail most directly confirms that the latency is caused by a cold start rather than slow downstream calls?

Reviewed for accuracy · Report an issue
Question 20 of 20

A data-processing Lambda function is configured with 128 MB of memory. It is CPU-bound and currently runs for about 8 seconds per invocation. The team wants to reduce both execution time and overall cost. After using AWS Lambda Power Tuning to test several memory settings, they find that at 1024 MB the function completes in about 1 second, and the total invocation cost is lower than at 128 MB. What is the primary reason increasing memory reduced both latency and cost in this case?

Reviewed for accuracy · Report an issue

More DVA-C02 practice

Keep going with the other AWS Certified Developer - Associate domains, or take a full timed mock exam.

← Back to DVA-C02 overview