Bird
Raised Fist0
HLDsystem_design~20 mins

Real-time features in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Real-time Features Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Architecture
intermediate
2:00remaining
Designing a scalable chat system with real-time messaging

You are tasked with designing a chat system that supports real-time messaging between millions of users. Which architectural component is essential to ensure messages are delivered instantly and reliably?

AA batch processing system to send messages every few minutes
BA relational database to store all messages synchronously
CA message broker or pub/sub system to handle message distribution
DA static file server to serve chat logs
Attempts:
2 left
💡 Hint

Think about how messages can be pushed to many users instantly without delay.

scaling
intermediate
2:00remaining
Scaling WebSocket connections for real-time updates

Your application uses WebSocket connections to push real-time updates to users. As user count grows to millions, what is the best approach to scale WebSocket servers?

ADistribute connections across multiple servers with a load balancer and share state via a centralized message broker
BUse a single powerful server to handle all WebSocket connections
CSwitch to HTTP polling to reduce server load
DStore all WebSocket messages in a database before sending
Attempts:
2 left
💡 Hint

Consider how to handle many simultaneous connections and keep clients updated consistently.

tradeoff
advanced
2:00remaining
Choosing between WebSocket and Server-Sent Events (SSE)

You need to implement a real-time notification system for a web app. Which tradeoff is true when choosing WebSocket over SSE?

ASSE supports binary data natively, WebSocket only supports text
BWebSocket supports full-duplex communication, allowing client and server to send messages independently, while SSE is unidirectional from server to client
CWebSocket connections are stateless, SSE connections maintain state
DSSE requires a separate protocol, WebSocket uses standard HTTP
Attempts:
2 left
💡 Hint

Think about the direction and type of communication each protocol supports.

🧠 Conceptual
advanced
2:00remaining
Ensuring message ordering in a distributed real-time system

In a distributed real-time messaging system, what is the best approach to guarantee that messages are delivered to clients in the exact order they were sent?

AUse multiple message brokers without synchronization
BSend messages in parallel from different servers to reduce latency
CAllow each server to send messages independently without coordination
DUse a centralized message queue that preserves message order and assign sequence numbers to messages
Attempts:
2 left
💡 Hint

Think about how to keep track of message sequence across distributed components.

estimation
expert
2:00remaining
Estimating server capacity for a real-time stock ticker system

You are designing a real-time stock ticker system that pushes price updates to 5 million users. Each user receives 10 updates per second. Each update message is approximately 500 bytes. Estimate the total outgoing bandwidth required per second.

AApproximately 25 gigabytes per second
BApproximately 2.5 gigabytes per second
CApproximately 250 megabytes per second
DApproximately 50 gigabytes per second
Attempts:
2 left
💡 Hint

Calculate total messages per second and multiply by message size, then convert bytes to gigabytes.