Uber SDE 2 Interview Round 1 (Elimination)

uber logo
uber
SDE 2Ongoing
December 18, 202536 reads

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)

Q1
Maximize Trip Participation with Group Constraints
Data Structures & Algorithms

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.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!