easymultiple choiceObjective-mapped

An orders service consumes payment instructions from an Amazon SQS queue. Sometimes the consumer times out after applying the payment but before deleting the SQS message. As a result, the same payment instruction is processed again. Which design change most directly prevents duplicate side effects caused by message retries?

Question 1easymultiple choice
Full question →

An orders service consumes payment instructions from an Amazon SQS queue. Sometimes the consumer times out after applying the payment but before deleting the SQS message. As a result, the same payment instruction is processed again. Which design change most directly prevents duplicate side effects caused by message retries?

Answer choices

Why each option matters

Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.

A

Distractor review

Delete the SQS message immediately after it is received, before processing, to ensure it is not retried.

Deleting immediately breaks the at-least-once processing model. If processing fails after deletion (for example, before payment is committed), the message is lost and the side effect may not be applied correctly.

B

Best answer

Implement idempotency by recording a processed marker keyed by the instruction ID and ignoring duplicates.

Idempotency ensures that repeated deliveries of the same instruction do not cause repeated side effects. By persisting a record keyed by instruction ID (or enforcing a unique constraint in a transactional store), the service can detect duplicates and safely skip or reconcile them even if SQS redelivers the message.

C

Distractor review

Increase the SQS visibility timeout to a maximum value to avoid retries entirely.

A larger visibility timeout reduces retry frequency but does not eliminate duplicates. If the consumer times out (or crashes) after applying the side effect and before deletion, the message will still be redelivered later, so duplicates can still occur.

D

Distractor review

Convert the queue to FIFO and enable content-based deduplication.

FIFO deduplication prevents duplicates based on message deduplication IDs at the time messages are sent to the queue. Message retries are redeliveries of the same enqueued message and are not prevented by content-based deduplication, so duplicate side effects are still possible without idempotent processing.

Common exam trap

Common exam trap: answer the scenario, not the keyword

Many certification questions include familiar terms but test a specific constraint. Read the exact wording before choosing an answer that is generally true but wrong for this case.

Technical deep dive

How to think about this question

This question should be treated as a scenario, not a definition check. Identify the problem, the constraint and the best action. Then compare each option against those facts.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.
  • Use explanations to understand the rule behind the answer.

TExam Day Tips

  • Underline the problem statement mentally.
  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Related practice questions

Related SAA-C03 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

More questions from this exam

Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.

FAQ

Questions learners often ask

What does this SAA-C03 question test?

Read the scenario before looking for a memorised answer.

What is the correct answer to this question?

The correct answer is: Implement idempotency by recording a processed marker keyed by the instruction ID and ignoring duplicates. — SQS provides at-least-once delivery, so timeouts and crashes can cause the same message to be processed more than once. To prevent duplicate payment side effects, the system must be idempotent. Persist a processed marker keyed by the payment instruction ID (or enforce uniqueness in a database) so that if the same instruction is retried, the service recognizes it as already handled and does not apply the side effect again. Option A sacrifices reliability and can lose messages if processing fails after deletion. Option C only changes timing; it does not guarantee that duplicates never happen. Option D addresses enqueue-time duplicates, not retry-driven duplicate deliveries, so it does not replace idempotent side-effect handling.

What should I do if I get this SAA-C03 question wrong?

Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.

Discussion

Loading comments…

Sign in to join the discussion.