KatInterview

Predicting Rising Products and Serving Them in a Personalized Feed

Machine LearningModel answer
MediumModel answerMachine Learningml-system-designrecommendationtime-series-forecasting

Last updated

Design a daily forecasting pipeline that spots products about to surge in sales, plus a sub-100ms personalized homepage feed that surfaces them, including cold-start handling.

Spotting Tomorrow's Hot Products

An online marketplace wants a homepage module that highlights products just before they take off. The goal is to flag items whose sales will accelerate strongly over the coming week, then show them to the shoppers most likely to care.

What the system must do

  1. Forecast. Detect products with an upward trajectory before they reach peak volume. "Hot" means high sales velocity during the next 7 days.
  2. Recommend. Present the flagged products on the homepage, tailored to different user segments.
  3. Refresh cadence. The forecasting pipeline reruns once per day. The serving path must respond in under 100 ms.

Scale and constraints

  • About 1 million feed requests per day.
  • About 500,000 active SKUs in the catalog.
  • Results must reflect each user's past behavior and category preferences.

What to cover in your answer

  • A high-level architecture spanning data ingestion, model training, and online serving.
  • A data model for item features and user-item interactions.
  • How you would handle brand-new products that have no sales history.
  • The trade-offs between precomputing scores in batch and scoring in real time.

State your assumptions (label definition, user counts, peak traffic) and explain why you made each design choice.

Hints

Hint 1

Separate the problem into two parts: a batch forecaster that scores every SKU once a day, and a lightweight online ranker that personalizes a small pool of trending items per request.

Hint 2

Raw sales volume only finds items that are already popular. Think about features that capture momentum, such as windowed counts, day-over-day change, acceleration, and category-relative comparisons.

Hint 3

For new items, combine content-based priors (text, image, brand, price), shrinkage toward category averages, and a small exploration budget in the feed so the system can learn quickly.