Recall & Review
beginner
What is a WebSocket?
A WebSocket is a communication protocol that provides full-duplex communication channels over a single TCP connection, allowing real-time data exchange between a client and a server.
Click to reveal answer
beginner
How does WebSocket differ from HTTP in communication?
Unlike HTTP which is request-response based, WebSocket allows continuous two-way communication without repeatedly opening new connections, making it efficient for real-time data transfer.
Click to reveal answer
intermediate
What is the role of the WebSocket handshake?
The WebSocket handshake upgrades an HTTP connection to a WebSocket connection by exchanging special headers, establishing a persistent, full-duplex communication channel.
Click to reveal answer
beginner
Name two common use cases for WebSocket in system design.
1. Real-time chat applications where messages are instantly delivered. 2. Live data feeds like stock prices or sports scores that update continuously.
Click to reveal answer
advanced
What are key considerations for scaling WebSocket servers?
Key considerations include managing many concurrent connections, load balancing with sticky sessions or shared state, and handling failover to maintain persistent connections.
Click to reveal answer
What type of communication does WebSocket provide?
✗ Incorrect
WebSocket supports full-duplex communication, meaning data can flow simultaneously in both directions.
Which protocol does WebSocket initially use to establish a connection?
✗ Incorrect
WebSocket starts with an HTTP handshake to upgrade the connection to WebSocket.
Why is WebSocket preferred over HTTP for real-time apps?
✗ Incorrect
WebSocket allows persistent two-way communication, unlike HTTP which is request-response based.
Which of these is NOT a typical WebSocket use case?
✗ Incorrect
File downloads typically use HTTP, not WebSocket.
What is a challenge when scaling WebSocket servers?
✗ Incorrect
WebSocket servers must manage many persistent connections, which is challenging for scaling.
Explain how WebSocket establishes and maintains a real-time connection between client and server.
Think about the initial HTTP step and what happens after.
You got /4 concepts.
Describe key design considerations when building a scalable WebSocket-based real-time system.
Focus on connection management and reliability.
You got /4 concepts.