AWS Developer Associate Domain 4: Troubleshooting and Optimization
37 free practice questions for Troubleshooting and Optimization in the AWS Certified Developer – Associate (DVA-C02) exam. Try each question first, then open "Show answer" for the correct option and explanation.
Troubleshooting and Optimization practice questions
-
Question 1. Which service traces a request across API Gateway, Lambda, and DynamoDB to show where latency occurs?
Show answer
Answer: D. AWS X-Ray
X-Ray builds a service map from segments and subsegments recorded along the request path.
-
Question 2. How is X-Ray tracing turned on for a Lambda function?
Show answer
Answer: B. Enable active tracing on the function
Lambda runs the X-Ray daemon for you. The function's role needs permission to send traces.
-
Question 3. An application on EC2 uses the X-Ray SDK, but no traces appear. What is commonly missing?
Show answer
Answer: B. The X-Ray daemon on the instance, allowed to send traces
The SDK sends segments over UDP to the daemon, which uploads them to X-Ray.
-
Question 4. Developers want to filter X-Ray traces by customer ID. How should the ID be recorded?
Show answer
Answer: B. As an annotation
Annotations are indexed for filter expressions. Metadata is stored but not searchable.
-
Question 5. Why does X-Ray not record every request by default?
Show answer
Answer: A. Sampling rules limit how many requests are traced to control cost
The default rule records the first request each second plus 5% of the rest. Rules can be customized.
-
Question 6. Which open-source option lets an app send traces to X-Ray while staying vendor-neutral?
Show answer
Answer: C. AWS Distro for OpenTelemetry (ADOT)
ADOT collects OpenTelemetry traces and metrics and can export them to X-Ray and CloudWatch.
-
Question 7. A developer must find the 10 slowest Lambda invocations in the last hour from logs. Which tool fits?
Show answer
Answer: B. CloudWatch Logs Insights
Logs Insights queries the REPORT lines, for example sorting by @duration.
-
Question 8. An application must publish a custom metric, such as orders per minute, to CloudWatch. Which API is used?
Show answer
Answer: A. PutMetricData
Custom metrics can have dimensions and standard or high resolution.
-
Question 9. A Lambda function should emit custom metrics without extra API calls. What can it use?
Show answer
Answer: A. The CloudWatch embedded metric format in its logs
CloudWatch extracts metrics from structured EMF log lines asynchronously.
-
Question 10. Which metric shows that a Lambda function is being rejected because of concurrency limits?
Show answer
Answer: A. Throttles
Throttled invocations return 429 errors for synchronous calls. Raise concurrency or reduce load.
-
Question 11. A Lambda function reading a Kinesis stream falls behind. Which metric shows this?
Show answer
Answer: C. IteratorAge
IteratorAge is the age of the last record processed. Rising values mean the consumer is lagging.
-
Question 12. An API Gateway endpoint backed by a Lambda proxy integration returns 502 Bad Gateway. What is a likely cause?
Show answer
Answer: C. The function returned a response in the wrong proxy format
The proxy response must include statusCode and a string body. Unhandled errors also cause 502s.
-
Question 13. A REST API returns 504 errors for requests that take about 35 seconds. What is the cause?
Show answer
Answer: C. The integration exceeded API Gateway's 29-second timeout
Long-running work should be made asynchronous, for example by queuing it and returning an ID.
-
Question 14. Clients of an API Gateway API receive 429 Too Many Requests. What does this mean?
Show answer
Answer: A. The request was throttled by API Gateway or Lambda
Throttling comes from stage, method, usage plan, or account limits. Clients should retry with backoff.
-
Question 15. A Lambda function has plenty of memory but is CPU-bound and slow. What is the fix?
Show answer
Answer: C. Increase the memory setting, which also adds CPU
Lambda allocates CPU in proportion to memory. More memory can reduce duration and even total cost.
-
Question 16. How can a developer find the most cost-effective memory setting for a Lambda function?
Show answer
Answer: A. Test several settings, e.g. with Lambda Power Tuning
Power Tuning runs the function at several memory sizes and compares speed and cost.
-
Question 17. Which CloudWatch feature shows Lambda memory usage, CPU time, and cold starts per invocation?
Show answer
Answer: C. CloudWatch Lambda Insights
Lambda Insights uses an extension layer to collect system-level metrics.
-
Question 18. A function's logs are hard to search because each line is free text. What improves troubleshooting?
Show answer
Answer: B. Structured JSON logs with fields such as requestId
Structured logs can be filtered and queried by field in Logs Insights.
-
Question 19. Lambda log groups keep growing, increasing storage costs. What should be set?
Show answer
Answer: D. A retention period on the log groups
Log groups keep data forever by default. Set retention to what compliance requires.
-
Question 20. An alarm should notify the team when a Lambda function's error rate exceeds 5%. What should be created?
Show answer
Answer: C. A CloudWatch alarm with metric math on Errors and Invocations
Metric math divides errors by invocations, and the alarm action publishes to SNS.
-
Question 21. Which metric shows that messages are waiting too long in an SQS queue?
Show answer
Answer: A. ApproximateAgeOfOldestMessage
A rising age means consumers can't keep up. Scale consumers or fix processing errors.
-
Question 22. An SQS queue shows many NumberOfEmptyReceives, raising cost. What reduces this?
Show answer
Answer: D. Enable long polling with a wait time of up to 20 seconds
Long polling waits for messages instead of returning empty responses right away.
-
Question 23. Messages keep returning to an SQS queue and are processed repeatedly. What is a likely cause?
Show answer
Answer: D. The visibility timeout is shorter than processing time
If processing takes longer than the visibility timeout, the message reappears for another consumer.
-
Question 24. A DynamoDB table throttles although total consumed capacity is well below the provisioned amount. What is the likely cause?
Show answer
Answer: B. A hot partition key receiving most requests
Spread load with a higher-cardinality key or write sharding, for example a random suffix.
-
Question 25. Which tool shows which DynamoDB partition keys receive the most traffic?
Show answer
Answer: A. CloudWatch Contributor Insights for DynamoDB
Contributor Insights reports the most accessed and most throttled keys.
-
Question 26. Which service records who called an AWS API, such as who deleted a Lambda function?
Show answer
Answer: A. AWS CloudTrail
CloudTrail logs management events with the caller identity, time, and source IP.
-
Question 27. A Lambda function fails with "Task timed out after 3.00 seconds" when calling an external API. What should be checked first?
Show answer
Answer: C. The function timeout and the network path to the API
The default timeout is 3 seconds. In a VPC, a missing NAT route also causes hangs until timeout.
-
Question 28. An SDK call hangs for a long time before failing, which delays the whole Lambda function. What helps?
Show answer
Answer: A. Set shorter connection and request timeouts in the SDK
Explicit SDK timeouts make calls fail fast so retries or fallbacks can run.
-
Question 29. How can a developer reduce Lambda cold-start duration for a Java function without provisioned concurrency?
Show answer
Answer: A. Enable Lambda SnapStart
SnapStart restores initialized snapshots, which cuts startup time for supported runtimes.
-
Question 30. Which change reduces Lambda initialization time for most runtimes?
Show answer
Answer: D. A small package that loads only the dependencies it needs
Smaller packages download and initialize faster. Lazy-load rarely used libraries.
-
Question 31. An API returns the same product catalog on most requests, causing load on Lambda and DynamoDB. What reduces load quickly?
Show answer
Answer: A. Enable API Gateway caching with a suitable TTL
Cached responses are served by API Gateway without invoking the backend.
-
Question 32. Uploads of large files to S3 from an application fail midway on unreliable networks. What should be used?
Show answer
Answer: B. Multipart upload, which retries individual parts
Multipart upload is recommended above 100 MB and required above 5 GB.
-
Question 33. An app receives HTTP 503 Slow Down errors from S3 under very high request rates. What helps?
Show answer
Answer: A. Retry with backoff and spread requests across more prefixes
S3 scales per prefix, and the SDK retries with backoff automatically.
-
Question 34. Which CloudWatch Logs feature streams matching log events to a Lambda function in near real time?
Show answer
Answer: D. A subscription filter
Subscription filters send events to Lambda, Kinesis, or Firehose for processing.
-
Question 35. A developer wants a CloudWatch metric counting log lines that contain "ERROR". What should be created?
Show answer
Answer: D. A metric filter on the log group
Metric filters turn matching log events into metric data points that alarms can use.
-
Question 36. A Step Functions execution fails at one state. Where can the developer see the input, output, and error for each step?
Show answer
Answer: C. The execution's event history in the Step Functions console
The visual workflow and event history show each state's data and error details.
-
Question 37. Which Amazon CodeGuru feature finds the most expensive lines of code in a running application?
Show answer
Answer: D. CodeGuru Profiler
Profiler samples the app in production and shows CPU-heavy code paths. Reviewer analyzes code in pull requests.
AWS, Amazon Web Services, and AWS Certified are trademarks of Amazon.com, Inc. or its affiliates. These questions are original study material, not questions from the real exam.