← Goldman Sachs questions

Subarray with given sum and check if a tree is a SumTree

Filed under Goldman Sachs

Two coding problems. (1) Given an integer array and a target sum, find a contiguous subarray whose elements add up to the target. (2) Given a binary tree, check whether it is a SumTree: every non-leaf…

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.