Leetcode 886. Possible Bipartition
Given n people and pairwise dislikes, determine whether the corresponding undirected graph is bipartite — i.e., whether you can 2-color all vertices (split into two groups) so no dislike pair lies within the same group (n ≤ 2000, dislikes ≤ 10^4).
Asked at:
Uber
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid December, 2025
Uber
Mid-level
An uber user will not get matched with another driver, if she or he rates rates the driver on three stars or below. The block is symmetric relation. If Alice blocks Bob, then Bob won't be able to get matched with Alice, even if they switch roles. Instead of trying a match and giving it up later, when we find out that 1 user has given a poor rating to another one. Critically, we want to try and separate them in our user pools so that we'll never match them again, find an efficient algo to check whether such a division is possible. For example you are give lot of L pairs of Uber users, both users and drivers who don't like each other, your algorithm should check whether such a division is possible, and it should output a roaster for each person which division it will stay in.
Early April, 2025
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.