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:
Microsoft
Bloombergtestla
Goldman Sachs
T
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early October, 2026
Mid-level
No extra req. Need to write the test cases by yourself
Late September, 2026
Senior
They expanded to 2D matrix then.
Early September, 2026
T
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.