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 76–100
Given an integer array and a window size k, return the maximum value for each contiguous subarray (sliding window) as it moves one step to…
Companies: Amazon, Bloomberg, D. E. Shaw, Expedia +7
Array · Heap (Priority Queue) · Monotonic Queue · Queue
Last reported Jun 2026
Given a list of intervals [x_start, x_end] (endpoints inclusive), find the minimum number of points on the x-axis (vertical arrows) such that each interval contains…
Companies: Amazon, Atlassian, Expedia, Google
Array · Greedy · Sorting
Last reported Jun 2026
Return the power set of a unique-element integer array by enumerating all 2^n subsets (typical solutions use backtracking/DFS or bitmask iteration), noting the exponential…
Companies: Amazon, Docusign, Meta, Microsoft
Array · Backtracking · Bit Manipulation
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 integer array, return the maximum product obtainable by multiplying any three numbers. Consider both the three largest values and the combination of the…
Companies: Salesforce
Array · Math · Sorting
Last reported Jun 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 a binary grid, count how many distinct island shapes (connected components of 1s via 4-directional adjacency) appear, treating two islands as identical if they…
Companies: Anduril, Oracle, TikTok
Array · Breadth-First Search · Depth-First Search · Hash Function
Last reported Jun 2026
Given a list of money transfers among people, compute the minimum number of transactions required to settle all debts so every person's net balance becomes…
Companies: Pinterest, Salesforce, Visa
Array · Backtracking · Bit Manipulation · Bitmask
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 two arrays gas and cost around a circular route, find the unique starting station index from which you can travel clockwise once without your…
Companies: Adobe, Bloomberg, Expedia, Goldman Sachs +2
Array · Greedy
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 an array where each value is the maximum jump length from that index, determine whether you can reach the last index starting from the…
Companies: Amazon, Meta, Microsoft
Array · Dynamic Programming · Greedy
Last reported Jun 2026
Design a data structure that, given an initial list and a stream of added numbers, returns the first integer that appears exactly once at any…
Companies: Uber
Array · Data Stream · Design · Hash Table
Last reported Jun 2026
Simulate a Minesweeper click on an m×n board: clicking a mine turns it to 'X', while clicking an empty square requires counting adjacent mines —…
Companies: Meta, Microsoft, Nuro, Uber
Array · Breadth-First Search · Depth-First Search · Matrix
Last reported Jun 2026
Rotate an integer array to the right by k steps (k may exceed the array length), effectively moving each element to index (i+k) mod n…
Companies: Apple, Microsoft, Nutanix, TikTok
Array · Math · Two Pointers
Last reported Jun 2026
Given an m×n letter grid and a list of words, find all words that can be formed by sequentially adjacent (horizontal/vertical) non-repeating cells. The core…
Companies: Amazon, Bloomberg, Glean, Google +2
Array · Backtracking · Matrix · String
Last reported Jun 2026
Given an n×n binary grid (n a power of two), recursively build a quadtree by subdividing the grid into four equal quadrants until each region…
Companies: Snowflake, Uber
Array · Divide and Conquer · Matrix · Tree
Last reported May 2026
Given a sorted array, remove duplicates in-place so each unique value appears only once (preserving order) and return the count k of unique elements. This…
Companies: Bloomberg, Google, Meta, Microsoft
Array · Two Pointers
Last reported May 2026
Given sorted tax brackets with upper bounds and percentages, compute the progressive tax on a given income by summing, for each bracket in order, the…
Companies: Bloomberg, Gusto, Snowflake
Array · Simulation
Last reported May 2026
Check a 9x9 Sudoku board is valid by verifying that no digit 1–9 (ignoring '.') appears more than once in any row, column, or 3x3…
Companies: Amazon, Cisco, Microsoft
Array · Hash Table · Matrix
Last reported May 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
Given two sorted arrays nums1 and nums2 and counts m and n (nums1 has length m+n with its last n slots free), merge the elements…
Companies: Amazon, Bloomberg, Google, Meta +2
Array · Sorting · Two Pointers
Last reported Apr 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
Given lists where each entry names a parent region followed by its immediate subregions and two region names, find their smallest common region — the…
Companies: Airbnb
Array · Binary Lifting · Breadth-First Search · Depth-First Search
Last reported Apr 2026