DVA-C02 exam dumps

DVA-C02 practice question 18 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 18

Single answer

You are developing an AWS Lambda function to process customer orders for an e-commerce application. Each invocation of the Lambda function processes a single order and does not rely on any data from previous executions. Which of the following best describes the behavior of the Lambda function?

  1. A

    The Lambda function is stateful because it can retain data between invocations.

  2. B

    The Lambda function is stateless because it does not retain data between invocations.

  3. C

    The Lambda function is stateful because it uses environment variables.

  4. D

    The Lambda function is stateless because it scales automatically based on demand.

Show answer and explanation

Correct answer: B

Explanation

AWS Lambda functions are stateless by design, meaning they do not retain any state or data between invocations. Each invocation is treated as an independent event, and any necessary state must be maintained externally using services like DynamoDB, S3, or other persistent storage. This stateless behavior allows Lambda to scale automatically and handle multiple invocations concurrently without concerns about shared state.

  • A. Incorrect.

    Incorrect: Lambda functions are inherently stateless, as they do not retain any data between invocations unless explicitly done using external storage services like DynamoDB or S3.

  • B. Correct.

    Correct: Lambda functions are stateless by design, meaning each invocation is independent and does not retain data from previous executions.

  • C. Incorrect.

    Incorrect: While environment variables can be used in a Lambda function, they do not make the function stateful. Environment variables are static and not tied to the state of the function across invocations.

  • D. Incorrect.

    Incorrect: Automatic scaling is a feature of Lambda but does not determine whether it is stateful or stateless. Statelessness refers to the lack of retained state between invocations.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam