Samsung Associate Developer Interview Question 2025 January | Two Pointers | on-campus

Samsung · Question · Posted Jun 2026

Question 1 Problem Statement Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Constraints n == height.length 1 <= n <= 2 x 104 0 <= height[i] <= 105 Examples Example 1: Input: height = [0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1] Output: 6 Explanation 1: Water trapped at each index depends on the minimum of the maximum height ...

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

Log in Create a free account