Back to problems

Find top co-viewed products

Algorithm · Ebay · Medium

Given a list sessions of browsing sessions, where each session contains a list of product IDs, along with an integer targetProduct and an integer k, build a recommendation list of the top k products that were most frequently viewed together with targetProduct. A session contributes to the counts only when it contains targetProduct at least once. For each such session, ignore every occurrence of targetProduct and add one count for every occurrence of every other product in…

Checking your access…