Beginner60 min

Real-Time Chat System

Real-time chat is one of the most frequently asked system design questions at FAANG companies because it combines WebSocket connection management, message ordering guarantees, presence detection, and offline message queuing into a single problem. In this challenge, you will architect a chat system that supports one-on-one messaging, group chats with up to 500 members, read receipts, typing indicators, and online/offline presence. The connection layer uses API Gateway WebSocket APIs with Lambda authorizers for authentication. Messages flow through an SQS FIFO queue to guarantee exactly-once, ordered delivery, then fan out to all group members via SNS. Message storage uses DynamoDB with a composite key design — partition key on conversation ID, sort key on timestamp — enabling efficient pagination of chat history. For presence detection, you will implement a heartbeat pattern using ElastiCache with TTL-based expiration: clients send heartbeats every 30 seconds, and absence of a heartbeat triggers an offline event. The architecture handles the thundering herd problem when a popular user comes online by batching presence notifications. You will also design the push notification path for offline users using SNS and Firebase Cloud Messaging. This challenge teaches connection state management, message ordering in distributed systems, and efficient fan-out strategies.

AWS Services You'll Use

API GatewayLambdaDynamoDBSQSSNSElastiCache

Challenge Details

Path
System Design Fundamentals
Difficulty
Beginner
Duration
60 min
Plan
Starter

Architecture Patterns You'll Learn

WebSocketfan-outheartbeatFIFO queuecomposite key design

Why This Challenge?

Unlike whiteboard exercises or multiple-choice quizzes, this challenge requires you to design a real architecture with actual AWS services, evaluate trade-offs, and defend your decisions. Our automated validators check your design against production-grade criteria. Complete it and it shows up in your verified portfolio with your architecture diagram and design rationale.

Ready to design this for real?

Get the full scenario, design your architecture using real AWS services, and validate against production-grade criteria. Your completed challenge shows up in your verified portfolio.

Start Challenge