Free beta: free to use with daily limits while we build. Join the waitlist for founding-member pricing at launch. Join the waitlist

Sign up free

Bloomberg interview question

Recommend films from users whose watch history contains everything a new user watched

Company:
Bloomberg
Type:
Coding
Difficulty:
Medium
Reported:
November 18, 2026

Problem

You are given the watch history of existing users as a map from user to the list of films they watched, and the list of films a new person has watched. Recommend films to the new person using this rule:

  1. Look through every other user's watch history. If the new person's films are a subset of that user's films, keep that user; otherwise skip them.
  2. Across all kept users, collect the films the new person has not watched.
  3. Return those films sorted by the number of kept users who watched them, in descending order.

The order of films with equal counts is not specified; ask the interviewer.

Example 1

Input: history = {1: ["a", "b", "c", "d", "e"], 2: ["a", "c", "d"], 3: ["b", "e"]}, new = ["a", "c"]
Output: ["d", "b", "e"]

Users 1 and 2 are kept (user 3 did not watch a and c). d was watched by 2 kept users, b and e by 1 each; because b and e tie, their relative order depends on the tie rule you agree on.

Constraints

  • Not stated; ask the interviewer.

Reported by candidates or drawn from publicly available sources, and rewritten in our own words. Pathwise Prep does not publish confidential assessment content. Report a concern