SaveMyCert
Log in
5 of 5 free questions left today·for 30 a day
DVA-C03 · Domain 4

Troubleshooting and Optimization practice questions

Troubleshooting and Optimization is worth 22% of the DVA-C03 exam — the 3rd-heaviest of the 4 domains. Finding and fixing problems: debugging and root-cause analysis with logs, metrics and traces, observability and alerting best practices, and optimizing concurrency, memory, messaging and caching — including AI tools that analyse errors and suggest optimizations. Official weighting 22%. 6 fully worked examples are further down this page, answers included.

Exam weight
22%
the 3rd-heaviest of the 4 domains
Questions
105
across 3 topics
Free, no account
5/day
a free account allows 30 a day
Explanations
Every option
right and wrong

Build a practice session

5 free questions left today.

Domains

How many?

Mode

Ready when you are

10 fresh questions drawn across 1 of 4 domains, in Learn mode.

Review what you missed

Every question you answer incorrectly, and every question you flag while practising, is saved here automatically. Finish a session and you can come back to re-drill just those.

6 sample Troubleshooting and Optimization questions, fully explained

Questions from the DVA-C03 bank mapped to domain 4, with the answer key and the reasoning behind every option. None of them repeat the examples on the main DVA-C03 practice page.

Question 1Troubleshooting and Optimization

After a refactor that moved writes to a new table, every invocation of a Lambda function fails with this error:AccessDeniedException: User: arn:aws:sts::111122223333:assumed-role/orders-fn-role/orders-fn is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:us-east-1:111122223333:table/Orders-v2 because no identity-based policy allows the dynamodb:PutItem actionThe developer's own IAM user can write to Orders-v2 from the AWS CLI. What should the developer do?

Choose one.

  • a
    Allow dynamodb:PutItem on the Orders-v2 table ARN in the orders-fn-role policy Correct

    The caller in the message is the function's execution role session. Its policy most likely still names the old table, so it needs the new table's ARN.

  • b
    Allow dynamodb:PutItem on the Orders-v2 table ARN in the developer's user policy

    The developer's user already works and is not the caller. The function signs requests with its execution role.

  • c
    Allow the Lambda service principal to call PutItem in a policy on Orders-v2

    The request comes from the role session, not from the Lambda service principal. A resource policy for lambda.amazonaws.com would not match this caller.

  • d
    Allow dynamodb.amazonaws.com to call lambda:InvokeFunction on the function

    That permission lets DynamoDB invoke the function, for example from a stream. This error is about the function writing to DynamoDB.

The concept

An AccessDenied message names the principal, the action, the resource and the type of policy that is missing.

Why that’s the answer

The principal is assumed-role/orders-fn-role, which is the function's execution role, and the message says no identity-based policy allows dynamodb:PutItem on Orders-v2. After the refactor the role's policy most likely still lists the old table ARN. Adding the new ARN to the role fixes it. The developer's own permissions do not matter, because Lambda uses the execution role's credentials. A resource policy for the Lambda service principal would not match a role session.

How to reason it out
  1. Read the principal in the error: it is the execution role session.
  2. Read the action and resource: PutItem on the new table ARN.
  3. Note the reason: no identity-based policy allows it.
  4. Add the new table ARN to the execution role's policy.

Exam tip: Fix the policy of the principal named in the AccessDenied message, which for Lambda is the execution role.

DVA-C03 Root Cause Analysis: Lambda and API Errors, Logs Insights, X-Ray, Deployment Logs and AI Troubleshooting — the lesson that teaches this.

Question 2Troubleshooting and Optimization

A Lambda function in account A reads objects from an Amazon S3 bucket in account B. The bucket policy grants the function's execution role s3:GetObject, and the objects are encrypted with SSE-KMS using a customer managed key in account B. GetObject calls fail with AccessDenied, and CloudTrail in account B shows the role's kms:Decrypt request being denied. Which TWO changes are required? (Select TWO.)

