Level: Senior-Level
Round: Online Assessment · Type: Coding · Difficulty: 6/10 · Duration: 60 min · Interviewer: Neutral
Topics: Algorithm Design
Location: New York, NY, US
Interview date: 2019-08-15
I had an online assessment for Squarespace which involved designing a conference room meeting scheduler.
The task was to design a conference room meeting scheduler. The function input consists of the start and end times of the meeting, represented as two long-type Unix timestamps. When someone schedules a meeting, this function is called. There are a total of 8 meeting rooms. Upon successful scheduling, the function should return the room ID (1~8) of the scheduled room. There are no room preferences; any available room is acceptable.
My approach involves creating 8 lists to store the scheduled meetings for each of the 8 meeting rooms. When someone wants to schedule a room, I iterate through each room's list and check for conflicts between the current booking range and previously booked meetings. If no meeting room is available during the specified time, the function returns -1.