I recently received an Online Assessment for Microsoft's Core AI New Grad Software Engineer position. One of the coding questions involved finding the largest possible team of employees based on overlapping work schedules. The interesting part was that not every pair of employees needed overlapping schedules—only one team member had to overlap with everyone else.
Interview Details
Online Assessment — Maximum Valid Team Size
You are given n employees, each with a working interval defined by a start time and an end time. Two employees can interact if their working intervals overlap. Intervals are inclusive, meaning two employees whose schedules share an endpoint are considered to have overlapping working hours. A team is considered valid if at least one member of the team has a working interval that overlaps with every other member's interval.
Other team members do not need to overlap with one another. Your task is to determine the maximum possible size of a valid team.
Function Signature
def getMaximumTeamSize(startTime, endTime):
pass
# startTime: An integer array containing the starting time of each employee's shift.
# endTime: An integer array containing the ending time of each employee's shift.
#
def getMaximumTeamSize(startTime, endTime):
pass
# startTime: An integer array containing the starting time of each employee's shift.
# endTime: An integer array containing the ending time of each employee's shift.
#
Unlock Full Details
Create a free account to unlock this interview experience report.