nerdexam
Amazon

DVA-C02 · Question #237

A developer is designing a serverless application that customers use to select seats for a concert venue. Customers send the ticket requests to an Amazon API Gateway API with an AWS Lambda function th

The correct answer is A. Send the order ID to an Amazon Simple Notification Service (Amazon SNS) FIFO topic that fans. Option A uses an Amazon SNS FIFO topic (with SQS FIFO queues as subscribers for each Lambda function), which is the only option that satisfies both ordering and fan-out simultaneously. FIFO guarantees that the first-received order ID is always delivered first to both the inventor

Submitted by rachelw· Mar 5, 2026Development with AWS Services

Question

A developer is designing a serverless application that customers use to select seats for a concert venue. Customers send the ticket requests to an Amazon API Gateway API with an AWS Lambda function that acknowledges the order and generates an order ID. The application includes two additional Lambda functions: one for inventory management and one for payment processing. These two Lambda functions run in parallel and write the order to an Amazon Dynamo DB table. The application must provide seats to customers according to the following requirements. If a seat is accidently sold more than once, the first order that the application received must get the seat. In these cases, the application must process the payment for only the first order. However, if the first order is rejected during payment processing, the second order must get the seat. In these cases, the application must process the payment for the second order. Which solution will meet these requirements?

Options

  • ASend the order ID to an Amazon Simple Notification Service (Amazon SNS) FIFO topic that fans
  • BChange the Lambda function that generates the order ID to initiate the Lambda function for
  • CSend the order ID to an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the
  • DDeliver the order ID to an Amazon Simple Queue Service (Amazon SQS) queue. Configure the

How the community answered

(13 responses)
  • A
    69% (9)
  • B
    8% (1)
  • C
    15% (2)
  • D
    8% (1)

Explanation

Option A uses an Amazon SNS FIFO topic (with SQS FIFO queues as subscribers for each Lambda function), which is the only option that satisfies both ordering and fan-out simultaneously. FIFO guarantees that the first-received order ID is always delivered first to both the inventory and payment functions, ensuring the seat goes to the rightful winner - and if that first payment fails, the next message in the queue (the second order) is processed instead.

Why the distractors fail:

  • Option C (standard SNS topic) lacks ordering guarantees - messages can arrive out of sequence, so the "second" order could be processed before the "first."
  • Option D (SQS queue alone) doesn't support fan-out to multiple consumers; a single SQS queue can't simultaneously drive both the inventory Lambda and the payment Lambda independently.
  • Option B (Lambda invoking Lambda directly) creates tight synchronous coupling and has no built-in FIFO ordering or retry/fallback mechanism for the payment rejection scenario.

Memory tip: Think "FIFO = First In, First Out = First customer keeps the seat." Whenever an AWS question requires both strict ordering and fan-out to multiple services, the pattern is always SNS FIFO → SQS FIFO queues - SNS handles the broadcast, FIFO preserves the order.

Topics

#Serverless#Message Ordering#AWS Lambda#Amazon SNS FIFO

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice