All problems

Recommendation Engine

Homepage recommendations, precomputed offline and served hot.

hard~24 min Pro Simulator · +140 ptsTheory +44 pts
The build

Serve homepage recommendations hot through a launch-day surge while the precomputed store blips and a server dies.

Recommendations are computed offline and served hot — the homepage never scores anything live. A stream absorbs the activity firehose that feeds the offline recompute, while a cache in front of the precomputed store is the only reason a store outage doesn't blank every homepage at once.

Components in play

  • Edge LBSpreads homepage traffic across the Recs API fleet.
  • Recs APILooks up a user's precomputed recs — never scores live.
  • Recs cacheServes hot recs from memory so the store stays nearly idle.
  • Precomputed recs storeHolds each user's latest offline-computed recommendation set.
  • Activity streamBuffers the click/view firehose that feeds the offline recompute.
  • Recs builderDrains the stream and recomputes recommendations into the store.

Graded on these SLOs

  • ≥ 96.00%Recs served
  • ≤ 110 msHomepage p99
  • ≥ 16k rpsSustain the launch
  • ≤ 90%Fleet headroom
  • ≤ 12Lean footprint
Base 16,000 rps46s run 4 scripted failures

The brief

Design the homepage recommendation system behind a service like Netflix or Amazon: 'recommended for you' rows that load instantly on every visit. Scoring who might like what is too expensive to run per-request, so the real system is two pipelines — an offline job that recomputes recommendations from user activity, and a serving path that only ever does a fast lookup of what that job already wrote.

Functional

  • Serve a personalized recommendation set on every homepage load
  • Ingest user activity (views, clicks, purchases) to inform future recs
  • Periodically recompute recommendations per user from that activity

Non-functional

  • Serving reads must be low-latency — recs render on every homepage hit
  • The read path never scores live — it only looks up precomputed results
  • The offline recompute pipeline must not fall behind or block serving

Warm-up: design decisions

Optional theory to prime the calls a senior engineer would make before you build.

Pro

Solving is a Pro feature

Unlock the on-canvas AI design coach, per-run design reviews, the chaos simulator and all 12 problems for $15/month.

  • AI design coach on your canvas — pins failure points & over-engineering
  • Honest AI design review on every run
  • All 12 problems + unlimited chaos simulator
  • Points, levels & leaderboard
Get started