DVA-C02 Questions 1-10: AWS Lambda and Event-Driven Development

0
0

Serverless has quietly become the default for new AWS workloads, and this AWS Lambda exam practice set will help you keep pace with what shifted in 2026. Since re:Invent 2025, SnapStart now covers Python and .NET, response streaming is generally available, and Lambda’s per-account scaling rate jumped to 1,000 concurrent executions every 10 seconds. Those changes matter because the DVA-C02 exam blueprint expects you to pick the right knob for the right constraint, not just recite service names.

Welcome to the very first entry in our DVA-C02 series. Questions 1–10 focus on Domain 1 (Development with AWS Services), specifically Lambda triggers, deployment patterns, concurrency, and event-driven integrations. Expect roughly two easy warm-ups, five medium scenarios, and three tougher design calls that mirror the real test.

Read each scenario carefully, note the single hard constraint hiding in it, then click reveal only after you commit to an answer. Every explanation ties back to the current AWS docs, so this AWS Lambda exam practice also doubles as a compact 2026 refresher.

Question 1: Choosing an event source for an S3 upload workflow

Contoso stores customer receipts in an S3 bucket and wants a Lambda function to run each time a new PDF lands there. The team wants the simplest, most native integration with no additional infrastructure. Which trigger configuration meets the requirement?

A) Configure an S3 event notification directly to invoke the Lambda function.

B) Poll the bucket every minute using an EventBridge Scheduler rule.

C) Publish uploads to an SNS topic, then subscribe an SQS queue that Lambda polls.

D) Deploy an EC2 instance that watches the bucket with the AWS CLI.

👁 Reveal Answer

Correct Answer: A

Explanation: S3 event notifications can invoke Lambda functions directly with no intermediate service, which is exactly the “simplest, most native” path. Option B introduces polling overhead and misses events between runs. Option C works but adds two services the scenario says are unnecessary. Option D is anti-pattern for a serverless-first team. For fan-out to many consumers you would layer EventBridge or SNS, however this question asks only for the minimal setup.

Question 2: SnapStart for a Python cold-start problem

Fabrikam runs a Python 3.13 Lambda behind API Gateway. Users report first-request latency above three seconds after idle periods. The team wants to cut cold starts without paying for warm capacity. Which change addresses this most cost-effectively in 2026?

A) Enable Lambda SnapStart on the function’s published version.

B) Configure provisioned concurrency on the $LATEST alias.

C) Migrate the code to an Amazon EC2 t4g.small instance.

D) Increase the function’s memory setting to 10,240 MB.

👁 Reveal Answer

Correct Answer: A

Explanation: SnapStart, expanded to Python and .NET after re:Invent 2025, snapshots an initialized execution environment and restores it in under 200ms, with no per-invocation surcharge. Provisioned concurrency in Option B works but bills for reserved capacity, which the question rules out. Option C throws away the serverless model entirely. Option D can shave milliseconds but never eliminates the init phase; therefore SnapStart is the best fit for the cost constraint.

Question 3: Safe blue/green rollout for a Lambda function

The engineering team at Woodgrove Bank ships a new Lambda version daily. Leadership wants any regression to affect at most 10% of traffic during rollout. Which combination of Lambda features supports this pattern with the least custom code?

A) Publish a version, create an alias, and shift traffic using an alias weighted routing configuration.

B) Deploy two separate functions and manually toggle API Gateway integrations.

C) Use environment variables to gate features and redeploy $LATEST for every release.

D) Enable provisioned concurrency and rely on CloudWatch alarms to redeploy manually.

👁 Reveal Answer

Correct Answer: A

Explanation: Lambda aliases support weighted traffic shifting between two versions natively, so 10% canary routing needs zero custom code. Specifically, you set the alias to route 90% to the old version and 10% to the new one, then increase the weight if metrics stay clean. Option B is operationally heavy and error-prone. Option C mixes deploy and release, which is exactly what the alias pattern avoids. Option D is unrelated to traffic shifting.

Question 4: Choosing between reserved and provisioned concurrency

Northwind Traders runs a Lambda-backed checkout API that must handle predictable 500-request-per-second peaks each weekday at 9:00 AM with sub-100ms latency. The rest of the day traffic is bursty and low. Which concurrency setting fits best?

