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 26–50
Determine whether ransomNote can be formed from magazine by verifying that for every character, magazine contains at least as many occurrences as needed — i.e.…
Companies: Anduril, Pinterest
Counting · Hash Table · String
Last reported Sep 2026
Design a versioned array that supports point updates, taking snapshots (returning increasing snap_ids), and querying the value at an index for a given snap_id. The…
Companies: Amazon, Anduril, Apple, MongoDB
Array · Binary Search · Design · Hash Table
Last reported Sep 2026
Given a string of digits 2–9, return all possible letter strings by mapping each digit to its phone-keypad letters — effectively computing the Cartesian product…
Companies: Amazon, Google, LinkedIn, Microsoft +1
Backtracking · Hash Table · String
Last reported Aug 2026
Given a string s and a word dictionary, return all possible sentences formed by inserting spaces so every token is a dictionary word — i.e.…
Companies: Bloomberg, Meta, ServiceNow
Array · Backtracking · Dynamic Programming · Hash Table
Last reported Aug 2026
Given an array of n integers, return the element that appears more than ⌊n/2⌋ times (the majority element is guaranteed to exist). The goal is…
Companies: Amazon, Bloomberg, Coupang, Google +1
Array · Boyer–Moore Majority Vote Algorithm · Counting · Divide and Conquer
Last reported Aug 2026
Given an array of integers and a target, return the indices of two distinct elements whose values sum to the target (exactly one valid solution…
Companies: Amazon, Apple, Bloomberg, Brex +13
Array · Hash Table
Last reported Aug 2026
Find the substring (overlaps allowed) that occurs most often in s among those with length between minSize and maxSize and at most maxLetters distinct characters…
Companies: Chewy, LinkedIn, Microsoft
Hash Table · Sliding Window · String
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
Companies: Amazon, Meta, Microsoft, NVIDIA
Hash Table · Linked List
Last reported Aug 2026
Find the length of the longest run of consecutive integers in an unsorted array, with an O(n) time requirement. The core idea is to detect…
Companies: Amazon, Bloomberg, Google, Microsoft +1
Array · Hash Table · Union-Find
Last reported Aug 2026
Design a time-based key-value store that records multiple values per key with timestamps and returns the value whose timestamp is the largest <= the queried…
Companies: Amazon, Anthropic, Apple, Citadel +8
Binary Search · Design · Hash Table · String
Last reported Aug 2026
Aggregate points for each distinct number (value * frequency), then choose a subset of values maximizing sum with the constraint that taking value x forbids…
Companies: Walmart, Walmart Labs
Array · Dynamic Programming · Hash Table
Last reported Jul 2026
Design an allocator for n memory units that supports allocating the leftmost contiguous block of a given size and freeing all units with a given…
Companies: Apple, OpenAI, Roblox
Array · Design · Hash Table · Simulation
Last reported Jul 2026
Given timestamped website visits by users, find the 3-website sequence (in chronological order) that is visited by the largest number of unique users (count each…
Companies: Amazon, Spotify
Array · Hash Table · Sorting · String
Last reported Jul 2026
Given an m×n grid of alphanumeric characters and a target pattern string, determine whether the pattern can be formed by a path of adjacent (up/down/left/right)…
Companies: Meta, Roblox
Array · Hash Table · Matrix · String
Last reported Jul 2026
Assign each meeting (with unique start times) to the lowest-numbered available room or delay it (keeping its duration and prioritizing earlier original start times) until…
Companies: Apple, Docusign, Google, Meta +2
Array · Hash Table · Heap (Priority Queue) · Simulation
Last reported Jul 2026
Given nums1 as a subset of nums2, for each element in nums1 return the first greater element that appears to its right in nums2 (or…
Companies: Flipkart, Microsoft
Array · Hash Table · Monotonic Stack · Stack
Last reported Jun 2026
Given a binary grid, count how many distinct island shapes (connected components of 1s via 4-directional adjacency) appear, treating two islands as identical if they…
Companies: Anduril, Oracle, TikTok
Array · Breadth-First Search · Depth-First Search · Hash Function
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
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
Find the length of the shortest transformation sequence from beginWord to endWord where each step changes exactly one letter and every intermediate word must be…
Companies: Amazon, Apple, Fan, Meta +5
Bidirectional Search · Breadth-First Search · Hash Table · String
Last reported May 2026
Check a 9x9 Sudoku board is valid by verifying that no digit 1–9 (ignoring '.') appears more than once in any row, column, or 3x3…
Companies: Amazon, Cisco, Microsoft
Array · Hash Table · Matrix
Last reported May 2026
Maintain an evolving rooted family tree (king as root) that supports adding a child and marking a person dead, and return the current inheritance order…
Companies: Apple, Snowflake
Depth-First Search · Design · Hash Table · Tree
Last reported May 2026
Given a string and an integer K, find the length of the longest substring that contains at most K distinct characters. This is typically solved…
Companies: LinkedIn, TikTok
Hash Table · Sliding Window · String
Last reported Apr 2026
Given lists where each entry names a parent region followed by its immediate subregions and two region names, find their smallest common region — the…
Companies: Airbnb
Array · Binary Lifting · Breadth-First Search · Depth-First Search
Last reported Apr 2026