Amazon Interview Question
Software Development ManagersCountry: United States
Interview Type: In-Person
There can be lot of way we can recommend a Product to a particular user if we had to categorize it can be like
1. Depending upon what he is searching on
2. Relating that searched Item to what he Purchased in the history
3. Respecting User preference on Public Review of the Product
4. Products that People who bought the same product along with the product searched by the current User.
5. Best Brand Products that matches the searched product.
6. Sort according to the best discount on the product searched
7. Product which offers Free Shipping
ect
Coming to the Design
The search itself can arrange the matched items in a tree\Graph structure and as the user traversing down a path Add new product which patch the Criteria and have some kind of a circular loop if the user is exploring more and more since the system should never be able to say that it can no longer search your product.
This is a typical machine learning problem statement. What can be done here is to create a matrix of all products that people bought and levering purchasing history (products they bought together with the first product). The first thing that needs to be done is to create a collaborative filter and finally do a featurized matrix factorization. The parameters of matrix factorization is a set of features for every user (gender, age, location and etc.). Through this you can predict the recommended product for the user and present it to the user. From an implementation point of view, I would believe that if the system has enough capacity, one could create a relational database of all the purchases and create the matrix factorization. Part of this database could be used as training data for the prediction model. As this system doesn't need to be a real time system, not much of requirement for the hardware and architecture is needed.
This is a typical machine learning problem statement. What can be done here is to create a matrix of all products that people bought and levering purchasing history (products they bought together with the first product). The first thing that needs to be done is to create a collaborative filter and finally do a featurized matrix factorization. The parameters of matrix factorization is a set of features for every user (gender, age, location and etc.). Through this you can predict the recommended product for the user and present it to the user. From an implementation point of view, I would believe that if the system has enough capacity, one could create a relational database of all the purchases and create the matrix factorization. Part of this database could be used as training data for the prediction model. As this system doesn't need to be a real time system, not much of requirement for the hardware and architecture is needed.
1) For each user, keep all the products purchased or saved.
2) For each product in the above list, develop association of all the products which were saved, purchased or looked at by other customers. For this, we keep a histogram (or priority list in the DB), which is product id: list of related product sorted by the assiciation level. Imagine, a customer purchase item X, and he has already purchased Item A and B. Add this association in the association DB. The association can be directional. A-->X(25) and B-->X(1), G-->X(4). Here the association of A to X is strongest.
So for a customer with purchase history, find all the associated products and gather the top x number by the association level. and present these to him.
In short for every product X, keep the list of associated product (by rank). The association can be stored in a nosql DB as product id and weight average. This table is updated during every product purchase by anyone. and is referred during recommendation time.
What is the carousal system on Amazon? You mean the marquee in a div that says you may like these other products??
- confused_coder August 21, 2016For each user, have a list of recently bought products
For each product store a list of products bought along with it (use a heap if you want for this)
Combine these two lists together, plus a few more products based on the category of the item and items recently looked at by the user etc