Snap Technical Phone Screen Interview Experience and Problem
Question Details
Problem Statement You are given an array rooms where each element represents the capacity of a meeting room, and an integer k representing the number of people. The goal is to distribute all `
Full Details
Problem Statement You are given an array rooms where each element represents the capacity of a meeting room, and an integer k representing the number of people. The goal is to distribute all k people across these rooms in a way that maximizes the minimum distance between any two adjacent people within the same room.
Return the maximum possible distance.
Example *
Input: rooms = [7, 8, 3], k = 7 *
Output: 2
Solution Visualization The placement can be represented as 1-D arrays where 1 represents a person and 0 represents an empty seat. A valid distribution for the example above is: *
Room 1 (Size 7): [1, 0, 0, 1, 0, 0, 1] *
Room 2 (Size 8): [1, 0, 0, 1, 0, 0, 0, 1] *
Room 3 (Size 3): [1, 0, 0] For rooms allocated a single person (like Room 3), the distance constraint does not apply.
About This Question
This is a reported interview question from a snap interview for a swe role during the phone screen round reported in 2025.
It covers the following topics: Arrays, Probability Stats .