Recommendation Engine
Homepage recommendations, precomputed offline and served hot.
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 LB — Spreads homepage traffic across the Recs API fleet.
- Recs API — Looks up a user's precomputed recs — never scores live.
- Recs cache — Serves hot recs from memory so the store stays nearly idle.
- Precomputed recs store — Holds each user's latest offline-computed recommendation set.
- Activity stream — Buffers the click/view firehose that feeds the offline recompute.
- Recs builder — Drains 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
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.
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