← Goldman Sachs questions

Segment tree with arithmetic progression range updates and range sum query

Filed under Goldman Sachs

Design a segment tree supporting range sum queries on [l, r] alongside range updates that add an increasing arithmetic sequence x, x+1, ..., x+r-l to elements in [l, r].

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.