What is the difference between SQS and SNS, and when do you use each?
AWS · Advanced level
Answer
SQS is a queue for decoupled work processing; SNS is pub/sub fan-out notification. They are often combined by publishing to SNS and subscribing multiple SQS queues so each consumer can process independently.
Technical explanation
SNS plus SQS creates durable fan-out with independent retry and DLQ behavior for each consumer.
Messaging services decouple producers and consumers, but the reliability model depends on ordering, retries, DLQs, idempotency, batching, and backpressure.
At-least-once delivery means consumers must safely handle duplicate messages unless the business can tolerate duplicates.
Monitor queue depth, age of oldest message, DLQ count, consumer errors, throttles, and downstream saturation.
Hands-on example
1. Create a small producer and consumer using the relevant service - SQS, SNS, or EventBridge.
2. Add retry, DLQ, visibility timeout or event rule configuration, and idempotency key handling.
3. Inject duplicate messages, consumer failure, and downstream throttling to observe retry and backpressure behavior.
4. Alarm on age, DLQ count, failed deliveries, throttles, and consumer error rate.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More AWS interview questions
- What is the difference between an SQS standard and FIFO queue?
- What is AWS Systems Manager, and how is Session Manager safer than SSH bastions?
- How do you detect and reduce unexpected AWS cost increases?
- What is an AMI, and how do you build standardised, hardened images?
- Compare backup-and-restore, pilot light, warm standby, and multi-site DR strategies.
- How do you troubleshoot an EC2 instance that is unreachable over SSH?
- What is a CloudFormation change set and a drift detection?
- What is the difference between Secrets Manager and SSM Parameter Store?