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 26–36
Given a string of '(' and ')', return the minimum number of insertions needed to make it balanced under the rule that each '(' must…
Companies: Bloomberg, Meta
Bracket Sequences · Greedy · Stack · String
Last reported Mar 2025
Evaluate the integer value of an expression given in Reverse Polish Notation, where tokens are integers or the operators +, -, *, / and all…
Companies: Citadel, Google
Array · Math · Stack
Last reported Nov 2024
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
Return the preorder (root–left–right) traversal of a binary tree as a list of node values. The recursive solution is trivial; the follow-up asks for an…
Companies: Meta
Binary Tree · Depth-First Search · Stack · Tree
Given a string with brace-enclosed comma-separated option groups and implicit concatenation (e.g., "{a,b}c{d,e}"), generate all unique strings formed by choosing one option…
Companies: Anduril
Backtracking · Breadth-First Search · Sorting · 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
Given a valid parentheses string, assign each character to one of two disjoint valid-parentheses subsequences A and B (output 0/1 per index) so that the…
Companies: Microsoft
Bracket Sequences · Stack · String
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
Given a string s and an empty buffer t that acts like a stack (you can push s's first char onto t or pop t's…
Companies: Bloomberg, Expedia, Rippling
Greedy · Hash Table · Stack · String