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
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
Given a list of directed flight tickets, reconstruct an itinerary starting at "JFK" that uses every ticket exactly once and, among all valid itineraries, returns…
Companies: Amazon, Anduril, Google, Pinterest
Array · Depth-First Search · Eulerian Circuit · Eulerian Path
Last reported Nov 2026
Given an array of words and a maximum line width maxWidth, format the text so that each line has exactly maxWidth characters and is fully…
Companies: Airbnb, Amazon, Anyscale, Capital One +3
Array · Simulation · String
Last reported Nov 2026
Find the maximum total sum of two non-overlapping contiguous subarrays of given lengths firstLen and secondLen (either order allowed). Typical approach uses prefix sums or…
Companies: Meta, Sprinklr
Array · Dynamic Programming · Sliding Window
Last reported Oct 2026
Group the input strings into lists of anagrams — i.e., strings that contain the same multiset of letters — and return the groups in any…
Companies: Amazon, Apple, Arize Ai, Bloomberg +14
Array · Hash Table · Sorting · String
Last reported Oct 2026
Count word frequencies and return the k most frequent words sorted by descending frequency, breaking ties by lexicographical order. The core challenge is combining frequency…
Companies: Apple, Microsoft, Oracle, Robinhood
Array · Bucket Sort · Counting · Hash Table
Last reported Oct 2026
Given a list of intervals, merge all overlapping (including touching endpoints) intervals and return the minimal set of non-overlapping intervals that cover them. Key pattern…
Companies: Amazon, Antithesis, Apple, Atlassian +16
Array · Quicksort · Sorting
Last reported Oct 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 a DAG of course prerequisites where each course has a duration and any number of courses can run in parallel once prerequisites are satisfied…
Companies: Google, Meta, Modular, Salesforce +1
Array · Directed Acyclic Graph · Dynamic Programming · Graph Theory
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 coin denominations available in unlimited quantity and a target amount, find the minimum number of coins needed to form that amount (return -1 if…
Companies: Amazon, Google, Pinterest, Uber
Array · Breadth-First Search · Complete Knapsack · Dynamic Programming
Last reported Oct 2026
Parse each directory string to extract full file paths and their contents, then group paths by identical file content and return all groups containing at…
Companies: Anthropic, Google, OpenAI
Array · Hash Table · String
Last reported Oct 2026
Given an integer array nums and two integers k and m, perform at most k increment operations on any elements, then return the maximum possible…
Companies: Amazon
Array · Bit Manipulation · Greedy · Sorting
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
Given arrays of box heights and warehouse room heights, maximize how many boxes can be placed knowing a box can only reach a room if…
Companies: Pinterest
Array · Greedy · Sorting
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
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
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
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
Given an array of daily stock prices, compute the maximum profit achievable from exactly one buy-before-sell transaction (i.e., the largest prices[j] - prices[i] with j…
Companies: Adobe, Amazon, Apple, Atlassian +10
Array · Dynamic Programming
Last reported Sep 2026
Given a binary array representing a flowerbed (0 = empty, 1 = planted) with no adjacent 1s, determine if you can add n new flowers…
Companies: LinkedIn, Meta
Array · Greedy
Last reported Sep 2026
Design a data structure supporting insert(val), remove(val), and getRandom() — which returns a uniformly random existing element — with each operation in average O(1) time…
Companies: Amazon, Apple, Bloomberg, Citadel +7
Array · Design · Hash Table · Math
Last reported Sep 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
Starting from given initial boxes, repeatedly open any box that is either already open or for which you have a key to collect its candies…
Companies: Airbnb
Array · Breadth-First Search · Graph Theory
Last reported Sep 2026