KatInterview

Build a Reply-Probability Scorer: Feature Pipelines and Inference

Machine LearningModel answer
MediumModel answerMachine Learningml-system-designfeature-storemodel-serving

Last updated

Design an ML system that estimates whether a user will comment on a post in a community forum, emphasizing feature pipelines, training-serving consistency, and low-latency model deployment.

You are building the ML component of a large forum-style platform in which posts live inside communities. For a given (user, post) pair, the system must output the probability that the user will leave a comment on that post.

Walk through the full design: how you frame the problem, build training data, choose features and a model. Spend most of your time on two areas:

  1. Feature serving: how each input the model needs is computed, stored, and retrieved at request time.
  2. Model serving: how the model is deployed and scored while staying inside the latency budget of the calling request.

Before designing, state the assumptions you would confirm with the interviewer, for example:

  • Who consumes the score: a personalized home feed, a within-community ranking, or a notification selector? This determines candidate count and latency budget.
  • What exactly is a positive label: only top-level comments, or any reply in the thread? Within what window after the post was shown?
  • What is the latency budget for the ranking stage and how many candidates are scored per request?
  • What infrastructure already exists (event stream, feature store, serving platform)?

Your answer should address label definition, bias and imbalance, feature groups and freshness, offline/online consistency, serving architecture, safe rollout, fallbacks, and monitoring.

Hints

Hint 1

Start by pinning down the label: which event, which time window after an impression, and which impressions count as negatives. Everything downstream depends on this.

Hint 2

Group features by entity (user, post, community, user-community, context) and by how fresh they must be (batch, streaming, request-time). Each freshness tier suggests a different pipeline and storage choice.

Hint 3

For serving, think in terms of a latency budget: one batched feature fetch for all candidates, one batched model call, a timeout, and a fallback. Also ask how you will guarantee the model and its feature schema are deployed together.