DVA-C02 Troubleshooting and Optimization Practice Question
Network Topology
The developer invokes a Lambda function using the AWS CLI and gets the output shown. What is the most likely cause of the error?
⚠ Common exam trap
DVA-C02 often tests the distinction between a function-level error (bad payload, unhandled exception) and a service-level error (permissions, timeout) — candidates misread the CLI output and blame IAM when the payload is the real culprit.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The event payload does not contain the expected data.
When a Lambda function is invoked with a payload that does not match the handler's expected schema, the function raises a runtime error such as KeyError or TypeError, which surfaces as a function error in the CLI output. The most likely cause is a malformed or unexpected event payload rather than an infrastructure issue.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The Lambda function code has a syntax error.
Why it's wrong here
A syntax error in the Lambda function code, such as a missing parenthesis or an invalid keyword, would typically be caught during the deployment phase or result in a `SyntaxError` exception *before* the function's core logic executes. When invoked via the AWS CLI, this would likely manifest as an immediate `InvalidRequestContentException` (400 error) or a `Lambda.Client.exceptions.InvalidParameterValueException` if the code itself prevents proper initialization, rather than a `TypeError` occurring during runtime execution.
- ✗
The Lambda function's execution role lacks permissions.
Why it's wrong here
If the Lambda function's execution role lacked necessary permissions, for example, to write logs to CloudWatch Logs or to access another AWS service like S3 or DynamoDB, the error message would explicitly indicate an `AccessDeniedException`. This type of error is distinct from a `TypeError`, which occurs when an operation is performed on a value of an inappropriate type, not due to insufficient AWS service permissions preventing an action.
- ✓
The event payload does not contain the expected data.
Why this is correct
When a Lambda function's code attempts to access a property or key within the `event` object that does not exist in the incoming JSON payload, it will result in a `TypeError`. For instance, if the code expects `event.detail.itemId` but the payload only contains `{"id": "123"}`, accessing `event.detail` would return `undefined`. Subsequently, attempting to access `itemId` on `undefined` would raise a `TypeError` because `undefined` has no properties, indicating a mismatch between expected and actual data structure.
- ✗
The Lambda function timed out.
Why it's wrong here
A Lambda function timeout occurs when the function's execution exceeds its configured maximum duration. When this happens, Lambda terminates the execution and logs a specific `Task timed out after N seconds` error message in CloudWatch Logs, often accompanied by a `500 Internal Server Error` response to the caller. This is a distinct operational error related to execution duration, not a `TypeError` which indicates a data type mismatch within the code's logic.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
One of 1,135 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.