DVA-C02 Troubleshooting and Optimization Practice Question
A developer deploys a new version of an AWS Lambda function using the AWS CLI. After deployment, the function returns stale results. What is the most likely cause?
⚠ Common exam trap
Watch out — candidates often assume deploying new code automatically updates the invoked version, overlooking that aliases must be explicitly repointed to the new version to change which code is executed.
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 Lambda function alias is still pointing to the previous version.
When a developer deploys a new version of a Lambda function using the AWS CLI without updating the function alias, the alias continues to point to the previous version. Invoking the function via the alias (e.g., via an API Gateway endpoint or a CloudFront origin) will execute the old code, returning stale results. The `$LATEST` version is updated, but unless the alias is repointed, it does not automatically use the new code.
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 function's environment variables are cached and not updated.
Why it's wrong here
When a new version of an AWS Lambda function is deployed, the environment variables associated with that specific version are immediately updated and become part of its immutable configuration. The Lambda service provisions new execution environments that incorporate these latest environment variable settings. There is no caching mechanism that would cause older environment variables to persist or be used when a new function version is invoked, ensuring that the deployed version always runs with its intended configuration.
- ✓
The Lambda function alias is still pointing to the previous version.
Why this is correct
Lambda aliases provide a stable endpoint for invoking a function, but they are explicitly configured to point to a specific function version. If a developer deploys a new version of the Lambda function but fails to update the associated alias to reference this new version, any invocations made through that alias will continue to execute the code and configuration of the older version it still references. This is a common operational oversight leading to unexpected behavior where new code doesn't appear to be running.
- ✗
The Amazon CloudFront distribution is caching the old response.
Why it's wrong here
Amazon CloudFront is a global content delivery network primarily used for caching and delivering web content closer to users. It is not inherently involved in the deployment or execution lifecycle of a standalone AWS Lambda function unless the Lambda function is explicitly integrated as an origin for a CloudFront distribution, such as with Lambda@Edge or an API Gateway endpoint fronted by CloudFront. Therefore, CloudFront caching would not be a factor in preventing a newly deployed Lambda function version from running unless such an integration exists and is misconfigured.
- ✗
The Lambda function's code is cached by the Lambda service.
Why it's wrong here
The AWS Lambda service does not cache function code across different versions in a way that would prevent a newly deployed version from being executed. Each published Lambda function version is an immutable snapshot containing its unique code package and configuration. When a new version is deployed, the Lambda service ensures that subsequent invocations targeting that specific version will load and execute its distinct code, rather than reusing or caching the code from a previous version.
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 724 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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.