Courseiva

DVA-C02 Development with AWS Services Practice Question

Which THREE of the following are valid use cases for AWS Lambda? (Choose three.)

⚠ Common exam trap

Many candidates confuse Lambda's ability to handle HTTP requests via API Gateway with the idea that Lambda itself can serve as a web server, ignoring its stateless nature and execution timeout constraints.

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

✓

Processing records from a DynamoDB Stream in real time

Option A is correct because DynamoDB Streams can be configured as an event source for Lambda, which then invokes the function in real time with batches of stream records for processing. Option B is correct because Amazon EventBridge (CloudWatch Events) scheduled rules can invoke a Lambda function on a cron or rate expression, such as hourly, making it suitable for periodic cleanup tasks. Option C is incorrect because static websites are served by services like Amazon S3 static website hosting or CloudFront, not by Lambda, which is an event-driven compute service rather than a persistent web server. Option D is incorrect because long-running applications with persistent WebSocket connections require continuously running compute such as EC2, ECS, or API Gateway WebSocket APIs backed by appropriate compute, whereas Lambda has a maximum execution timeout of 15 minutes and is not designed for persistent connections. Option E is correct because S3 can be configured to send event notifications (e.g., s3:ObjectCreated:*) that invoke a Lambda function to process uploaded objects.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Processing records from a DynamoDB Stream in real time

    Why this is correct

    AWS Lambda is an excellent choice for processing records from a DynamoDB Stream in real time. DynamoDB Streams provide a time-ordered sequence of item-level modifications, which can be configured as an event source for a Lambda function. This allows the function to automatically invoke and process batches of stream records as soon as changes occur in the DynamoDB table, enabling real-time data processing, analytics, or replication.

  • ✓

    Running a scheduled task every hour to clean up old database records

    Why this is correct

    Running a scheduled task every hour to clean up old database records is a perfect use case for AWS Lambda. AWS EventBridge (formerly CloudWatch Events) can be configured with a cron-like schedule expression to trigger a Lambda function at specified intervals. This serverless approach eliminates the need for provisioning and managing dedicated servers for routine maintenance tasks, making it cost-effective and highly scalable for operational automation.

  • ✗

    Serving as a web server for a static website

    Why it's wrong here

    Serving as a web server for a static website is not a valid use case for AWS Lambda. While Lambda can be invoked via API Gateway for dynamic content, it is not designed to directly serve static files like HTML, CSS, or JavaScript over HTTP. Static websites are best hosted on Amazon S3, optionally fronted by Amazon CloudFront for global content delivery and caching, which offers superior performance, lower cost, and simpler management for static assets.

  • ✗

    Hosting a long-running web application with WebSockets

    Why it's wrong here

    Hosting a long-running web application with WebSockets is generally not suitable for AWS Lambda due to its inherent limitations. Lambda functions have a maximum execution timeout of 15 minutes, making them ill-suited for maintaining persistent, long-lived WebSocket connections. While API Gateway supports WebSockets and can integrate with Lambda for message handling, the Lambda function itself is ephemeral and stateless, not designed to host the continuous connection state required by WebSockets.

  • ✓

    Processing objects uploaded to an S3 bucket

    Why this is correct

    Processing objects uploaded to an S3 bucket is a fundamental and highly effective use case for AWS Lambda. Amazon S3 can be configured to send event notifications to a Lambda function whenever objects are created, deleted, or modified in a bucket. This enables immediate, automated processing tasks such as image resizing, video transcoding, data validation, or triggering further serverless workflows as soon as new data arrives in S3.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.