A product recommendation system suggests items a shopper is likely to want, often before they search for anything. It learns from views, clicks, cart events, and purchases, combines them with product and context information, and ranks a small set of eligible products from a catalog that can contain millions of items.
Imagine opening an e-commerce app with fifty million products.
You haven't searched for anything yet. You haven't selected a category. But the homepage already knows what you're likely to be interested in.
If you've been looking at running shoes, it might recommend a pair from your favorite brand. If you've recently purchased a camera, it might suggest a compatible lens or memory card. And if you're a completely new customer, it should still recommend products that are relevant to you.
Behind these recommendations is a machine learning system that learns from millions of interactions, understands relationships between products, and predicts what each customer is most likely to buy.
But designing this system is much more complicated than simply predicting which products a user will click. We need to search through millions of products, understand changing user preferences, account for inventory and pricing, and return personalized results in milliseconds.
In this article, we'll design a production-scale Product Recommendation System, exactly as we would approach it in a Machine Learning System Design interview.