All Questions
Llm Inference Serving medium

You are exposing a chat completion endpoint used by browsers and server-side SDKs, many of them behind corporate proxies. Each request sends one prompt and receives one stream of tokens, and your load balancers are stateless HTTP. A teammate proposes WebSockets 'for lower token latency.' What should you choose?

  1. A WebSockets, because their framing delivers each token measurably faster than an HTTP response stream can.
  2. B Long polling, because each poll returns a batch of tokens and avoids holding connections open on the server.
  3. C WebSockets, because SSE cannot resume a dropped stream and loses every token generated after a disconnect.
  4. D SSE over HTTP, since the stream is one-way and reuses standard HTTP infrastructure, auth, and load balancing.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions