Uber SDE 2 Interview Round 1 (Elimination)
Summary
During the Uber SDE 2 interview round, I encountered a challenging problem related to grouping people for trips with specific constraints. The problem required finding the maximum number of people who could go on a trip based on their group size requirements. Despite not being able to think of an approach, the problem provided valuable insight into handling complex grouping constraints.
Full Experience
Uber SDE 2 Interview Round 1 (Elimination)
There are n people. Each can create a group and add people to it, but they need to form a group with a minimum of L and maximum of M people, excluding themselves. The goal is to find the maximum number of people who can go on a trip. For example, if L is [1,1,1] and M is [1,1,1], with three people (A, B, C), A can create a group with B, allowing both to go on a trip. However, C is left alone and cannot form a group since he needs at least one person to join him.
I struggled to think of an approach for this problem, which highlighted the need for a more systematic strategy to tackle such grouping constraints.
Interview Questions (1)
There are n people. Each person can create a group and add people to it, but they need to form a group with a minimum of L and maximum of M people, excluding themselves. The goal is to find the maximum number of people who can go on a trip.
For example, if L is [1,1,1] and M is [1,1,1], with three people (A, B, C), A can create a group with B, allowing both to go on a trip. However, C is left alone and cannot form a group since he needs at least one person to join him.