Design Typing Indicator

Medium45 min
1 / 30
understanding6 min read

Problem Statement & Context

How Problem Statement & Context shapes architecture and interviewer follow-ups for Design Typing Indicator.

Design Typing Indicator — product and realtime context

Design a real-time typing indicator for a messaging product (WhatsApp / Slack / Discord scale): when user A composes in conversation C, eligible participants see “A is typing…” within a tight latency budget, without durable storage or chat-history pollution.

Why interviewers ask this

  • Ephemeral fan-out — high churn, tiny payloads, loss-tolerant semantics unlike message delivery.
  • Privacy & product rules — blocked users, disabled receipts, invisible mode, enterprise policies.
  • Thundering herds — every keystroke is not a server write; debounce and coalesce are mandatory.

Scale anchors (stated assumptions)

SignalAssumption
DAU500M
Active conversations80M concurrent
Typing signals (debounced)~8 per active minute per typer
Peak typing events~2.2M events/s global (3× average)
Propagation SLAp99 < 300 ms same region

Architecture headline

Clients emit typing.start / typing.stop over an existing WebSocket session. A regional Typing Gateway validates membership, applies debounce + TTL, and fan-outs to online recipients via per-user delivery channels (Redis pub/sub → gateway push). No durable DB for typing state — Redis with 5–8 s TTL is enough.

javaOne Dark Pro
1public record TypingSignal(String conversationId, String userId, boolean isTyping, long epochMs) {}
pythonOne Dark Pro
1def typing_key(conversation_id: str, user_id: str) -> str:
2 return f"typing:{conversation_id}:{user_id}"
typescriptOne Dark Pro
1export interface TypingEvent {
2 conversationId: string;
3 userId: string;
4 isTyping: boolean;
5 serverTime: number;
6}

Why interviewers care

Typing Indicator interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement & Context that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Problem Statement & Context: key interview decision
  • Debounce client and server before fan-out
  • TTL clears ghost typing — no durable store
Interviewer signal
When discussing Problem Statement & Context, cite numeric assumptions and a failure mode.
Avoid
Do not jump to database schema before meeting media topology.

Section Rescue Kit

Buzzwords to use:

Ephemeral Fan-outDebounce Window

Safe statements:

  • "For Problem Statement & Context, I will quantify fan-out before choosing aggregation."
  • "I will shed typing before message delivery under overload."
Design Typing Indicator - System Design | WinJob | WinJob