---
title: "Discussion on \"Trapping Rain Water: From Intuitive to Optimized Solutions - Top Tech & Investment Banking Interview Guide (Java, Hard, O(n))\" | Hashnode"
description: "Discussion on \"Trapping Rain Water: From Intuitive to Optimized Solutions - Top Tech & Investment Banking Interview Guide (Java, Hard, O(n))\". For every position, the water it can trap equals min(maxLeft, maxRight) - height[i] (when positive)."
url: "https://hashnode.com/posts/mastering-the-trapping-rain-water-problem-two-on-java-solutions/6868c9a4e67498836dc94684"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Trapping Rain Water: From Intuitive to Optimized Solutions - Top Tech & Investment Banking Interview Guide (Java, Hard, O(n))](https://huanganni.hashnode.dev/mastering-the-trapping-rain-water-problem-two-on-java-solutions?utm_source=hashnode&utm_medium=feed)

For every position, the water it can trap equals min(maxLeft, maxRight) - height\[i\] (when positive).

Jul 5, 2025 · 4 min read · huanganni.hashnode.dev  
Read the article

-   [#zopsmart](https://hashnode.com/tag/zopsmart)
-   [#java](https://hashnode.com/tag/java)
-   [#trappingrainwater](https://hashnode.com/tag/trappingrainwater)
-   [#leetcode-solution](https://hashnode.com/tag/leetcode-solution)
-   [#goldman-sachs](https://hashnode.com/tag/goldman-sachs)
-   [#amazon](https://hashnode.com/tag/amazon)
-   [#google](https://hashnode.com/tag/google)
-   [#tiktok](https://hashnode.com/tag/tiktok)
-   [#bloomberg](https://hashnode.com/tag/bloomberg)
-   [#meta](https://hashnode.com/tag/meta)
-   [#microsoft](https://hashnode.com/tag/microsoft)
-   [#snowflake](https://hashnode.com/tag/snowflake)
-   [#tsc](https://hashnode.com/tag/tsc)
-   [#leetcode](https://hashnode.com/tag/leetcode)
-   [#leetcodehard](https://hashnode.com/tag/leetcodehard)

## Written by

[Anni Huang](https://hashnode.com/@HuangAnni)

@HuangAnni · Singapore

  
[View profile](https://hashnode.com/@HuangAnni)

LLM Training Operation Specialist @ ByteDance | Ex-Master of IT in Business (AI track) at SMU

I’m Anni Huang, an AI researcher-in-training currently at ByteDance, specializing in LLM training operations with a coding focus. I bridge the gap between engineering execution and model performance, ensuring the quality, reliability, and timely delivery of large-scale training projects.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
