Question bank › Two Pointers
Dsa Two Pointers Medium

Three Sum Closest

Given an array of integers and an integer target, find the sum of three integers in the array such that the sum is closest to the target. Return the sum. For example, for the input [-1, 2, 1, -4] with target 1, the output should be 2, as the sum of -1, 2, and 1 is 2, which is closer to 1 than any other combination.

Key concepts

two_pointersarrayssums

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.