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–25
Design a hit counter that records timestamps of hits and returns the number of hits in the past 5 minutes (300 seconds). The challenge is…
Companies: Adyen, Apple, Cisco, Databricks +5
Array · Binary Search · Data Stream · Design
Last reported Nov 2026
Find the minimum integer eating speed k such that the total hours required (sum over piles of ceil(piles[i]/k)) is ≤ h; because the required hours…
Companies: Amazon, Bloomberg, Coupang, DoorDash +6
Array · Binary Search
Last reported Oct 2026
Given an m x n matrix where each row and each column is sorted in ascending order, determine whether a target value exists by exploiting…
Companies: Amazon, Goldman Sachs
Array · Binary Search · Divide and Conquer · Matrix
Last reported Oct 2026
Given non-overlapping segments where every integer position in [li, ri] holds ci coins, find the maximum total coins covered by any contiguous window of k…
Companies: Amazon
Array · Binary Search · Greedy · Prefix Sum
Last reported Oct 2026
Count the number of contiguous subarrays of positive integers whose product is strictly less than k. Because all nums > 0, this is a sliding-window/two-pointer…
Companies: Apple
Array · Binary Search · Prefix Sum · Sliding Window
Last reported Oct 2026
Find the maximum length of a contiguous subarray that can be made all 1s by flipping at most k zeros — equivalently, find the longest…
Companies: Amazon, D. E. Shaw, LinkedIn, Meta
Array · Binary Search · Prefix Sum · Sliding Window
Last reported Sep 2026
Companies: OpenAI
Binary Search
Last reported Sep 2026
Given an ascending array of distinct integers that has been rotated at an unknown pivot, return the index of a target value (or -1 if…
Companies: Amazon, Expedia, Google, LinkedIn +3
Array · Binary Search
Last reported Sep 2026
Design a versioned array that supports point updates, taking snapshots (returning increasing snap_ids), and querying the value at an index for a given snap_id. The…
Companies: Amazon, Anduril, Apple, MongoDB
Array · Binary Search · Design · Hash Table
Last reported Sep 2026
Find the minimum ship capacity such that the weights array can be partitioned (in order) into at most D contiguous daily loads whose sums do…
Companies: Amazon, Meta, Snap
Array · Binary Search
Last reported Aug 2026
Given a source and target string, return the minimum number of subsequences of source that need to be concatenated to form target (or -1 if…
Companies: Pinterest
Binary Search · Greedy · String · Two Pointers
Last reported Aug 2026
Design a time-based key-value store that records multiple values per key with timestamps and returns the value whose timestamp is the largest <= the queried…
Companies: Amazon, Anthropic, Apple, Citadel +8
Binary Search · Design · Hash Table · String
Last reported Aug 2026
Given a sorted (ascending) array of unique integers and a target value, return the index of the target or -1 if not present; the solution…
Companies: Amazon, Bloomberg, Google, Meta +1
Array · Binary Search
Last reported Jul 2026
Given a set of weighted intervals, pick at most two non-overlapping events (events are inclusive, so the next must start at least end+1) to maximize…
Companies: Goldman Sachs, Grammarly
Array · Binary Search · Dynamic Programming · Heap (Priority Queue)
Last reported Jul 2026
Given a sorted (non-decreasing) array, return the starting and ending indices of a target value (or [-1, -1] if it’s not present). The challenge is…
Companies: Amazon, Apple, Meta, NVIDIA +3
Array · Binary Search
Last reported Jul 2026
Choose a subset of non-overlapping jobs (jobs may touch at endpoints) to maximize total profit — the classical weighted interval scheduling problem. With up to…
Companies: Airbnb
Array · Binary Search · Dynamic Programming · Sorting
Last reported Jun 2026
Given a binary matrix where each row is sorted non-decreasing (all 0s before 1s) and you can only query entries via a provided API, find…
Companies: Uber
Array · Binary Search · Interactive · Matrix
Last reported Jun 2026
Given an array of positive weights, implement pickIndex() to return index i with probability w[i]/sum(w); the typical approach preprocessing prefix sums and using a random…
Companies: Amazon, Apple, Goldman Sachs, Meta +4
Array · Binary Search · Math · Prefix Sum
Last reported Jun 2026
Given a Binary Search Tree and a target numeric value, return the value of the node in the tree that is closest to the target…
Companies: Expedia, Meta, Roblox
Binary Search · Binary Search Tree · Binary Tree · Depth-First Search
Last reported Jun 2026
Find the minimum day such that you can form at least m bouquets, each requiring k adjacent flowers that have bloomed (return -1 if impossible…
Companies: Amazon, Apple, Flipkart, Meta
Array · Binary Search
Last reported Jun 2026
Given an m×n matrix where each row is sorted and the first element of each row is greater than the last of the previous row…
Companies: Amazon, Goldman Sachs, Meta, Microsoft +1
Array · Binary Search · Matrix
Last reported Jun 2026
Given a grid with grass, fire, and impassable walls, determine the maximum minutes you can wait at (0,0) before starting to move so that you…
Companies: Google, Uber
Array · Binary Search · Breadth-First Search · Matrix
Last reported May 2026
Find any index of a "peak" (an element strictly greater than its neighbors, with array ends treated as -∞) in an integer array where adjacent…
Companies: Adobe, Meta
Array · Binary Search
Last reported Apr 2026
Companies: Anthropic
Batch & Stream Processing · Binary Search
Last reported Mar 2026