← Goldman Sachs questions
CodingReported in a candidate post, Dec 2023

Find pair with sum closest to k in an array

Filed under Goldman Sachs

Given a sorted or unsorted array of integers and a target integer k, find a pair of elements whose sum is closest to k.

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.