KatInterview

Build a Live-Now Highlights Feed for a Streaming Marketplace

System DesignModel answer
MediumModel answerSystem Designml-system-designrecommendationreal-time-features

Last updated

Design the ML system around an existing scoring model to rank currently active livestreams in a shopping app, covering signals, retrieval, rules, serving, and verifying a stream is still on air.

You are building the "Hot Right Now" row for a marketplace where sellers sell products over live video. The row should show each user the live shows most worth joining at this moment.

A relevance model already exists. You can call it as an internal service with a user, a stream, and request context, and it returns a score. You do not need to design or train it. Design everything around it.

Cover the following in your answer:

  • The product objective and how you would measure success, including guardrail metrics.
  • The events and features you would capture (stream-level, seller-level, user-level).
  • How you would produce the set of candidate streams for each request.
  • How you would merge hard rules, fast-moving live signals, and the model score into a final ordering.
  • The online and offline architecture, including how data flows between them.
  • Targets for latency, data freshness, and scale, with rough numbers.
  • How you keep out streams that are outdated, low quality, spammy, or already finished.
  • How you would run experiments, monitor the system, and degrade gracefully on failure.

Follow-up: How do you guarantee that a stream appearing in the feed is really still live when the user sees and taps it?

Hints

Hint 1

Start by estimating the size of the inventory. If only thousands of streams are live at once, retrieval is cheap and the real difficulty lies elsewhere. Think about what that implies for your design.

Hint 2

Do not optimize raw viewer counts alone. Think about feedback loops, fake traffic, and small sellers, and pick a primary metric tied to purchases plus guardrails for dead taps, reports, and exposure concentration.

Hint 3

For the follow-up, think in layers: an authoritative live-state store fed by heartbeats and explicit end events, a filter at serve time, a client-side check on tap, and a push or short polling mechanism to remove streams that end while the feed is on screen.