Choose TWO.

  • a
    Allow kms:Decrypt on the key's ARN in the execution role's policy in account A Correct

    For cross-account use, the caller's own identity policy must allow the KMS action on the other account's key.

  • b
    Allow kms:Decrypt for the execution role in the bucket policy in account B

    A bucket policy controls S3 actions on the bucket. KMS permissions on the key come from the key policy and the caller's IAM policy.

  • c
    Add s3:GetObject for the role to the key policy in account B

    A key policy controls KMS actions on that key. S3 access is already granted by the bucket policy.

  • d
    Add a key policy statement in account B that allows the role kms:Decrypt Correct

    The key policy must also trust the external principal. Without it, account A's IAM policy alone cannot grant use of the key.

  • e
    Change the bucket's default encryption to SSE-S3 for new uploads

    That affects only objects written later. The existing objects stay encrypted with the customer managed key.

The concept

Using a KMS key across accounts requires permission on both sides: the key policy and the caller's IAM policy.

Why that’s the answer

S3 decrypts SSE-KMS objects by calling kms:Decrypt for the requester, so the role needs KMS permission as well as S3 permission. Across accounts, a key is usable only when its key policy (in account B) allows the external principal and the principal's IAM policy (in account A) allows the action on the key ARN. Either one alone fails. A bucket policy cannot grant KMS permissions, and switching default encryption leaves existing objects encrypted with the KMS key.

How to reason it out
  1. Note that the denied call is kms:Decrypt, not s3:GetObject.
  2. Recall that cross-account KMS access needs the key policy and the caller's IAM policy.
  3. Add the role to the key policy in the key's account.
  4. Add kms:Decrypt on the key ARN to the role's policy.

Exam tip: Cross-account KMS access: the key policy must allow the principal and the principal's IAM policy must allow the action.

DVA-C03 Root Cause Analysis: Lambda and API Errors, Logs Insights, X-Ray, Deployment Logs and AI Troubleshooting — the lesson that teaches this.

Question 3Troubleshooting and Optimization

A developer connects an Amazon API Gateway REST API to an AWS Lambda function using Lambda proxy integration. Every test call returns HTTP 502, but the function's CloudWatch Logs show each invocation completing without errors. The handler returns its result directly, for example `{"orderId": "123"}`. What is the most likely cause?

Choose one.

  • a
    The method needs a mapping template to transform the function's response

    Proxy integration passes the response through without mapping templates, so adding one would not fix the response shape.

  • b
    The integration timed out before the function returned its response

    A timeout returns 504, and the logs show the invocations completing normally.

  • c
    The function's response is not in the proxy integration response format Correct

    Proxy integration expects an object with statusCode, optional headers and a string body. Any other shape makes API Gateway return 502.

  • d
    API Gateway lacks permission in the function's policy to invoke the function

    Without invoke permission the function would never run, but the logs show it running every time.

The concept

With Lambda proxy integration, API Gateway expects a specific response shape from the function.

Why that’s the answer

In a Lambda proxy integration, the function must return an object with statusCode, optional headers and multiValueHeaders, and body as a string. A bare object such as {"orderId": "123"} is malformed, so API Gateway returns 502 Bad Gateway even though the function succeeded. A timeout would return 504, and a missing invoke permission would stop the function from running at all.

How to reason it out
  1. The function runs and succeeds, so look at what it returns.
  2. Recall the proxy response shape: statusCode, headers, string body.
  3. Rule out a timeout, which would be 504.
  4. Wrap the result in the proxy response format and serialize the body.

Exam tip: A 502 with a successful Lambda run usually means a malformed proxy response.

DVA-C03 Root Cause Analysis: Lambda and API Errors, Logs Insights, X-Ray, Deployment Logs and AI Troubleshooting — the lesson that teaches this.

Question 4Troubleshooting and Optimization

Clients of a REST API in Amazon API Gateway sometimes receive HTTP 504 after about 29 seconds when they request a report. The method's IntegrationLatency metric peaks at 29,000 ms, and the backend Lambda function's Duration metric shows some invocations running for 45 seconds against a 60-second timeout. Clients must get a response within a few seconds. What should the developer do?

