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,076–1,100
Implement a bounded stack (maxSize) supporting push, pop (returning -1 if empty), and increment(k, val) which adds val to the bottom k elements; the core…
Companies: Google
Last reported May 2025
Given arrival times/orders of cars and a traffic light that cycles through states, simulate the intersection to determine which cars can pass (and when) under…
Companies: Google
Last reported May 2025
Compute, for each day between 2013-10-01 and 2013-10-03 that has at least one trip, the cancellation rate among trips where both client and driver are…
Companies: Uber
Last reported May 2025
Implement a Calculator class whose constructor takes an initial numeric result and provides add, subtract, multiply, divide (throw "Division by zero is not allowed" for…
Companies: Google, Microsoft
Last reported May 2025
Count the number of distinct non-empty palindromic subsequences in a string (n ≤ 1000, alphabet {a,b,c,d}), returning the result modulo 1e9+7. The core challenge is…
Companies: Salesforce
Last reported May 2025
Companies: Netflix
Last reported May 2025
Companies: Jane Street
Last reported May 2025
Given a string containing letters and parentheses, remove the minimum number of parentheses to produce all distinct valid parentheses strings and return them. The core…
Companies: Meta
Backtracking · Breadth-First Search · String
Last reported May 2025
Companies: Snap
Last reported May 2025
Determine whether a binary tree is complete — i.e., every level except possibly the last is fully filled and nodes in the last level are…
Companies: Meta
Last reported Apr 2025
Given a list of absolute folder paths, return only the top-level folders by removing any path that is a subfolder of another. The core challenge…
Companies: Google, Meta
Last reported Apr 2025
Given a tree rooted at city 0 with one representative per node and cars of fixed capacity, compute the minimum fuel (edge traversals) needed to…
Companies: Amazon
Last reported Apr 2025
Partition the digit string into exactly four segments (by inserting three dots) so each segment is between 0 and 255 and has no leading zeros…
Companies: Microsoft, Motive, NVIDIA
Backtracking · String
Last reported Apr 2025
Flatten a nested array up to a given depth n: return a new array where only subarrays whose nesting depth is less than n (top-level…
Companies: Apple, Meta
Last reported Apr 2025
Return the node values of an n-ary tree grouped by depth (level-order / breadth-first traversal), producing a list of lists where each inner list contains…
Companies: Meta
Last reported Apr 2025
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
Companies: OpenAI
Data Structure Design
Last reported Apr 2025
Companies: Quicknode
Last reported Apr 2025
Given an array nums of length n where each value is in [1,n], return all integers in [1,n] that are missing from nums. The core…
Companies: Amazon
Last reported Apr 2025
Given an array of unique words, return all ordered index pairs (i, j) such that words[i] + words[j] is a palindrome. The optimal solution relies…
Companies: Airbnb
Last reported Mar 2025
Extract the distinct digits from an alphanumeric string and return the second-largest digit value (or -1 if fewer than two distinct digits exist). The string…
Companies: Spotify
Last reported Mar 2025
Find the largest integer h such that at least h papers have citation counts >= h — i.e., determine the threshold rank in the citations…
Companies: Microsoft
Last reported Mar 2025
Given the root of a BST, find the minimum absolute difference between values of any two different nodes. Use the BST property (in-order yields sorted…
Companies: Meta
Last reported Mar 2025
Given a string of '(' and ')', return the minimum number of insertions needed to make it balanced under the rule that each '(' must…
Companies: Bloomberg, Meta
Bracket Sequences · Greedy · Stack · String
Last reported Mar 2025
Return the k-th smallest value (1-indexed) in a BST — exploit that an in-order traversal yields values in sorted order and pick the k-th visited…
Companies: Amazon, Google, Meta, Uber
Binary Search Tree · Binary Tree · Depth-First Search · Tree
Last reported Mar 2025