FastPrepMaximum Interactive Team Size
Problems/Maximum Interactive Team Size

Maximum Interactive Team Size

Microsoft logoMicrosoft● MediumINTERNNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: An earlier report and this one describe the same Microsoft online assessment question. Given each employee's working hours as a start and an end time, find the biggest group in which one member's hours overlap the hours of every other member. The new report settles that touching at a single moment counts as overlapping. It gives the limits (up to 2 * 10^5 employees, times from 1 to 10^9), and adds two sample cases, which appear here as examples 4 and 5.

We chose to allow times of 0 as well, which is slightly wider than the reported lower limit of 1. This changes no answer.

Our version is about 99% the same as the reported questions.

Special thanks: 🌷 A special thank you to a lovely, amazing fren who shared that this question appeared again on October 19, 2026! ( ˘͈ ᵕ ˘͈♡) 💜

You are given n employees. Employee i works during the closed interval [startTime[i], endTime[i]].

Two employees can interact when their working intervals overlap. A team is valid when at least one employee in that team can interact with every other team member. The other team members do not need to interact with one another.

Return the maximum possible size of a valid team. An employee is included in their own team, so the answer is at least 1.

Function

getMaximumTeamSize(startTime: int[], endTime: int[]) → int

Examples

Example 1

startTime = [1,6,4,3,1]endTime = [2,7,5,8,2]return = 3

Employees 1, 2, and 3 form a valid team because employee 3, working from 3 through 8, overlaps both other intervals. No employee overlaps enough intervals to form a team of four.

Example 2

startTime = [1,2,3]endTime = [5,4,3]return = 3

All three intervals contain time 3, so any employee can serve as the member who interacts with everyone.

Example 3

startTime = [1,4,7]endTime = [2,5,8]return = 1

No two employees overlap, so every valid team contains only its central employee.

Example 4

startTime = [2,5,6,8]endTime = [5,6,10,9]return = 3

Employee 1 works from 5 to 6. It shares time 5 with employee 0 and time 6 with employee 2, so employees 0, 1, and 2 form a valid team. No employee overlaps all three of the others, so the answer is 3.

Example 5

startTime = [1,2,8,8,10]endTime = [4,8,12,9,11]return = 4

Employee 1 works from 2 to 8 and overlaps employees 0, 2, and 3; it meets the last two only at time 8. That makes a valid team of four. No employee overlaps all four of the others, so five is not possible.

Constraints

  • 1 <= startTime.length == endTime.length <= 200000.
  • 0 <= startTime[i] <= endTime[i] <= 10^9.
  • Intervals that share an endpoint overlap.

More Microsoft Online Assessment questions

  • Authentication SystemOA · Seen Nov 2026
  • Maximum String OperationsOA · Seen Nov 2026
  • Minimum Cost to Process Priority TasksOA · Seen Nov 2026
  • Most Visited Sprint MarkerOA · Seen Nov 2026
  • Maximum Escape Game ScoreOA · Seen Nov 2026
  • Count Subarrays with a Perfect-Square ProductOA · Seen Nov 2026
  • Maximize Pipeline Throughput Under a Scaling BudgetOA · Seen Nov 2026
  • Minimum Cost K-Capable ModelsOA · Seen Nov 2026
  • Find Available Meeting RoomsOA · Seen Oct 2026
  • Maximum Sum of a K-StarOA · Seen Oct 2026

Similar questions at other companies

  • Maximum Team SizeExpedia · OAExpedia interview questions
  • Batch Point-in-Range QueriesGoogle · PHONE SCREENGoogle interview questions
  • Classify Heap Addresses from a Memory SnapshotSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Maximum Profit in Job SchedulingAmazon · PHONE SCREEN
  • Earliest Meeting Time for All EmployeesCapital One · OACapital One interview questions
  • Largest Team Where Every Pair OverlapsWalmart · OAWalmart interview questions
  • Minimum Meeting RoomsJP Morgan Chase · OAJP Morgan Chase interview questions
  • Maximum Compatible Time WindowsIBM · OAIBM interview questions
  • Merge Overlapping IntervalsGoldman Sachs · OAGoldman Sachs interview questions
  • Linear InterpolatorTwo Sigma · OATwo Sigma interview questions

Interview reports that mention this question

  • Microsoft OA Questions, October 2026: 4 Experiences

Microsoft interview experiences

  • Microsoft Experienced SWE Phone Screen: 1 Experience
  • Microsoft Explore and Student SWE: 12 Experiences (Part 6 of 6)
  • Microsoft SWE Intern, Early 2025: 41 Experiences (Part 5 of 6)
  • Microsoft SWE Intern, Mid 2025: 42 Experiences (Part 4 of 6)
  • Microsoft SWE Intern, Late 2025: 47 Experiences (Part 3 of 6)
All Microsoft interview questionsSee Microsoft hiring insights
Saved
class Solution {
    public int getMaximumTeamSize(int[] startTime, int[] endTime) {
        // Write your code here.
    }
}
Checking account…