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–9
Design a stack data structure that supports standard push, pop, and top operations, along with a getMax operation that retrieves (but does not remove) the…
Companies: Confluent, Everpure, LinkedIn, Walmart Labs
Design · Doubly-Linked List · Linked List · Ordered Set
Last reported Oct 2026
Find the length of the longest contiguous subarray whose maximum minus minimum is ≤ limit; the key challenge is maintaining the window's current min and…
Companies: MongoDB, Uber
Array · Heap (Priority Queue) · Monotonic Queue · Ordered Set
Last reported Apr 2026
Maintain dynamic collections to (1) return the cheapest up-to-5 shops that have an unrented copy of a given movie and (2) report the cheapest up-to-5…
Companies: Amazon, Okta
Array · Design · Hash Table · Heap (Priority Queue)
Last reported Sep 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
Support inserting obstacles at points on the nonnegative number line and, for each query, determine whether there exists any obstacle-free interval of length >= sz…
Companies: Hudson River Trading, Roblox, TikTok
Array · Binary Indexed Tree · Binary Search · Ordered Set
Given a sequence of ID updates where each step adds or removes a given number of copies of an ID, maintain the dynamic multiset of…
Companies: Snowflake
Array · Hash Table · Heap (Priority Queue) · Ordered Set
Given a list of closed time intervals for when each flower is in full bloom and query times for people arriving, return for each person…
Companies: Roblox
Array · Binary Search · Hash Table · Ordered Set
Partition the 2n integers into two equal-sized groups (choose n elements for one group) to minimize the absolute difference of their sums — a constrained…
Companies: Salesforce
Array · Binary Search · Bit Manipulation · Bitmask
Count the number of index pairs (i, j) with 0 ≤ i < j < n such that nums[i] > 2 * nums[j]; this is…
Companies: eBay
Array · Binary Indexed Tree · Binary Search · Divide and Conquer