MLCrack

    ML SYSTEM DESIGN & MLOPS Β· INTERVIEW QUESTION

    Design a real-time ML serving system for a recommendation engine handling 10k QPS.

    🟑 intermediate · System Design Patterns

    Hint: Think about model serving, caching, feature stores, and latency requirements.

    Answer

    Architecture:

    1. Feature Store: pre-computed user features (offline), real-time event features (streaming).

    Use Redis for serving, Feast/Tecton for management.

    1. Model Serving: TensorFlow Serving or Triton for GPU inference, ONNX for portability. Batch pre-compute for popular items.

    2. Candidate Generation: retrieve ~1000 candidates via ANN (FAISS/ScaNN) from item embeddings.

    3. Ranking: score candidates with a neural ranker, ~100ms budget.

    4. Caching: cache results per user with TTL, cache popular recommendations.

    5. A/B Testing: traffic splitting at the API gateway.

    6. Monitoring: track latency p99, model staleness, prediction distribution drift. Scale horizontally with load balancers, use circuit breakers for graceful degradation.