FastPrepStreaming Interval Peak Concurrency
Problems/Streaming Interval Peak Concurrency

Streaming Interval Peak Concurrency

Uber logoUber● HardFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The original report leaves out how endpoints work and a finite interface you can run. Our version is about 95% the same as the reported question.

Meeting intervals arrive one at a time in the given order. After every insertion, return the highest concurrency observed anywhere in the timeline so far.

  • Intervals are half-open: [start, end).
  • An interval ending at time t does not overlap one starting at t.
  • The intervals are not sorted in advance.

Return one integer per arrival.

Function

peakConcurrencyAfterEachInsert(intervals: int[][]) → int[]

Examples

Example 1

intervals = [[1,5],[2,4],[5,7],[3,6]]return = [1,2,2,3]

The fourth insertion makes three intervals overlap during [3,4). The endpoint at 5 is handled as an end before a start.

Example 2

intervals = [[10,20],[0,10],[20,30]]return = [1,1,1]

The three intervals only touch at endpoints, so the peak remains one.

Constraints

  • intervals is non-empty.
  • Every row is [start, end] with start < end.
  • Coordinates are signed integers.

More Uber Onsite Interview questions

  • Earliest Time All Users Are ConnectedPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Online Meeting Scheduler with Fixed RoomsONSITE INTERVIEW · Seen Oct 2026
  • Minimum Meeting Rooms with AssignmentsPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Serialize and Deserialize an N-Ary TreeONSITE INTERVIEW · Seen Oct 2026
  • Longest Continuous Subarray Within an Absolute-Difference LimitONSITE INTERVIEW · Seen Oct 2026
  • K Smallest Squares from a Sorted ArrayONSITE INTERVIEW · Seen Sep 2026
  • Grid Robot Route with Charging PrioritiesPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Shortest Increasing Path to a TargetONSITE INTERVIEW · Seen Sep 2026
  • My Calendar IONSITE INTERVIEW · Seen Sep 2026
  • Per-Element Hit CounterONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Range ModuleWalmart · PHONE SCREENWalmart interview questions
  • Worker Management with Promotions and Double-Paid TimeInstacart · ONSITE INTERVIEWInstacart interview questions
  • Intervals with Exactly One Person OnlineGoogle · ONSITE INTERVIEWGoogle interview questions
  • Babysitter Quote with Hourly RatesUpstart · ONSITE INTERVIEWUpstart interview questions
  • Delivery Cost TrackerRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • First-Fit Arena AllocatorAMD · PHONE SCREEN · ONSITE INTERVIEWAMD interview questions
  • Cipher Cover Interval EditingDatabricks · ONSITE INTERVIEWDatabricks interview questions
  • Calendar Event System with Pagination and IntersectionLead Bank · ONSITE INTERVIEWLead Bank interview questions
  • Perfect AND Tree Leaf UpdatesPure Storage · ONSITE INTERVIEWPure Storage interview questions
  • Deployment Window SchedulerStripe · OAStripe interview questions
All Uber interview questionsSee Uber hiring insights
Saved
class Solution {
    public int[] peakConcurrencyAfterEachInsert(int[][] intervals) {
        // TODO: return the all-time peak after every half-open interval insertion.
    }
}
Checking account…