DVA-C02 Development with AWS Services Practice Question
A Lambda function must share reusable validation code across several functions without packaging the same library into every deployment artifact. What should be used?
⚠ Common exam trap
Watch out — candidates often confuse Lambda layers with other AWS services that handle 'sharing' (like API Gateway usage plans for sharing API access) or 'packaging' (like S3 multipart upload for large files), but only Lambda layers are designed to share code and dependencies across functions without repackaging.
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
✓
Lambda layer
Lambda layers allow you to centrally manage reusable code (e.g., validation libraries) and share it across multiple Lambda functions without packaging it into each deployment artifact. When you attach a layer to a function, the layer's content is extracted into the /opt directory, making it available at runtime. This avoids duplication and simplifies updates, as you only need to update the layer version rather than every function's deployment package.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Lambda layer
Why this is correct
A Lambda layer is a ZIP archive containing supplementary code or data, such as libraries, custom runtimes, or common utility functions. By packaging reusable validation logic into a layer, multiple Lambda functions can reference it, significantly reducing deployment package sizes and promoting code consistency. This mechanism directly addresses the need to share common code across various serverless functions efficiently.
- ✗
API Gateway usage plan
Why it's wrong here
An API Gateway usage plan is designed to help you manage and monetize your APIs by defining throttling limits, quotas, and API keys for client access. It governs how external consumers interact with your API endpoints, but it provides no mechanism for sharing or packaging reusable code within your backend Lambda functions. Therefore, it is entirely unrelated to the internal code structure or sharing requirements of Lambda functions.
- ✗
S3 multipart upload
Why it's wrong here
S3 multipart upload is a feature of Amazon S3 that allows you to upload large objects by splitting them into smaller parts, which can be uploaded independently and in parallel. This method improves the efficiency and resilience of large file transfers to S3 buckets. However, it is a storage optimization technique and has no direct relevance to packaging or sharing executable code for AWS Lambda functions.
- ✗
CloudWatch metric filter
Why it's wrong here
A CloudWatch metric filter is used to extract specific data points from log events ingested by CloudWatch Logs and transform them into custom metrics. This feature enables monitoring and alarming based on patterns found within application logs, such as error counts or latency spikes. It is a monitoring and observability tool and does not provide any capability for sharing or reusing code across Lambda functions.
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
Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.