Least You Need to Know: Segment Trees, Range Queries, and Overlap Cases
Open lesson
Segment trees recursively partition an array into intervals so that range aggregates can be answered in
O(log n) by combining a small number of stored interval results. The key interview idea is to reason about no overlap, partial overlap, and complete overlap.