โ† Amazon questions
CodingReported in a candidate post, Aug 2022

4Sum with O(n^2) time complexity

Filed under Amazon

Given an array of integers and a target value, find all unique quadruplets [a, b, c, d] in the array such that a + b + c + d == target, optimized to run in O(n^2) time complexity.

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 Amazon questions

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