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 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 an integer array and k, return the k most frequent elements — the core challenge is to count element frequencies and extract the top-k…
Companies: Amazon, Bloomberg, Google, Meta +9
Array · Bucket Sort · Counting · Divide and Conquer
Last reported Oct 2026
Return the k-th largest element (by sorted order, not distinct) from an unsorted array. For inputs up to ~1e5 elements, solve it faster than full…
Companies: Bloomberg, LinkedIn, Meta, Salesforce +1
Array · Divide and Conquer · Heap (Priority Queue) · Quickselect
Last reported Sep 2026
Find the contiguous subarray within an integer array that yields the maximum possible sum and return that sum. This is typically solved in O(n) with…
Companies: Amazon, Google, LinkedIn, Meta +5
Array · Divide and Conquer · Dynamic Programming
Last reported Sep 2026
Companies: Amazon, Meta, NVIDIA, Oracle +3
Divide and Conquer · Heap (Priority Queue) · Linked List · Merge Sort
Last reported Aug 2026
Given an array of n integers, return the element that appears more than ⌊n/2⌋ times (the majority element is guaranteed to exist). The goal is…
Companies: Amazon, Bloomberg, Coupang, Google +1
Array · Boyer–Moore Majority Vote Algorithm · Counting · Divide and Conquer
Last reported Aug 2026
Given N points on the plane and an integer k, return the k points with the smallest Euclidean distance to the origin (order doesn't matter)…
Companies: Airbnb, Amazon, Asana, Meta
Array · Divide and Conquer · Geometry · Heap (Priority Queue)
Last reported Aug 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
Find the median of two sorted arrays in O(log(m+n)) time by using binary search to partition the arrays so the left half contains the correct…
Companies: Amazon, Bloomberg, eBay, Goldman Sachs +5
Array · Binary Search · Divide and Conquer
Last reported Apr 2025
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