🔥 0
0
Lesson 5 of 5 15 min +150 XP

🧠 WebSocket Assessment

Answer all questions to complete the quiz and earn 150 XP.

1

You're building a stock trading dashboard that shows live prices. Updates come every 100ms. Which technology is most appropriate?

2

A WebSocket connection closes with code 1006. What happened?

3

Your chat app works on one server but messages don't appear across multiple servers. What's missing?

4

What's the purpose of 'sticky sessions' in WebSocket scaling?

5

A client connects to your WebSocket server. Which event fires first?

6

How does WebSocket reduce overhead compared to HTTP polling?

7

Your WebSocket server needs to detect crashed clients. What should you implement?

8

What's the correct way to send JSON over WebSocket?

9

You need to broadcast to all users in a 'sports' room but not other rooms. In your server code with rooms stored as Map<room, Set<ws>>, how do you do this?

10

When scaling WebSockets with Redis pub/sub, why do you need TWO Redis connections?

11

Your WebSocket app uses token authentication passed in the URL: ws://example.com?token=abc. What's a security concern?

12

What does HTTP status 101 mean in WebSocket context?

13

Your real-time game needs updates every 16ms (60 FPS). What's a potential problem with WebSocket for this use case?

14

Implementing reconnection, what's the best strategy when connection fails repeatedly?

15

Your WebSocket server handles 50,000 concurrent connections. Users report occasional message delays of 5+ seconds. What should you investigate first?