Design a Six-Month Like Signal for Feed Scoring
Add a point-in-time post-like-history feature to an existing feed scorer and explain offline versus online results.
Problem statement
For this exercise, assume a feed service already retrieves eligible posts and an existing model predicts the probability that a viewer will like a candidate post if it is shown.
Add one new feature, post_like_count_6m: the number of distinct consenting accounts with a known like event for the candidate post in the trailing six UTC calendar months ending at a versioned feature snapshot as-of time.
That as-of time is at or before scoring, the response reports its coverage and freshness, and expired likes leave the window even when no new event arrives. The current impression and later interactions do not enter the value actually served.
This post-level count is a practice interpretation of an ambiguously described six-month like feature, not a source-specified definition.
The existing scorer must use the feature consistently in historical training and online inference, return a probability or an explicit unavailable outcome, and keep the feed service in control of eligibility and final ranking. For this exercise, an eligible viewer has not already liked that post when it is scored.
One like is attributed to the most recent eligible actual impression of that viewer-post pair in the preceding 24 hours; an eligible impression without an attributed like becomes a negative after its own 24-hour window and a declared late-event cutoff close.
A like with no matching impression creates no training label, and unshown candidates have no observed like labels. Design the feature lifecycle, model comparison, release and online evaluation.
If offline prediction metrics improve but online product metrics do not, explain how to diagnose that gap and decide whether to keep, revise or roll back the feature. Feed fanout, candidate generation, ad selection, moderation and building a new recommendation product are outside scope.
What to build
- The system constructs a versioned six-UTC-calendar-month distinct-liker count as of a reported snapshot/coverage time for each eligible post from known consented, deduplicated, event-time interactions and expires old likes as the window advances.
- A candidate model trains from the feature snapshot actually available at each historical score and mature actual-impression labels with one like attributed at most once, then scores bounded candidate batches using a compatible online feature definition.
- Operators compare the existing and candidate scorer offline, shadow online serving, and run a stable viewer-level experiment before promotion or rollback.
- Operators can trace offline-to-online quality differences through feature freshness, missingness, exposure, position, model and experiment versions, product guardrails and feedback effects.
At scalePractice assumption
- The existing scorer handles 100 requests per second at peak, each with up to 50 candidate posts; the added feature has a 20 millisecond p95 budget per batch, not per post.
- Accepted like events should affect the online feature within five minutes; the scored snapshot reports as-of and coverage time, and stale snapshots trigger fallback. Corrections, consent changes and deletions may invalidate a previously materialized value.
- A true count of zero and a missing or stale feature are distinct outcomes; the existing scorer remains a compatible fallback when this feature cannot be read safely.
- Compare online treatment against a stable baseline using predeclared uniquely attributed likes per mature eligible impression and guardrails for negative feedback, new-post exposure, session quality and scorer latency.