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 476–500
Given a list of money transfers among people, compute the minimum number of transactions required to settle all debts so every person's net balance becomes…
Companies: Pinterest, Salesforce, Visa
Array · Backtracking · Bit Manipulation · Bitmask
Last reported Jun 2026
Design and implement a class to support a connect-n (imagine connect-4 except with any number in a row) game where the board has infinite width…
Last reported Jun 2026
Given two arrays of positive integers, return the maximum length (in digits) of a common leftmost-digit prefix shared by any number from arr1 and any…
Companies: Apple
Last reported Jun 2026
Build an in-memory database that supports basic SQL-like operations including insert, query with WHERE clauses, and ORDER BY functionality. Implement efficient data storage…
Companies: Anthropic, OpenAI, Two Sigma
Last reported Jun 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
Find the length of the longest substring where each vowel (a, e, i, o, u) occurs an even number of times. This is typically solved…
Companies: Amazon, Meta
Last reported Jun 2026
Companies: OpenAI
Data Structure Design
Last reported Jun 2026
Companies: OpenAI
Data Structure Design · Memory Management
Last reported Jun 2026
Given a Binary Search Tree and a target numeric value, return the value of the node in the tree that is closest to the target…
Companies: Expedia, Meta, Roblox
Binary Search · Binary Search Tree · Binary Tree · Depth-First Search
Last reported Jun 2026
Given distinct candidate integers and a target, return all unique order-insensitive combinations where each candidate may be used unlimited times and the numbers sum to…
Companies: Expedia
Last reported Jun 2026
Given two arrays gas and cost around a circular route, find the unique starting station index from which you can travel clockwise once without your…
Companies: Adobe, Bloomberg, Expedia, Goldman Sachs +2
Array · Greedy
Last reported Jun 2026
Find the minimum day such that you can form at least m bouquets, each requiring k adjacent flowers that have bloomed (return -1 if impossible…
Companies: Amazon, Apple, Flipkart, Meta
Array · Binary Search
Last reported Jun 2026
Given arrays of task difficulties and corresponding profits plus worker abilities, assign at most one task to each worker (a worker can do any task…
Companies: Amazon
Last reported Jun 2026
Given an m×n matrix where each row is sorted and the first element of each row is greater than the last of the previous row…
Companies: Amazon, Goldman Sachs, Meta, Microsoft +1
Array · Binary Search · Matrix
Last reported Jun 2026
Given a sorted ascending array with unknown length accessible only via a bounded reader (out‑of‑range returns a sentinel), find the index of a target or…
Companies: Amazon
Last reported Jun 2026
Count the number of structurally unique binary search trees that can be formed using values 1..n. This is equivalent to computing the nth Catalan number…
Companies: Amazon
Last reported Jun 2026
Given a list of chocolate bag sizes (each size may be used any number of times) and a target capacity n, find all unique combinations…
Companies: Apple
Last reported Jun 2026
Given an array where each value is the maximum jump length from that index, determine whether you can reach the last index starting from the…
Companies: Amazon, Meta, Microsoft
Array · Dynamic Programming · Greedy
Last reported Jun 2026
Given base pizza prices and topping prices, determine which total price closest to a target budget can be achieved by choosing one base and any…
Companies: Amazon
Last reported Jun 2026
Companies: TikTok
Last reported Jun 2026
Design a data structure that, given an initial list and a stream of added numbers, returns the first integer that appears exactly once at any…
Companies: Uber
Array · Data Stream · Design · Hash Table
Last reported Jun 2026
Given a nested tree hierarchy (e.g., categories and subcategories), implement an iterator class with a next() method that traverses and returns each node's value in…
Companies: Adobe
Last reported Jun 2026
Companies: Microsoft
Last reported Jun 2026