nerdexam
Amazon

SAP-C02 · Question #753

A company is developing a latency-sensitive application. Part of the application includes several AWS Lambda functions that need to initialize as quickly as possible. The Lambda functions are…

The correct answer is C. Publish a version of each Lambda function. Set up a provisioned concurrency configuration for. To make latency-sensitive Java Lambda functions initialize as quickly as possible and cost-effectively, set up provisioned concurrency to keep execution environments pre-initialized.

Submitted by jordan8· Mar 6, 2026Design for New Solutions

Question

A company is developing a latency-sensitive application. Part of the application includes several AWS Lambda functions that need to initialize as quickly as possible. The Lambda functions are written in Java and contain initialization code outside the handlers to load libraries, initialize classes, and generate unique IDs. Which solution will meet the startup performance requirement MOST cost-effectively?

Options

  • AMove all the initialization code to the handlers for each Lambda function. Activate Lambda
  • BPublish a version of each Lambda function. Create an alias for each Lambda function. Configure
  • CPublish a version of each Lambda function. Set up a provisioned concurrency configuration for
  • DUpdate the Lambda functions to add a pre-snapshot hook. Move the code that generates unique

How the community answered

(37 responses)
  • A
    8% (3)
  • B
    3% (1)
  • C
    84% (31)
  • D
    5% (2)

Why each option

To make latency-sensitive Java Lambda functions initialize as quickly as possible and cost-effectively, set up provisioned concurrency to keep execution environments pre-initialized.

AMove all the initialization code to the handlers for each Lambda function. Activate Lambda

Moving initialization code into the handler would cause it to run on every invocation, drastically increasing the execution time for all requests, not just cold starts, and severely worsening overall latency.

BPublish a version of each Lambda function. Create an alias for each Lambda function. Configure

Publishing Lambda versions and creating aliases are primarily for deployment management and traffic shifting, not for reducing cold start latency.

CPublish a version of each Lambda function. Set up a provisioned concurrency configuration forCorrect

Setting up provisioned concurrency for AWS Lambda functions keeps a specified number of execution environments initialized and ready to process invocations instantly, effectively eliminating cold start delays for those instances. This is the most direct and cost-effective way to ensure latency-sensitive Java functions, with significant initialization code, start 'as quickly as possible' by avoiding cold starts.

DUpdate the Lambda functions to add a pre-snapshot hook. Move the code that generates unique

While AWS Lambda SnapStart (which uses pre-snapshot hooks) significantly reduces cold start times for Java functions, it does not entirely eliminate them like Provisioned Concurrency. Additionally, managing non-idempotent initialization logic (like generating unique IDs) with SnapStart requires careful code adjustments to ensure correctness.

Concept tested: AWS Lambda Provisioned Concurrency for cold start reduction

Source: https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html

Community Discussion

No community discussion yet for this question.

Full SAP-C02 Practice