Bloomberg SWE Interview Question | 2024-April | Stacks & Two-Pointers (Hard Array Manipulations)
Question · Posted Jun 2026
Question 1: Trapping Rain Water 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 strictly trap after raining. Constraints n == height.length 1 <= n <= 2 * 104 Example Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6 Explanation: Water is trapped in the valleys between the elevation peaks. Total units trapped = 6. Question 2: Longest Valid Parentheses Problem Statement Given a string containing just the ...
The full answer & interview discussion are available to premium members.
Log in Create a free account