FastPrepEmployee With the Most Overlaps
Problems/Employee With the Most Overlaps

Employee With the Most Overlaps

Citadel logoCitadel● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Citadel Securities online assessment, as the second of two coding problems in a 90-minute test. It uses the same start and end times as the first problem. For each employee you count how many others share some time with them, and return the largest count. The report says that one person leaving at a time and another arriving at that time count as overlapping.

The report gives no examples and no range for the times, and it does not say whether an employee counts themselves. Here only other employees count. The examples are ours.

Our version is about 90% the same as the reported question.

A company has n employees. Employee i starts work at time start[i] and finishes at time end[i]. The employee is working at every moment from start[i] to end[i], including both ends.

Two employees overlap when there is at least one moment when both are working. Because both ends count, an employee who finishes at time t overlaps an employee who starts at time t.

For each employee, count how many other employees overlap them. Return the largest of these counts.

Function

maxOverlapCount(start: int[], end: int[]) → int

Examples

Example 1

start = [1,2,5,8]end = [10,3,6,9]return = 3

Employee 0 works from 1 to 10, so it overlaps each of the other three employees. Each of the others overlaps only employee 0. The answer is 3, even though no more than two employees ever work at the same moment.

Example 2

start = [1,4,7]end = [4,7,10]return = 2

Employee 1 works from 4 to 7. It shares time 4 with employee 0 and time 7 with employee 2, and both ends count. Employees 0 and 2 each overlap only employee 1.

Example 3

start = [3]end = [8]return = 0

There are no other employees, so the count is 0.

Constraints

  • start.length == end.length == n
  • 1 <= n <= 2 * 105
  • 0 <= start[i] <= end[i] <= 109

More Citadel Online Assessment questions

  • Speed Up a Slow FunctionOA · PHONE SCREEN · Seen Nov 2026
  • Possible MEX Values After One Optional IncrementOA · Seen Oct 2026
  • Busy IntersectionOA · Seen Sep 2026
  • Shortest Path in an Unweighted GraphOA · Seen Sep 2026
  • Maximize Workday EarningsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Minimum Changes for Palindromic BlocksOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Minimum Image Processing CostOA · Seen Jul 2026
  • Coprime Pick with Change CostOA · Seen Jul 2026
  • Process SchedulingOA · Seen Mar 2026
  • Most Employees Working at OnceOA · Seen Feb 2026

Similar questions at other companies

  • Maximum Interactive Team SizeMicrosoft · OAMicrosoft interview questions
  • 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
  • Count Lamps Lighting Each PointAirbnb · OAAirbnb interview questions
  • Merge IntervalsApple · OA · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
  • 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

Citadel interview experiences

  • Citadel Securities Quant Researcher Intern Loop: 1 Experience
  • Citadel Securities Research Engineer Interview: 1 Experience
  • Citadel Securities SWE Intern First Round: 2 Experiences
  • Citadel Securities Experienced SWE Interviews: 1 Experience
  • Citadel SWE Intern Later Rounds and Superday: 13 Experiences
  • Citadel SWE Intern First-Round Questions: 20 Experiences
All Citadel interview questionsSee Citadel hiring insights
Saved
class Solution {
    public int maxOverlapCount(int[] start, int[] end) {
      // Write your code here.
    }
}
Checking account…