Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Decompose ML Recommendations Monolith

MediumSystem Design00:00
Practice interviewer
In session
5 left
00:00

Your question is Decompose ML Recommendations Monolith. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Product Context

ShopStream is a large ecommerce app whose home feed and product detail recommendations are currently served by a single monolithic service. The company wants to decompose it into microservices while preserving recommendation quality, latency, and operational reliability.

Scale

SignalValue
DAU35M
Peak recommendation QPS180K
Product catalog120M active SKUs
New/updated items per day4M
Avg candidates scored per request2K
End-to-end p99 latency budget180ms

Task

Design the target ML system and service boundaries for a personalized recommendation stack after decomposing the monolith. Your design should address both system architecture and ML lifecycle concerns.

  1. Define the microservices you would create and the APIs or communication patterns between them.
  2. Propose an end-to-end recommendation architecture, including candidate generation, ranking, and re-ranking.
  3. Explain what should run online vs batch, and how features, models, and indexes are produced and served.
  4. Describe how you would evaluate the system offline and online during migration from the monolith.
  5. Identify key failure modes introduced by service decomposition, including feature drift and training-serving skew, and how you would monitor and mitigate them.
  6. Discuss migration strategy, fallbacks, and how to keep the system available if one downstream service is slow or unavailable.

Constraints

  • 25% of traffic comes from anonymous or low-history users.
  • Product freshness matters: inventory, price, and promotions change within minutes.
  • The business requires graceful degradation: if personalization fails, the app must still return recommendations.
  • Infra cost cannot increase by more than 30% versus the monolith during the first migration phase.
  • User-level training data must remain in-region for compliance, so some features/models may be region-specific.