AWS SQS interview questions: standard vs FIFO, visibility timeout, dead-letter queues
Reviewed by Mark Dickie · Last updated
8 questions on this page you can answer and see marked on the spot. Go to the first one
Amazon SQS is a managed message queue that lets producers and consumers run at different speeds without a broker you operate. Interviewers mostly probe the trade-offs: standard queues give at-least-once delivery with best-effort ordering, while FIFO queues keep order within a message group and deduplicate sends within a five-minute window. Candidates usually lose points on the visibility timeout, which hides a received message from other consumers for a set period, and on what happens to a message after repeated failed receives.
Which SQS settings do interviewers ask about?
| Setting or behavior | Default and limit | Why it comes up |
|---|---|---|
| Visibility timeout | 30 seconds by default, up to 12 hours | A timeout shorter than processing time causes the same message to be handled twice |
| Long polling | ReceiveMessage WaitTimeSeconds up to 20 | Fewer empty responses and lower request cost than short polling |
| Message retention | 4 days by default, up to 14 days | Messages expire silently if consumers fall behind |
| Delay queues | Up to 15 minutes | Delays delivery per queue or per message, which is not the same as the visibility timeout |
| Dead-letter queue | Redrive policy with maxReceiveCount | Isolates poison messages; a FIFO source queue needs a FIFO dead-letter queue |
| Payload size | 256 KB per message | Larger payloads go through the Amazon S3 extended client library |
How do you practice SQS before the interview?
- Create a standard queue with a 30-second visibility timeout, send a few messages, and receive them without deleting. Watch them reappear once the timeout expires.
- Attach a redrive policy with maxReceiveCount set to 3 and a dead-letter queue, force the consumer to fail, and confirm the message moves across.
- Recreate the flow as a FIFO queue, add a MessageGroupId to each send, and compare ordering when two message groups interleave.
- Send the same MessageDeduplicationId twice inside five minutes and check that only one copy is delivered.
Key facts
- Tarmac's AWS interview questions cover 10 questions at difficulty 1–5 of 5.
- Tarmac tracked 2,755 job postings asking for AWS in November 2026.
- Roles asking for AWS advertise a median base salary of £80,000, across 1,117 job postings as of November 2026.
- Tarmac last reviewed these AWS interview questions on 23 November 2026.
At a glance
| Questions | 10 |
|---|---|
| Difficulty | 1–5 of 5 |
| Formats | Multiple choice, True / false, Fill in the blank, Multiple answer, Short answer |
What you'll review
- sqs
Practice questions
Try one before you open the answer. Pick an option and press Check; it's marked on the spot.
In Amazon SQS, what is the default visibility timeout for a queue?#
Options
Show answer
The default visibility timeout for an Amazon SQS queue is 30 seconds. After a consumer receives a message, SQS hides it from other consumers for that long. If the message isn't deleted before the timeout ends, it shows up in the queue again. You can configure the timeout from 0 seconds up to 12 hours.
New SQS queues get a 30-second default visibility timeout. During that window, a message a consumer has received stays hidden from other consumers. You can set it anywhere from 0 seconds to 12 hours, so 0 seconds and 12 hours are the limits of the range, not the default. 5 minutes is just a value people often pick themselves.
Amazon SQS standard queues guarantee that each message is delivered exactly once and in the exact order it was sent.#
Options
Show answer
Amazon SQS standard queues do not guarantee exactly-once delivery or strict ordering. They give at-least-once delivery and best-effort ordering, so messages can sometimes be duplicated or arrive out of order. If you need strict order and exactly-once processing, use an SQS FIFO queue.
Standard queues give at-least-once delivery and best-effort ordering. A message can occasionally arrive more than once or out of order. If you need first-in-first-out ordering and exactly-once processing, use an SQS FIFO queue.
A consumer receives a message from an Amazon SQS standard queue but crashes before deleting it. What happens to the message?#
Options
Show answer
An SQS message that is received but never deleted becomes visible again once its visibility timeout expires, and another consumer can then receive it. Receiving a message only hides it for a while; the consumer has to call DeleteMessage explicitly. This at-least-once delivery model means consumers should be idempotent.
Receiving a message from SQS does not delete it. Instead, the message is hidden for the visibility timeout (30 seconds by default). If the consumer does not call DeleteMessage within that window, the message becomes visible again and can be redelivered. That is why it reappears once the visibility timeout expires. It goes to a dead-letter queue only after its receive count goes past the redrive policy's maxReceiveCount, not after a single failure. It does not stay hidden until the retention period ends. And SQS never deletes a message automatically just because it was received.
To cut down on empty responses and API costs when polling Amazon SQS, set WaitTimeSeconds to a value greater than 0, up to a maximum of _____ seconds. This is called _____ polling.#
Show answer
To cut down on empty responses and API costs when polling Amazon SQS, set WaitTimeSeconds to a value greater than 0, up to a maximum of 20 seconds. This is called long polling.
With long polling, a ReceiveMessage call waits up to WaitTimeSeconds for a message to arrive before it returns. The maximum wait is 20 seconds. This reduces empty responses and false empty responses compared with short polling, which returns immediately and queries only a subset of the queue's servers.
A standard SQS queue can deliver the same message more than once, so consumers of a standard queue should be written to handle duplicate processing idempotently.#
Options
Show answer
True. Standard SQS queues provide at-least-once delivery — because messages are stored redundantly across servers, a transient failure during a delete can cause the same message to be received again, so consumers must process messages idempotently. FIFO queues are the option that suppresses duplicates and preserves order (exactly-once processing) at the cost of throughput. Treating a standard queue as exactly-once is a common cause of double-applied side effects like duplicate charges.
True. Standard queues guarantee at-least-once delivery: because SQS stores messages redundantly across servers, a server being briefly unavailable during a delete can cause the same message to be received again. So consumers must be idempotent. If you need duplicates suppressed and strict ordering, you use a FIFO queue, which provides exactly-once processing and ordered delivery (at lower throughput). Assuming a standard queue delivers exactly once is a frequent source of double-charged payments and duplicated side effects in production.
An Amazon SQS standard queue has a visibility timeout of 30 seconds. A Lambda-free EC2 consumer receives a message, but processing regularly takes about 2 minutes. Operators notice the same message is processed by multiple consumers. Which change correctly addresses the root of this duplicate processing?#
Options
Show answer
Duplicate processing in SQS when work outlasts the visibility timeout is fixed by extending visibility beyond processing time—via ChangeMessageVisibility or a longer queue visibility timeout—and deleting the message after success. Otherwise the message reappears after the timeout and another consumer picks it up. Long polling, retention period, and delivery delay don't affect in-flight visibility.
When a consumer receives a message, SQS hides it only for the visibility timeout. If processing (2 minutes) outlasts the timeout (30 seconds) and the message isn't deleted, it becomes visible again and another consumer receives it. Extending visibility via ChangeMessageVisibility or a longer queue timeout, then deleting on success, fixes this. Long polling only reduces empty receives; retention controls how long unconsumed messages persist; DelaySeconds delays initial delivery but does nothing once a message is in flight.
A Lambda function consumes an SQS standard queue through an event source mapping with batch size 10. The function timeout is 15 seconds, and the queue's visibility timeout is 30 seconds. The queue has a redrive policy with maxReceiveCount 5. Each batch needs about 60 seconds of work. What happens to a batch?#
Options
Show answer
When a Lambda function's timeout is shorter than its batch work, each invocation is stopped before finishing and the batch is not deleted. The messages reappear after the queue's visibility timeout, and repeated failed receives eventually move them to the dead-letter queue once the redrive maxReceiveCount is reached.
The function timeout (15 s) is shorter than the work each batch needs (about 60 s), so every invocation is stopped at 15 seconds with an error. Because the invocation failed, Lambda does not delete the batch, so its messages become visible again after the 30-second visibility timeout and are received again. Each receive increments the receive count, and after 5 receives the redrive policy moves the messages to the dead-letter queue. The mapping can be created because Lambda's create-time check only requires the queue visibility timeout to be at least the function timeout, and 30 s is greater than 15 s. Nothing is throttled, and messages are not sent to the dead-letter queue on their first receive.
An AWS Lambda function consumes an Amazon SQS standard queue through an event source mapping with batch size 10. Occasionally one message in a batch fails processing, and the whole batch is retried, causing duplicate side effects for the 9 successful messages. Which changes directly address this? (Select all that apply.)#
Options
Pick every one that applies.
Show answer
To stop duplicate side effects when Lambda retries SQS batches, turn on ReportBatchItemFailures and return only the failed message IDs in batchItemFailures, and make the handler idempotent. Partial batch responses mean only the failed messages are redelivered. Idempotency covers SQS's at-least-once delivery. Raising the visibility timeout only delays retries, and content-based deduplication works only on FIFO queues.
With ReportBatchItemFailures enabled, Lambda deletes the successful messages and makes only the reported failed IDs visible again, so the batch is no longer retried as a whole. Because SQS standard queues deliver at least once, the handler should still be idempotent so that any duplicate delivery is harmless. A longer visibility timeout only delays the retry, and the successful messages still get reprocessed. Content-based deduplication is a FIFO-only feature and cannot be enabled on a standard queue.
An Amazon SQS FIFO queue (default settings: deduplication scope = queue, FIFO throughput limit = per queue) is consumed by a Lambda event source mapping. Which statements are correct?#
Options
Pick every one that applies.
Show answer
An SQS FIFO queue blocks later messages in a message group while an earlier one from that group is in flight. Duplicates sent within the fixed 5-minute deduplication interval are accepted but not delivered again. Content-based deduplication uses a SHA-256 hash of the body only. The interval cannot be configured, and with a single message group Lambda processes only one batch at a time.
FIFO queues keep each message group in order by not delivering later messages from a group while an earlier one is in flight, so the statement about in-flight messages is correct. Deduplication uses a fixed 5-minute interval: a duplicate ID sent within that window is accepted and returns success, but the message is not delivered again. Content-based deduplication hashes only the message body with SHA-256 and ignores attributes. The 5-minute interval cannot be configured, so 'up to 12 hours' is false. Lambda's concurrency on a FIFO queue is limited by the number of active message groups, so one group means at most one batch is processed at a time, not many concurrent invocations.
A Lambda function with reserved concurrency 5 consumes a standard SQS queue through an event source mapping (ESM). During a traffic burst, many messages land in the DLQ (redrive policy maxReceiveCount = 2), yet the function never threw an error on them. Explain the mechanism that causes this, then name the redrive policy setting that determines when these messages are moved to the DLQ and give a value for it that lets messages survive several throttled delivery attempts.#
Show answer
Mechanism: when the burst pushes invocations past the function's reserved concurrency of 5, Lambda throttles some of the batches the SQS poller delivers. Throttled messages are not processed, so they are not deleted; they become visible again only after the queue's visibility timeout expires, and the poller backs off while throttling continues. Each receive increments ApproximateReceiveCount, so with maxReceiveCount = 2 a message is moved to the DLQ after two receives even though it was never run successfully. Setting: maxReceiveCount on the queue's redrive policy. Set it to 5 or higher so throttled messages get several receive attempts before redrive, while the throttling itself is reduced by capacity settings such as reserved concurrency or the ESM's maximum concurrency.
The function never errors, but reserved concurrency of 5 caps simultaneous invocations, so SQS batches beyond that cap are throttled and left unprocessed, not deleted. Each delivery attempt, including a throttled one, increments ApproximateReceiveCount, and with maxReceiveCount set to 2 a message is redriven to the DLQ after only two receives despite never having run. The setting that governs this redrive decision is maxReceiveCount on the redrive policy; raising it to 5 or higher gives throttled messages more receive attempts before they are moved. The visibility timeout only controls when throttled messages reappear, not how many receives they accumulate, so it is not the setting this question asks for.
Related interview questions
Job market
See aws salaries and hiring demand from live job postings.
Practise these until they stick
That's every question we hold on this topic, and the page marks what you pick. What it can't do is remember. A free account keeps every answer, and what you miss comes back until it's right: after a day, then at longer gaps.
Free · the whole bank · 100 answers per 30 days, each marked with written feedback