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–18
Given a list of meeting time intervals, determine the minimum number of conference rooms required so that no meetings overlap. The core challenge is computing…
Companies: Amazon, Apple, Google, Meta +9
Array · Greedy · Heap (Priority Queue) · Prefix Sum
Last reported Nov 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
For each index in an integer array, compute the product of all other elements without using division and in O(n) time — typically done by…
Companies: Amazon, Asana, Meta, Snap
Array · Prefix Sum
Last reported Sep 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
Count the number of contiguous, non-empty subarrays whose elements sum to k. Because nums can include negatives (so two-pointer sliding window doesn't work), use cumulative…
Companies: Amazon, Apple, Bloomberg, Google +3
Array · Hash Table · Prefix Sum
Last reported Mar 2026
Split the array into k non-empty contiguous subarrays so that the maximum subarray sum is as small as possible, and return that minimized largest sum…
Companies: Amazon, Google, Microsoft, Pinterest +2
Array · Binary Search · Dynamic Programming · Greedy
Last reported Feb 2026
Find the length of the shortest contiguous subarray of positive integers whose sum is at least a given target (return 0 if none exists). This…
Companies: Bloomberg, Meta, Toast
Array · Binary Search · Prefix Sum · Sliding Window
Last reported Aug 2025
Find the length of the shortest contiguous subarray whose sum is at least k, or return -1 if none exists. Because nums can contain negative…
Companies: Meta
Array · Binary Search · Heap (Priority Queue) · Monotonic Queue
Last reported Jan 2025
Find the maximum length of a contiguous subarray in a binary array that contains an equal number of 0s and 1s. This is solved by…
Companies: Cisco
Array · Hash Table · Prefix Sum
Companies: Microsoft
Array · Dynamic Programming · Prefix Sum
Count the number of contiguous subarrays that contain exactly k odd numbers in an integer array. The core challenge is to do this in linear…
Companies: TikTok
Array · Hash Table · Math · Prefix Sum
Remove elements from either end to make the sum of removed elements equal x; equivalently, find the longest contiguous subarray whose sum equals total(nums) -…
Companies: Bloomberg
Array · Binary Search · Hash Table · Prefix Sum
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
Count the number of non-empty substrings (in a string of letters 'a'–'j') whose character counts have at most one odd frequency. Core idea: track a…
Companies: Uber
Bit Manipulation · Hash Table · Prefix Sum · String
Given an array of positive integers (bag counts), remove beans (only deletions allowed) so that every non-empty bag has the same count, minimizing total beans…
Companies: D. E. Shaw
Array · Enumeration · Greedy · Prefix Sum
Count the number of contiguous subarrays whose sum is divisible by k; this reduces to counting pairs of prefix sums with the same remainder modulo…
Companies: TikTok
Array · Hash Table · Prefix Sum