AWS Certified Solutions Architect Decoupling with SQS and SNS 3 — Questions and Answers
Question 1: A team wants to replay all past SNS notifications to a newly added SQS subscriber. Which statement is correct about SNS replay capability?
- SNS supports message replay for up to 14 days by default
- SNS does not support replay; messages must be sourced from an archive such as Kinesis or S3 (Correct answer)
- SNS automatically replays messages when a new subscription is added
- SNS replay is available only for FIFO topics
Correct answer: SNS does not support replay; messages must be sourced from an archive such as Kinesis or S3
SNS is a push-based, stateless service with no message replay capability; to replay events, store them in S3, Kinesis, or another durable store.
Question 2: An application publishes 5,000 messages per second to an SNS topic. Which SNS topic type supports this throughput while preserving strict message ordering?
- Standard SNS topic with multiple subscriptions
- FIFO SNS topic (Correct answer)
- Standard SNS topic with delivery retry policies
- FIFO SNS topic with content-based deduplication disabled
Correct answer: FIFO SNS topic
FIFO SNS topics preserve strict ordering and exactly-once delivery but are limited to 300 publishes/second (or 30,000 with batching), so 5,000/s requires batching or architectural consideration.
Question 3: A Lambda function is subscribed to an SQS queue. The function fails processing a batch. What determines which messages are retried?
- All messages in the batch become visible after the visibility timeout and are retried
- Only messages explicitly returned in the batchItemFailures response are retried (Correct answer)
- All messages are immediately moved to the DLQ on the first failure
- Lambda automatically retries only the first message in the batch
Correct answer: Only messages explicitly returned in the batchItemFailures response are retried
When reportBatchItemFailures is enabled, Lambda retries only the message IDs listed in the batchItemFailures response, leaving successfully processed messages deleted.
Question 4: What is the maximum retention period for messages stored in an Amazon SQS queue?
- 1 day
- 4 days (default)
- 14 days (Correct answer)
- 30 days
Correct answer: 14 days
SQS can retain messages for a configurable period between 1 minute and 14 days; the default is 4 days.
Question 5: A company needs to send a single notification that triggers email delivery AND writes to an SQS queue simultaneously. Which AWS service pattern accomplishes this?
- SQS queue with a Lambda trigger that sends emails
- SNS topic with email and SQS subscriptions (fan-out) (Correct answer)
- EventBridge rule targeting SQS with a separate SES call
- SQS queue with a DLQ configured for email alerts
Correct answer: SNS topic with email and SQS subscriptions (fan-out)
The SNS fan-out pattern allows a single publish to simultaneously deliver to multiple endpoints including email subscribers and SQS queues.
Question 6: Which SQS attribute controls how many times a message can be received before being sent to the dead-letter queue?
- VisibilityTimeout
- MaxReceiveCount in the RedrivePolicy (Correct answer)
- DelaySeconds
- MessageRetentionPeriod
Correct answer: MaxReceiveCount in the RedrivePolicy
The RedrivePolicy's maxReceiveCount defines how many delivery attempts SQS allows before moving the message to the configured dead-letter queue.
Question 7: An architect is designing a system where an SQS queue must receive messages from SNS topics in a different AWS account. What is required?
- VPC peering between both accounts
- An SQS resource-based policy granting the cross-account SNS topic permission to SendMessage (Correct answer)
- An IAM role in the source account assumed by SNS
- AWS Organizations service control policy allowing cross-account SNS
Correct answer: An SQS resource-based policy granting the cross-account SNS topic permission to SendMessage
The SQS queue needs a resource policy explicitly granting the cross-account SNS topic's ARN permission to call sqs:SendMessage.
A team wants to replay all past SNS notifications to a newly added SQS subscriber.
Which statement is correct about SNS replay capability?