Recall & Review
beginner
What is a WebSocket in the context of web communication?
A WebSocket is a communication protocol that creates a persistent, two-way connection between a client and a server, allowing them to send messages instantly without repeatedly asking for updates.
Click to reveal answer
beginner
How do WebSockets differ from traditional HTTP requests?
Unlike HTTP requests that open and close connections for each message, WebSockets keep the connection open, enabling continuous, instant data exchange without the overhead of reconnecting.
Click to reveal answer
intermediate
Why are WebSockets important for real-time features in NestJS applications?
WebSockets allow NestJS apps to push updates immediately to clients, like chat messages or live notifications, making the app feel fast and interactive without delays.
Click to reveal answer
intermediate
What role does the NestJS WebSocket Gateway play?
The WebSocket Gateway in NestJS acts like a bridge that listens for WebSocket connections and manages sending and receiving messages between the server and clients in real time.
Click to reveal answer
beginner
How does keeping a WebSocket connection open improve user experience?
It lets users see updates instantly, like new chat messages or live scores, without refreshing the page or waiting, making apps feel smooth and responsive.
Click to reveal answer
What is the main advantage of WebSockets over HTTP for real-time apps?
✗ Incorrect
WebSockets keep the connection open, allowing instant two-way communication, unlike HTTP which opens and closes connections for each request.
In NestJS, what component handles WebSocket connections?
✗ Incorrect
The WebSocket Gateway in NestJS manages WebSocket connections and message handling.
Which of these is a real-time feature enabled by WebSockets?
✗ Incorrect
Live chat messaging requires instant updates, which WebSockets provide.
Why does a persistent WebSocket connection reduce delay?
✗ Incorrect
Keeping the connection open avoids the delay caused by opening a new connection for every message.
Which protocol do WebSockets start with before upgrading the connection?
✗ Incorrect
WebSockets start as an HTTP connection and then upgrade to a WebSocket protocol for persistent communication.
Explain in simple terms how WebSockets enable real-time features in a NestJS app.
Think about how a chat app updates messages without refreshing.
You got /4 concepts.
Describe the difference between WebSocket communication and traditional HTTP requests.
Imagine calling a friend every time you want to say something versus having a phone call open.
You got /4 concepts.