Find Time Ranges When At Least K Venues Were Halted

Last updated: November 29, 2026

Quick Overview

Each venue reports a list of half-open halt intervals [start, end) in seconds. Return the merged, sorted list of intervals during which at least k venues were halted at the same time.

Point72
Coding & Algorithms
Software Engineer
Point72
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Each venue reports a list of half-open halt intervals [start, end) in seconds. Return the merged, sorted list of intervals during which at least k venues were halted at the same time.

Execution systems at a multi-strategy fund like Point72 route across many exchanges, and a coordinated halt across several venues is a signal to pause algorithms. The interviewer is checking sweep-line fluency: turning intervals into events, ordering ties correctly, and emitting merged output.

What the Interviewer Expects
  • Convert intervals into +1 and -1 events and sort them
  • Process end events before start events at the same timestamp because intervals are half-open
  • Track when the running count crosses k upward and downward
  • Merge adjacent output ranges so results are maximal
  • Explain O(N log N) for N total intervals
Key Topics to Cover
sweep line
event sorting
intervals
half-open ranges
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you return which venues were halted during each output range?
  • Halts arrive in real time: how would you raise an alert the moment the count reaches k?
  • Intervals overlap within the same venue because of duplicate feeds: how does that affect the count and how do you fix it?
  • How would you compute the total halted time weighted by venue market share?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Every venue gives half-open halt intervals. Output the maximal ranges where the number of simultaneously halted venues is at least k, sorted by start. Clarify that a venue's own intervals do not overl...

High-Level Design

Sweep line. Each interval becomes a +1 event at its start and a -1 event at its end. Sort events by time, with -1 before +1 at equal times, because [0,5) and [5,9) do not overlap. Keep a running count...


Submit Your Answer
Markdown supported