Code Room
System designHardsd-g347
Subject RecommendationLevel Senior–Staff~45 minCommon in ML systems · Distributed systems interviewsIndustries Technology

Question

Design real-time *sequential* recommendations where the next-item suggestion depends on the order and timing of what the user did in the last few minutes (watched A then B then skipped C → predict D), not just a static long-term profile. You must update the recommendation within ~1-2s of each user action for 50M concurrent sessions, feeding a sequence model that consumes the recent action sequence. How do you capture, store, and serve the live action sequence into the model without a slow per-request database read of the user's whole history?

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.