← Goldman Sachs questions
CodingReported in a candidate post, Jul 2025

Data structure that sets all values in O(1)

Filed under Goldman Sachs

Design a data structure, for example an array or map of values, that supports get(i), set(i, v) and set_all(v), where set_all assigns v to every element, all in O(1) time.

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.