Palantir SDE Interview Question 2021 November | Monotonic Stack | On-campus
Question · Posted Jun 2026
Question 1: Largest Rectangle in Histogram Problem Statement Given an array of integers heights representing the histogram's bar heights where each bar has width 1, return the area of the largest rectangle in the histogram. Constraints 1 <= heights.length <= 105 0 <= heights[i] <= 104 Examples Example 1: Input: heights = [2, 1, 5, 6, 2, 3] Output: 10 Explanation 1: The largest rectangle spans bars at indices 2 and 3 (heights 5 and 6). The bottleneck height is ...
The full answer & interview discussion are available to premium members.
Log in Create a free account