What is Amazon SQS and SNS?
Why Interviewers Ask This
This is a classic screening question for AWS / Cloud Computing roles. Hiring managers ask it early in interviews to gauge your baseline understanding and determine if you can communicate technical concepts clearly.
Answer
Amazon SQS (Simple Queue Service) is a fully managed message queue for decoupling and scaling microservices, distributed systems, and serverless applications. Messages are stored until consumers process them. Queue types: Standard queue — maximum throughput (unlimited TPS), at-least-once delivery, best-effort ordering. FIFO queue — exactly-once processing, first-in-first-out order, up to 3,000 TPS with batching. Key features: message size up to 256KB (larger via SQS Extended Client with S3); retention period 1 minute to 14 days (default 4 days); visibility timeout (message hidden while being processed, becomes visible again if not deleted — prevents double processing); dead-letter queue (DLQ — failed messages after N receive attempts); long polling (reduces empty receives, max 20s wait); delay queues (postpone delivery up to 15 min). Amazon SNS (Simple Notification Service) is a fully managed pub/sub messaging service. Publishers send messages to topics; all subscribers receive a copy. Subscribers: SQS, Lambda, HTTP/HTTPS, Email, SMS, mobile push (FCM, APNs). Fan-out pattern: SNS topic → multiple SQS queues — decouple event processing. FIFO topics: strict ordering, exactly-once delivery (paired with SQS FIFO). Message filtering: subscribers receive only messages matching their filter policy — reduces unnecessary processing. SNS + SQS fan-out: one S3 upload event → SNS → multiple SQS queues → different Lambda processors (thumbnail, metadata extraction, virus scan) — fully decoupled.
Pro Tip
Before answering, structure your response: one-line definition → real-world analogy → concrete example from a project. This makes even complex AWS / Cloud Computing answers easy to follow.