Build a small server that streams words back like LLM tokens
MediumSystem design45 minSWEMLEPro outline
The question
As a take-home, build a small HTTP service. A client sends some text; the server streams it back one word at a time with a short delay between words, the way a chat model streams tokens.
Explain the protocol you chose, how you handle slow or disconnected clients, many clients at once, and how you tested it.
What the interviewer is looking for
- Picks a streaming protocol and explains why (server-sent events, chunked HTTP or WebSockets)
- Uses async I/O or a clear concurrency model so one slow client does not block others
- Handles client disconnect, cancellation and backpressure
- Writes real tests, including a streaming client test
- Keeps the code small, readable and runnable with one command
Your answer
Saved in this browser only. Nobody else sees it.
Why this question
Written by BlogLLM in the style of a publicly reported Cohere question type: Server that streams words back the way LLM tokens stream.
Reported in: cohere.com, curebugs.com
Practice question written by BlogLLM based on publicly reported interview formats. Not an official Cohere question.