AWS Certified Developer – Associate (DVA-C02) — Question 69

A developer created an AWS Lambda function that accesses resources in a VPC. The Lambda function polls an Amazon Simple Queue Service (Amazon SQS) queue for new messages through a VPC endpoint. Then the function calculates a rolling average of the numeric values that are contained in the messages. After initial tests of the Lambda function, the developer found that the value of the rolling average that the function returned was not accurate.

How can the developer ensure that the function calculates an accurate rolling average?

Answer options

Correct answer: A

Explanation

Setting the function's reserved concurrency to 1 ensures that only one instance of the Lambda function processes messages at a time, preventing concurrent execution that could lead to inaccurate calculations of the rolling average. The other options either do not address the issue of concurrent execution or suggest methods that do not guarantee accuracy in the calculation process.