Choose one.

  • a
    Raise the Lambda function's timeout from 60 seconds to 120 seconds

    The function is not timing out. API Gateway stops waiting at 29 seconds, so a longer function timeout changes nothing for clients.

  • b
    Raise the stage's throttling rate and burst limits for this method

    Throttling returns 429, not 504. These requests reach the backend and then wait too long.

  • c
    Run the report job asynchronously and return a job ID to poll Correct

    Clients get an immediate response, and the long work runs outside the API's integration timeout.

  • d
    Turn on API caching on the stage for the report method

    Each report is generated on request, so a cache could only serve repeats. First requests would still take 45 seconds.

The concept

API Gateway stops waiting at its integration timeout no matter how long the backend is allowed to run.

Why that’s the answer

The 504s line up with IntegrationLatency at 29,000 ms, the default integration timeout for REST APIs. The backend sometimes needs 45 seconds, so the gateway gives up first. Raising the Lambda timeout does not change the gateway's limit, and throttling would return 429 instead. With clients needing an answer in seconds, the fix is to start the work asynchronously (for example by queueing it) and return a job ID to poll. AWS can raise the REST integration timeout for Regional and private APIs by quota request, but responses would still be slow.

How to reason it out
  1. Match the 504s to IntegrationLatency at the 29-second ceiling.
  2. Note that the backend needs longer than that.
  3. Apply the constraint: responses within a few seconds.
  4. Move the long work to an asynchronous job pattern.

Exam tip: 504 with IntegrationLatency near 29 seconds means the backend is slower than the API Gateway integration timeout.

DVA-C03 Root Cause Analysis: Lambda and API Errors, Logs Insights, X-Ray, Deployment Logs and AI Troubleshooting — the lesson that teaches this.

Question 5Troubleshooting and Optimization

An order service sends messages to an Amazon SQS standard queue that triggers a Lambda function. During a sale, the queue's ApproximateAgeOfOldestMessage rose from seconds to 40 minutes. The function's Errors metric stayed at zero, its Throttles metric climbed, and ConcurrentExecutions stayed flat at 20 the whole time. What is the most likely cause of the backlog?

Choose one.

  • a
    A visibility timeout shorter than the function timeout is redelivering messages to the queue

    Redelivery causes duplicate processing. It would not hold concurrency flat at 20 or raise the Throttles metric.

  • b
    Failed batch items in the function's responses are returning messages to the queue

    Partial batch failures come from processing errors, and the Errors metric stayed at zero.

  • c
    A short message retention period is removing messages from the queue before processing

    Expiring messages would remove old messages and lower the age metric, not raise it to 40 minutes.

  • d
    A reserved concurrency of 20 on the function is capping how fast messages are processed Correct

    Flat concurrency at 20, together with throttles and no errors, means the function cannot scale further, so messages wait.

The concept

Several metrics read together show whether a backlog comes from errors, retries or a capacity limit.

Why that’s the answer

ApproximateAgeOfOldestMessage shows the backlog. Errors at zero rules out failing batches, and Throttles rising while ConcurrentExecutions stays exactly at 20 shows the function hitting a hard ceiling: reserved concurrency of 20. Raising or removing the reservation lets the poller scale. An event source mapping's maximum concurrency setting would also hold concurrency flat, but it limits the pollers so the function is not throttled, and the Throttles metric would not climb. Visibility timeout problems cause duplicates, and retention problems would remove old messages, which lowers the age metric.

How to reason it out
  1. Confirm the backlog with ApproximateAgeOfOldestMessage.
  2. Use Errors = 0 to rule out processing failures.
  3. Read the flat ConcurrentExecutions line together with rising Throttles as a reserved concurrency cap.
  4. Check the function's reserved concurrency and raise or remove it.

Exam tip: Flat concurrency with rising throttles and no errors means a concurrency cap, not a code defect.

DVA-C03 Root Cause Analysis: Lambda and API Errors, Logs Insights, X-Ray, Deployment Logs and AI Troubleshooting — the lesson that teaches this.

Question 6Troubleshooting and Optimization

Users report that about 1 request in 100 to an API takes several seconds, but the team's dashboard shows the backing Lambda function's Duration steady at 120 ms. Traffic arrives in bursts, and the function uses the default plain-text log format. The developer wants to confirm the slow requests from metrics and then check whether they come from cold starts. Which approach should the developer use?

