Goldman Sachs SDE Interview | Advanced Heaps & BFS | Off-Campus

Goldman-Sachs · Question · Posted Jun 2026

Question 1: Trapping Rain Water II (3D Elevation) Problem Statement Given an m x n integer matrix heightMap representing the elevation of each unit cell in a 2D elevation map, return the absolute volume of water it can trap after raining. Unlike the 2D version (which only traps water left-to-right), this is a full 3D topography map. Water can leak out of the top, bottom, left, or right sides of the matrix if there isn't a continuous boundary of taller ...

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

Log in Create a free account