Back to problems

Bucket Users by Movie Completion Percentage from an Event Stream

Algorithm · Netflix · Medium

You are given a stream of events from a video streaming service. Each event records that a particular user watched a certain movie, along with the completion percentage (an integer from 0 to 100). Your task is to group users by movie and then assign each user to one of four completion buckets. The buckets are defined by three integer thresholds t1, t2, t3, where $$0 \le t1 < t2 < t3 \le 100$$. The four buckets are: bucket0: users whose final completion percentage is strictly…

Checking your access…