Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Leetcode 42. Trapping Rain Water
Given an array of non-negative heights representing elevation bars of width 1, compute the total units of water that can be trapped between them after raining. The core challenge is determining, for each position, the bounding left and right maxima to accumulate trapped volume efficiently (ideally in linear time).
Asked at:
Amazon
Microsoft
goldman sachs
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late September, 2025
goldman sachs
Mid-level
Early September, 2025
Microsoft
Mid-level
https://leetcode.com/problems/trapping-rain-water/description/
Early June, 2025
Amazon
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.