Snap (Phone Screen)

snap logo
snap
October 21, 20258 reads

Summary

I had a phone screen with Snap where I was presented with a problem focused on distributing people across meeting rooms to maximize the minimum distance between them.

Full Experience

I recently completed a phone screen with Snap. During the interview, I was given a problem that involved managing meeting rooms and distributing a specific number of people, 'k', among them. The core challenge was to arrange these people in such a way that the maximum possible distance between any two individuals was achieved. We discussed the problem thoroughly, including the provided example to clarify the constraints and expected output. My approach centered on understanding the 1-D array representation of the rooms and how to optimally place people to maximize the spacing.

Interview Questions (1)

Q1
Maximize Distance Between K People in Rooms
Data Structures & Algorithms

You are given meeting rooms of size rooms. You need to distribute k people in these rooms such that they have maximum distance between them. Return the maximum distance possible.
Input : rooms = [7,8,3] k=7
Output : 2
We can represent the placement as a 1-D array
[1,0,0,1,0,01], [1,0,0,1,0,0,0,1], [1,0,0]
The distance in the last room doesn't matter since there is only 1 person in that room.

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!