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.

  1. 1The Interview Prompt
  2. 2Clarify Requirements
  3. 3How to Approach

Design

The three maps that make fan-out and disconnect both O(subscribers).

  1. 4The Three Maps

Implement

Connect, watchlist edits, publish fan-out, and dead-emitter cleanup.

  1. 5Connection & Registry
  2. 6Add & Remove Symbols
  3. 7Page Switch
  4. 8Publishing & Fan-Out
  5. 9Dead Emitter Cleanup

Concurrency

CHM, replace races, per-user locks, and slow consumers.

  1. 10Thread Safety
  2. 11Slow Consumers

Scale

What breaks with multiple pods — and how you fix it.

  1. 12Beyond One JVM

Wrap-up

Decision matrix and interview answers out loud.

  1. 13Decision Matrix
  2. 14Interview Questions