Airbnb Associate Developer Interview Question 2024 August | Two Pointers & DP | on-campus

Question · Posted Jun 2026

Question 1: 3Sum Problem Statement Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. Constraints 3 <= nums.length <= 3000 -105 <= nums[i] <= 105 Examples Example 1: Input: nums = [-1,0,1,2,-1,-4] Output: [[-1,-1,2],[-1,0,1]] Explanation 1: After sorting the array: [-4, -1, -1, 0, 1, 2]. Fix pivot ...

The full answer & interview discussion are available to premium members.

Log in Create a free account