Skip to content
Tech Interview Prep home
Technical interview guide

Intervals

Ranges with a start and end — sorting by start (or end) turns overlap and merge problems into a single linear pass.

Read
42 min
Practice MCQs
25
Interview QA
25
Edition
v7
Editorial status
Reviewed

Scope: Language-neutral, with sorting and heap behaviour cited from CPython 3.14.

Interview QA

Treat each question like a live interview question: answer out loud first (structure, assumptions, tradeoffs), then open the model answer to spot gaps and rehearse a tighter follow-up.

Curated: · Written: · Reviewed:

QA-1

Explain half-open interval conventions and how it changes a production decision.

QA-2

How would you reason about the overlap test in a system you own?

QA-3

Walk through sorting by start time, including where engineers most often get it wrong.

QA-4

What does merging overlapping intervals guarantee, and what does it deliberately leave open?

QA-5

Describe inserting into a sorted interval list and the evidence you would collect before relying on it.

QA-6

A teammate proposes a design that hinges on the sweep-line technique. How do you evaluate it?

QA-7

Where does meeting rooms and peak concurrency matter, and where is it irrelevant?

QA-8

Teach the min-heap of end times to an engineer who has only seen it as a rule of thumb.

QA-9

How do you select the maximum number of mutually compatible, non-overlapping intervals, and why does sorting by end time guarantee an optimal greedy choice?

QA-10

How would you test a claim that the system depends on interval intersection of two lists?

QA-11

How do you find the free time intervals (gaps) shared across multiple working schedules represented as disjoint sorted interval lists?

QA-12

How do you find the maximum number of concurrent overlapping intervals at any given point in time using a sweep-line algorithm?

QA-13

When and how do you apply coordinate compression to handle intervals spanning a large or sparse domain in segment trees and difference arrays?

QA-14

When would you refuse a design because of coordinate compression?

QA-15

How would you explain interval trees without using the usual slogan?

QA-16

What failure would you inject to check a team's understanding of segment trees?

QA-17

How should on-call treat an alert that names lazy propagation as the cause?

QA-18

What belongs in a runbook section on binary indexed trees, and what does not?

QA-19

How would you review a pull request whose risk is the boundary condition in tie-breaking?

QA-20

What trade-off does intervals over time zones and calendars force that a junior answer usually skips?

QA-21

How would you brief product on why floating-point endpoints delays a ship date?

QA-22

What is the smallest experiment that would change your mind about very large interval sets?

QA-23

How does rate limiting as an interval problem interact with rollback, and where do people ignore that?

QA-24

What would you ask a candidate who recites testing interval code but cannot apply it?

QA-25

How would you document choosing the technique so the next owner can operate it?