Snap (Phone Screen)
- Posted
- 21 Oct 2025
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.
How it went
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.
Questions asked (1)
- 01
Maximize Distance Between K People in Rooms
Data Structures & Algorithms
You are given meeting rooms of size
rooms. You need to distributekpeople 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.