InterviewDB Question

Lazy Array: Implement Range Update and Point Query with Deferred Propagation

Question Details

Problem Implement a LazyArray that supports bulk range updates efficiently. All values start at 0. update(l, r, val) — add val to every element in index range [l, r] inclusive. query(i) — return the current value at index i. range_query(l, r) — retur…

Full Details

🔒

Unlock full leaked content

Full insider details, leaked discussions, and candidate experiences.

Get Premium →

Topics

Coding Onsite Phone Arrays