Choose one.

  • a
    Graph Duration at p99, then query REPORT lines for @initDuration in Logs Insights Correct

    p99 shows the slow tail that an average hides, and @initDuration appears only on REPORT lines of invocations that had a cold start.

  • b
    Graph Duration at Maximum, then add a CloudWatch alarm on the function's Throttles

    Maximum shows only the single worst invocation, and throttled requests are rejected rather than slow, so this cannot test the cold-start idea.

  • c
    Graph Duration at Average with a 1-minute period, then sort log events by @timestamp

    An average over a minute still hides a 1% tail, and sorting by time does not show which invocations had a cold start.

  • d
    Graph ConcurrentExecutions at p99, then search the log group for Task timed out

    Concurrency does not measure request latency, and these requests are slow but finish, so there are no timeout messages to find.

The concept

Averages hide tail latency. Percentiles reveal it, and Lambda REPORT lines show which invocations had a cold start.

Why that’s the answer

When 1% of requests are slow, the Average barely moves. The p99 statistic of Duration shows the slow tail. To link that tail to cold starts, a Logs Insights query such as filter @type = "REPORT" | stats count(*), avg(@initDuration) by bin(5m) works, because Init Duration is written only for invocations that started a new execution environment. Maximum shows one worst case, Throttles are rejected rather than slow, and these requests finish, so they never log a timeout.

How to reason it out
  1. Recognise that a 1% tail does not show in an average.
  2. Switch the Duration statistic to p99 to confirm the slow tail.
  3. Recall that REPORT lines carry Init Duration only on cold starts.
  4. Query @initDuration to see whether slow requests line up with cold starts.

Exam tip: Use percentile statistics for tail latency and REPORT @initDuration to confirm cold starts.

DVA-C03 Root Cause Analysis: Lambda and API Errors, Logs Insights, X-Ray, Deployment Logs and AI Troubleshooting — the lesson that teaches this.

What DVA-C03 domain 4 tests, topic by topic

The official exam guide breaks Troubleshooting and Optimization into 3 topics. The question bank follows the same split, so a weak topic shows up as a cluster of misses you can go back and read.

Published DVA-C03 practice questions per topic in Troubleshooting and Optimization
TopicWhat it coversQuestions
Assist in a root cause analysisOfficial DVA-C03 Task 4.1 skills: (1) Debug application code and service integration issues to identify defects. (2) Interpret application metrics, logs, and traces. (3) Query logs to find relevant data. (4) Troubleshoot deployment failures by using output logs. (5) Use AWS AI tools to analyze errors and to generate troubleshooting suggestions.35
Apply logging, monitoring, and observability best practicesOfficial DVA-C03 Task 4.2 skills: (1) Implement effective logging strategies to record application behavior and state (for example, by using structured logging for application events and user actions). (2) Implement code that emits custom metrics. (3) Implement notification alerts for specific actions (for example, quota limits, deployment completions). (4) Implement tracing by using AWS services and tools. (5) Monitor workload health (for example, by using application health checks, liveness and readiness probes).35
Optimize applications by using AWS services and featuresOfficial DVA-C03 Task 4.3 skills: (1) Apply concurrency concepts (for example, AWS Lambda provisioned concurrency, Amazon EC2 Auto Scaling, thread pool management, connection pooling). (2) Optimize memory and compute power for an application. (3) Optimize application messaging (for example, by using Amazon SQS queues, Amazon SNS fan-out patterns). (4) Implement caching by using AWS services (for example, Amazon ElastiCache, Amazon DynamoDB Accelerator [DAX], Amazon CloudFront). (5) Detect performance bottlenecks by using AWS services (for example, Amazon CloudWatch). (6) Use AWS AI tools to identify optimization opportunities (for example, performance bottleneck detection, resource usage optimization, code efficiency improvement).35
Total105

Revise Troubleshooting and Optimization before you drill it

Other DVA-C03 domains

Troubleshooting and Optimization: your questions

Troubleshooting and Optimization is domain 4 of the DVA-C03 exam guide and carries 22% of the scored content — the 3rd-heaviest of the 4 domains. On a 65-question paper that works out to roughly 14 questions, though AWS does not publish an exact per-domain count and individual exam forms vary.

Source

The domain weight and topic list on this page come from the official DVA-C03 exam guide.