A) Provisioned concurrency of 500 on the checkout alias.

B) Reserved concurrency of 500 on the function.

C) Neither setting, because Lambda scales automatically to any load.

D) Both reserved and provisioned concurrency set to 10.

👁 Reveal Answer

Correct Answer: A

Explanation: Provisioned concurrency keeps a pool of initialized environments warm, so scheduled peaks avoid cold starts and meet the sub-100ms target. You can pair it with Application Auto Scaling to raise the pool only during the 9 AM window. Reserved concurrency in Option B caps the maximum but does not pre-warm environments; therefore it does not solve latency. Option C is wrong because burst limits still trigger cold starts. Option D under-provisions and wastes both features.

Question 5: DynamoDB Streams to Lambda ordering

Litware needs to react to item-level changes in a DynamoDB table and preserve per-item ordering when a Lambda function processes them. Which configuration guarantees ordered processing per item?

A) Enable DynamoDB Streams and use it as an event source mapping; Lambda processes records in order within each shard.

B) Use EventBridge Pipes with a random ordering configuration.

C) Read the table with a scheduled Lambda every minute and sort by timestamp.

D) Trigger Lambda from an SNS standard topic that the application publishes to on every write.

👁 Reveal Answer

Correct Answer: A

Explanation: DynamoDB Streams partitions records by the item’s partition key into shards, and Lambda consumes each shard in order. As a result, updates to the same item are always processed sequentially. Option B does not exist as described and Pipes still honors shard order. Option C loses events between polls and cannot guarantee order under concurrent writes. Option D uses SNS standard, which is explicitly best-effort ordering.

Question 6: Securing environment variables (AWS Lambda exam practice deep-dive)

Tailwind Traders passes an RDS password to a Lambda function today via a plaintext environment variable. Security requires the value at rest to be encrypted with a customer-managed key (CMK) and rotated automatically. What is the best change?

A) Store the password in AWS Secrets Manager and fetch it in the handler using the AWS SDK, with the CMK set on the secret.

B) Base64-encode the password inside the environment variable.

C) Move the password into the Lambda function code and redeploy on rotation.

D) Store it in Systems Manager Parameter Store as a String parameter.

👁 Reveal Answer

Correct Answer: A

Explanation: Secrets Manager encrypts values with a CMK and supports scheduled automatic rotation for RDS credentials out of the box. In addition, Lambda can cache the secret using the Parameters and Secrets Extension to avoid per-invocation cost. Option B is not encryption. Option C hard-codes secrets into artifacts, which is explicitly discouraged. Option D uses a String parameter, which is not encrypted; a SecureString would be closer but still lacks native RDS rotation.

Question 7: Handling repeated processing failures

Adventure Works runs a Lambda function triggered by an SQS queue. Some messages fail every retry and eventually re-enter the queue, blocking newer work. Which change most cleanly isolates poison messages?

A) Configure a dead-letter queue on the source SQS queue with a maxReceiveCount of 5.

B) Wrap the handler in try/except and silently swallow all exceptions.

C) Increase the function’s timeout to 15 minutes.

D) Add reserved concurrency of 1 to serialize processing.

👁 Reveal Answer

Correct Answer: A

Explanation: An SQS dead-letter queue moves messages that exceed maxReceiveCount into a separate queue for later inspection, so the main queue keeps flowing. This is the AWS-recommended pattern for poison messages. Option B hides bugs and returns success, which deletes messages that never truly processed. Option C does not help because the message would still fail. Option D throttles throughput and does not isolate the bad message.

Question 8: Response streaming for a long AI-generated payload

Your team fronts an LLM with a Lambda function URL. Some completions produce 4 MB of text over 30 seconds, and users see a spinner until the full body arrives. Which 2026 Lambda feature reduces perceived latency without changing the client protocol beyond standard HTTP?

A) Enable response streaming on the Lambda function URL.

B) Return the payload via S3 pre-signed URL after processing completes.

C) Split the response across multiple Lambda invocations from the client.

D) Reduce the memory setting to 128 MB to force smaller batches.

👁 Reveal Answer

Correct Answer: A

