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
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
Companies: Amazon, Apple, Meta
Binary Lifting · Binary Tree · Hash Table · Lowest Common Ancestor
Last reported Oct 2026
Given a list of words, design a class that can answer repeated queries returning the minimum index distance between two given words; optimize for many…
Companies: LinkedIn
Array · Design · Hash Table · String
Last reported Oct 2026
Given an array of non-negative heights representing elevation bars of width 1, compute the total units of water that can be trapped between them after…
Companies: Amazon, Bloomberg, Goldman Sachs, Google +6
Array · Dynamic Programming · Monotonic Stack · Stack
Last reported Oct 2026
For each query threshold, compute how many distinct cells you can reach from the top-left by moving 4-directionally through cells whose value is strictly less…
Companies: Uber
Array · Breadth-First Search · Heap (Priority Queue) · Matrix
Last reported Sep 2026
Find all unique triplets in an integer array that sum to zero, ensuring no duplicate triplets in the output. The core challenge is efficiently enumerating…
Companies: Amazon, Apple, Bloomberg, Google +5
Array · Sorting · Two Pointers
Last reported Sep 2026
Given a BST, a real-valued target and an integer k, return the k node values in the tree closest to the target. The challenge is…
Companies: Amazon, LinkedIn
Binary Search Tree · Binary Tree · Depth-First Search · Heap (Priority Queue)
Last reported Sep 2026
Count the number of contiguous substrings of s that are palindromes. With |s| up to 1000, the core challenge is to enumerate/detect all palindromic centers…
Companies: Goldman Sachs, Meta, Microsoft
Dynamic Programming · String · Two Pointers
Last reported Sep 2026
Maintain a data structure that supports adding integers from a stream and returning the current median efficiently for many interleaved addNum and findMedian calls. The…
Companies: Adobe, Amazon, D. E. Shaw, Intuit +4
Data Stream · Design · Heap (Priority Queue) · Sorting
Last reported Aug 2026
Given a string s, return the longest substring that reads the same forwards and backwards. The core challenge is efficiently finding palindromic spans around centers…
Companies: Adobe, Amazon, Bloomberg, Goldman Sachs +6
Dynamic Programming · Manacher · String · Two Pointers
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
Given an integer array sorted in non-decreasing order (which may contain negative numbers), return a new array of the squares of each number, also sorted…
Companies: Bloomberg, Instacart, Uber
Array · Sorting · Two Pointers
Last reported Aug 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
Check whether a string becomes a palindrome after lowercasing and removing all non-alphanumeric characters. The typical challenge is to do this efficiently (O(n)) by scanning…
Companies: Apple, Bloomberg, Meta
String · Two Pointers
Last reported Jun 2026
Companies: eBay, Meta, Microsoft
Linked List · Recursion · Stack · Two Pointers
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
Determine whether iterating n -> sum of the squares of its digits eventually reaches 1 or falls into a repeating cycle; the core task is…
Companies: Snowflake
Floyd's Cycle Finding Algorithm · Hash Table · Math · Two Pointers
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
Rearrange the array in-place to produce the lexicographically next greater permutation (using only O(1) extra space); if no larger permutation exists, reorder it to the…
Companies: Amazon, Bloomberg, Meta, Microsoft
Array · Two Pointers
Last reported Apr 2026
Rearrange the array in-place so all zeros are moved to the end while preserving the relative order of non-zero elements, without using extra storage. Aim…
Companies: Amazon, Google, Meta, Microsoft
Array · Two Pointers
Last reported Apr 2026
Check whether any substring of s2 of length |s1| is a permutation of s1 (i.e., has the same character multiset). The core challenge is to…
Companies: Apple, Meta
Hash Table · Sliding Window · String · Two Pointers
Last reported Mar 2026
Given an m×n board of integer "candies," repeatedly find and remove any horizontal or vertical runs of ≥3 identical candies, let the remaining candies fall…
Companies: Meta, Microsoft, Roblox
Array · Matrix · Simulation · Two Pointers
Last reported Feb 2026
Compress an array of characters in-place by replacing each run of consecutive identical characters with the character followed by its run length (omit the length…
Companies: Apple, Goldman Sachs, Morgan Stanley, Pinterest +1
String · Two Pointers
Last reported Jan 2026
Find the length of the longest contiguous "mountain" subarray — a strictly increasing sequence immediately followed by a strictly decreasing sequence with length ≥ 3…
Companies: Oracle, TikTok
Array · Dynamic Programming · Enumeration · Two Pointers
Last reported Nov 2025
Given two sorted, pairwise-disjoint lists of closed intervals, return all non-empty intersections between intervals from the two lists. Because each list is ordered and…
Companies: Meta, Verkada
Array · Sweep Line · Two Pointers
Last reported Sep 2025