An SQS consumer retrieves a message and begins processing it. Before processing completes, the visibility timeout expires. What happens to the message?
- AThe message is permanently deleted from the queue.
- BThe message becomes visible again in the queue and can be received by another consumer.✓ Correct
- CThe message is moved to the Dead Letter Queue automatically.
- DThe message is held for 24 hours and retried once.
Visibility timeout (default 30 seconds, max 12 hours) hides a message from other consumers while it is being processed. If processing completes successfully, the consumer deletes the message. If the timeout expires before deletion, the message reappears and can be retried. Set the visibility timeout to slightly longer than your expected processing time.
A financial application requires that messages are processed in the exact order they are sent, and each message must be processed exactly once with no duplicates. Which SQS queue type meets these requirements?
- ASQS Standard Queue — at-least-once delivery with best-effort ordering (can be out of order).
- BSQS FIFO Queue — First-In-First-Out ordering with exactly-once processing.✓ Correct
- CSQS Priority Queue — does not exist as a native SQS queue type.
- DSQS Dead Letter Queue — stores failed messages, not a queue for ordered processing.
FIFO queues guarantee strict message ordering and exactly-once processing (using deduplication IDs). They have a lower throughput limit: up to 3,000 messages/second with batching, or 300 without. Standard queues offer nearly unlimited throughput but only guarantee at-least-once delivery and best-effort ordering. FIFO queue names must end with ".fifo".
When a new order is placed, a company needs to simultaneously: (1) send an email confirmation, (2) update inventory in an SQS queue, and (3) log the event to an SQS analytics queue. What is the MOST efficient architectural pattern?
- AHave the application call the email API, then both SQS queues sequentially — tight coupling.
- BSNS Fan-out: publish once to an SNS topic; subscribe the email endpoint and both SQS queues to the topic.✓ Correct
- CUse a single SQS queue and have each consumer poll and filter messages they care about.
- DUse three separate Lambda functions each subscribed to the same S3 event trigger.
The SNS Fan-out pattern decouples the publisher from subscribers. A single SNS publish triggers all subscribers simultaneously. SQS queues subscribing to SNS provide durable buffers for downstream processors. This avoids tight coupling, ensures all subscribers receive the message, and scales independently.
Messages in an SQS queue are failing processing after 3 retries. The team wants to isolate these failed messages for debugging without losing them. Which feature should they configure?
- ASQS Long Polling — reduces empty ReceiveMessage calls; does not handle failed messages.
- BSQS Visibility Timeout increase — gives more time for processing, not for capturing failures.
- CSQS Dead Letter Queue (DLQ) — messages exceeding the maxReceiveCount are automatically moved to the DLQ for analysis.✓ Correct
- DSQS Message Timer — delays message delivery, not for failure handling.
A Dead Letter Queue is a separate SQS queue configured as the DLQ for a source queue. When a message's ReceiveCount exceeds the maxReceiveCount threshold (configurable), SQS moves it to the DLQ automatically. You can then inspect DLQ messages to debug failures. DLQs can also be configured for SNS subscriptions.
What is the maximum message retention period for an SQS queue?
- A1 day (24 hours).
- B4 days (96 hours — the default retention period).
- C14 days (1,209,600 seconds — the maximum configurable retention period).✓ Correct
- D30 days.
SQS message retention is configurable from 60 seconds (minimum) to 14 days (maximum). The default is 4 days. Messages not consumed within the retention period are automatically deleted by SQS. For longer-term storage, messages should be persisted to S3, DynamoDB, or another durable store before deletion.