Explanation: Response streaming, generally available since 2023 and improved through 2025–2026, lets Lambda return payload chunks to the caller as they are produced over standard HTTP. As a result, users see partial output within milliseconds. Option B still requires the full generation before the URL is useful. Option C shifts complexity to the client for no gain. Option D would slow the function down without helping perceived latency.

Question 9: Least-privilege IAM for a Lambda writing to a single S3 bucket

Contoso needs a Lambda execution role that only allows PutObject on the arn:aws:s3:::contoso-invoices/* prefix and nothing else on S3. Which policy statement follows least privilege?

A) Effect Allow, Action s3:PutObject, Resource arn:aws:s3:::contoso-invoices/*.

B) Effect Allow, Action s3:*, Resource *.

C) Effect Allow, Action s3:PutObject, Resource *.

D) Effect Deny, Action s3:PutObject, Resource arn:aws:s3:::contoso-invoices/*, combined with an Allow on s3:*.

👁 Reveal Answer

Correct Answer: A

Explanation: Least privilege means scoping both the action and the resource ARN to exactly what the function needs, which Option A does. Option B is the classic anti-pattern and grants full S3 across the account. Option C over-grants at the resource level. Option D is contradictory and shows a misunderstanding of IAM policy evaluation; specifically, an explicit Deny would block the very operation the function requires.

Question 10: Choosing between Lambda and ECS Fargate for a 30-minute job

The data team at Fabrikam needs to run a report generator that consistently takes 25 to 40 minutes per execution and runs a few times per day. Which compute option is the best fit in 2026?

A) Amazon ECS on Fargate, invoked by EventBridge Scheduler.

B) AWS Lambda with the maximum 15-minute timeout, split across chained invocations.

C) Lambda@Edge behind CloudFront.

D) A permanently running EC2 t3.medium instance.

👁 Reveal Answer

Correct Answer: A

Explanation: Lambda’s hard 15-minute execution ceiling still applies in 2026, so any job that regularly runs 25–40 minutes belongs on Fargate or another container option. EventBridge Scheduler triggers the task cleanly and you only pay while it runs. Option B adds orchestration complexity and hidden state between invocations. Option C is meant for short CDN edge logic. Option D keeps compute running 24/7 for a job that runs a few times per day, which is wasteful.

Study Tips for This AWS Lambda Exam Practice Set

Use these habits to turn each miss during your AWS Lambda exam practice into durable knowledge and move faster through the real DVA-C02.

  • Anchor on the constraint. Every scenario hides one deciding factor — latency budget, cost cap, ordering, blast radius. Circle it before comparing options; this is the single biggest score improvement most candidates get.
  • Know the 2026 feature deltas. SnapStart on Python and .NET, response streaming, and the new scaling rate change several “best answer” picks that were different two years ago. Therefore re-read the AWS What’s New feed weekly.
  • Practice the alias + version pattern. Blue/green, canary, and linear rollouts are all one alias configuration away. If you can draw the traffic shift on paper, you will spot the correct answer in seconds.
  • Memorize hard limits. Payload size, /tmp size (10,240 MB max), timeout ceiling (15 minutes), and the newer 1,000-per-10-seconds scaling rate. These are frequent distractors.
  • Reason about failure paths. DLQs, on-failure destinations, retries, and idempotency come up in almost every exam. In addition, always ask “what happens on the second try?”

Keep Practicing Your AWS Lambda Exam Practice Rotation

Consistent reps are what separate a marginal pass from a comfortable one, so schedule short daily sessions rather than one big cram. This AWS Lambda exam practice set covers the highest-yield Domain 1 topics; the next entry in this series will pivot to Domain 2 (Security), including KMS grants, resource policies, and Cognito integration patterns. For deeper background, the current AWS Lambda Developer Guide is the authoritative reference and is updated within days of any feature launch.

When you finish this set, keep the momentum going with related practice from earlier in the series. For architecture-side coverage of the same services, try SAA-C03 Question 37: Event-Driven Processing Without Servers. If you want to sharpen decoupling patterns Lambda often depends on, work through SAA-C03 Question 10: Decoupling with SQS. For a broader Azure counterpart on serverless design tradeoffs, review AZ-305 Questions 1-10: Cost Optimization.

See you tomorrow with the next set. Good luck, and remember: an AWS Lambda exam practice streak of even 15 minutes a day compounds fast — pass the exam once, but keep the habits forever.