Syllabus
Live stock watchlist over SSE: three maps, connect/disconnect, fan-out, thread safety, and scale.
The interview
The prompt lands. Clarify scope and plan before you mention Kafka.
Design
The three maps that make fan-out and disconnect both O(subscribers).
Implement
Connect, watchlist edits, publish fan-out, and dead-emitter cleanup.
Concurrency
CHM, replace races, per-user locks, and slow consumers.
Scale
What breaks with multiple pods — and how you fix it.
Wrap-up
Decision matrix and interview answers out loud.