DE Shaw Associate Developer Interview Question 2022 August | Stack and DP | on-campus
Question · Posted Jun 2026
Question 1: Maximal Rectangle Problem Statement Given a rows x cols binary matrix filled with '0's and '1's, find the largest rectangle containing only '1's and return its area. Constraints rows == matrix.length cols == matrix[i].length 1 <= rows, cols <= 200 matrix[i][j] is '0' or '1' Examples Example 1: Input: matrix = [["1","0","1","0","0"], ["1","0","1","1","1"], ["1","1","1","1","1"], ["1","0","0","1","0"]] Output: 6 Explanation 1: Build a heights array row by row. After row 2 (0-indexed): heights=[3,1,3,2,2] (consecutive 1s above each column including current ...
The full answer & interview discussion are available to premium members.
Log in Create a free account