Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 1–10
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…
Companies: Amazon, Bloomberg, Goldman Sachs, Google +6
Array · Dynamic Programming · Monotonic Stack · Stack
Last reported Oct 2026
For each price, compute the final cost as price minus the first subsequent price to its right that is <= it (or the same price…
Companies: Uber, Walmart
Array · Monotonic Stack · Stack
Last reported Aug 2026
Given nums1 as a subset of nums2, for each element in nums1 return the first greater element that appears to its right in nums2 (or…
Companies: Flipkart, Microsoft
Array · Hash Table · Monotonic Stack · Stack
Last reported Jun 2026
Given an array of building heights, return the indices of buildings that have an unobstructed view to the ocean on the right (i.e., no building…
Companies: Anduril, Meta
Array · Monotonic Stack · Stack
Last reported Apr 2026
Choose heights within [1, maxHeights[i]] that form a mountain (nondecreasing to a single peak then nonincreasing) to maximize the total sum. Core challenge: for each…
Companies: Bloomberg, Expedia
Array · Monotonic Stack · Stack
Last reported Sep 2025
Determine whether the array contains indices i < j < k such that nums[i] < nums[k] < nums[j] (a "132" subsequence). With n up to…
Companies: DoorDash
Array · Binary Search · Monotonic Stack · Ordered Set
Given an unsorted array, count the elements that are "binary searchable" — values that would be found by standard binary search without sorting, meaning every…
Companies: Uber
Array · Binary Search · Monotonic Stack · Stack
For each day in an array of daily temperatures, determine how many days you must wait until a warmer temperature appears (or 0 if none)…
Companies: Anduril, Chime, Goldman Sachs
Array · Monotonic Stack · Stack
Find the maximum area of a rectangle formed by contiguous bars in a histogram (given bar heights). The core challenge is determining each bar's maximal…
Companies: Bloomberg, Microsoft
Array · Monotonic Stack · Range Minimum/Maximum Query · Stack
Remove duplicate letters from s so each character appears exactly once and the resulting string is the smallest possible in lexicographic order. This is solved…
Companies: TikTok
Greedy · Monotonic Stack · Stack · String