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 276–300
Given birth-death intervals where a person is alive in years [birth, death-1], find the year with the maximum number of overlapping intervals (people alive) and…
Companies: Google
Last reported Aug 2026
Given a potentially very large matrix stored in a binary file with a 20-byte header, implement a transpose function that reads the matrix and writes…
Companies: Intuit
Last reported Aug 2026
Place the minimum number of cameras on nodes of a binary tree so every node is monitored by a camera on itself, its parent, or…
Companies: Amazon, D. E. Shaw
Binary Tree · Depth-First Search · DP on Trees · Dynamic Programming
Last reported Aug 2026
Companies: Anthropic
Arrays & Strings · Stacks & Queues
Last reported Aug 2026
Choose exactly k cards from either end of an array to maximize the sum; equivalently, remove a contiguous subarray of length n−k with minimum sum…
Companies: Coupang
Last reported Aug 2026
Given an m×n grid with empty cells, fresh (1) and rotten (2) oranges, compute the minimum minutes until all fresh oranges become rotten as rot…
Companies: Amazon, Anduril, Flipkart, Goldman Sachs +3
Array · Breadth-First Search · Matrix
Last reported Aug 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 an m×n height grid where water can flow from a cell to any neighbor of lesser-or-equal height, return all coordinates from which water can…
Companies: Amazon, Merge, Meta, Pinterest
Last reported Aug 2026
Reverse the characters of each word in a sentence while preserving the original word order and spaces. Words are non-empty and separated by a single…
Companies: Meta, Temporal
Last reported Aug 2026
Find the length of the shortest contiguous subarray which, if sorted, makes the entire array non-decreasing — i.e., identify the minimal window that violates the…
Companies: Amazon
Last reported Aug 2026
Given pairs (h, k) where k is the number of people with height >= h standing in front of that person, reconstruct the queue ordering…
Companies: Anduril
Last reported Aug 2026
Given an original sequence and a list of subsequences, determine whether those subsequences uniquely determine the original order — equivalently, whether the precedence…
Companies: Google
Last reported Aug 2026
Determine whether a binary tree is a valid binary search tree by checking that each node's value is strictly greater than all values in its…
Companies: Amazon, Lyft, Microsoft
Binary Search Tree · Binary Tree · Depth-First Search · Tree
Last reported Aug 2026
Given lists of accounts where each account has a name and emails, merge accounts that share any email by grouping connected emails (e.g., via union-find…
Companies: Airbnb, Bloomberg, Meta, Oracle +1
Array · Breadth-First Search · Depth-First Search · Hash Table
Last reported Aug 2026
Implement a voting system for articles that allows users to upvote or downvote content. The system should track vote counts and handle operations such as…
Companies: Rippling
Last reported Aug 2026
Asked to complete a 3-part coding test in under 60 minutes. mostly basic stuff like data parsing, but a lot of small conditions make it…
Companies: Stripe
Last reported Aug 2026
Build a payment management system to process transactions with priority given to credit, credit card, and PayPal. For each type, process refunds only for the…
Companies: Airbnb, Capital One
Last reported Aug 2026
Find the minimum ship capacity such that the weights array can be partitioned (in order) into at most D contiguous daily loads whose sums do…
Companies: Amazon, Meta, Snap
Array · Binary Search
Last reported Aug 2026
Two robots start at the top-left and top-right of an rows×cols grid and simultaneously move down one row each step choosing left/stay/right (col-1/col/col+1), collecting…
Companies: Amazon
Last reported Aug 2026
Reconstruct a binary tree from its preorder string representation where node values are integers and left/right children are given as parenthesized substrings (e.g.…
Companies: Meta, Moengage, SpaceX
Last reported Aug 2026
Companies: Amazon, Meta, Microsoft, NVIDIA
Hash Table · Linked List
Last reported Aug 2026
Given a long text and one or more query strings, count how many times each query appears in the text (including overlapping matches). The core…
Companies: Microsoft
Last reported Aug 2026
Decode a string containing nested repeat patterns of the form k[encoded_string], expanding each bracketed segment k times (k may be multi-digit) possibly with multiple nesting…
Companies: Bloomberg, Coupang, Google, Microsoft +4
Recursion · Stack · String
Last reported Aug 2026
Implement a song playlist data structure with methods to add and remove songs from the playlist.
Companies: Amazon, Bloomberg
Last reported Aug 2026
Implement a TaskManager supporting add, edit, remove, and execTop (execute and remove the global task with highest priority, breaking ties by larger taskId) and return…
Companies: Anchorage Digital, Rippling
Last reported Aug 2026