Netflix·Software Engineer·Technical Phone Screen
- Given a map of user IDs to their movie-watching histories (ordered lists of movie IDs), group users who share the exact same set of last K movies watched. Only return groups with at least two users. Describe your algorithm and its time and space complexity.
“The core idea isn't that hard once you see it: take the last K movies for each user, throw them into a set, sort the set to get a canonical key, then use a hashmap to bucket users by that key.”