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
Design an in-memory hierarchical file system that supports path parsing and operations like mkdir, ls, addContentToFile (append/create), and readContentFromFile, requiring you…
Companies: Anchorage Digital, Capital One, Coupang, Datadog +5
Design · Hash Table · Sorting · String
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
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
Evaluate a valid arithmetic expression string containing non-negative integers and the operators +, -, *, / (with spaces allowed), where division truncates toward zero. The…
Companies: Anduril, Flex, Meta, Snap +1
Math · Stack · String
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
Find the length of the longest contiguous substring that contains no repeated characters. This is a classic sliding-window / two-pointer problem where you track seen…
Companies: Amazon, Apple, Autodesk, Bloomberg +12
Hash Table · Sliding Window · String
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
Given a string s and integer k, repeatedly remove any run of k equal adjacent characters until no more removals are possible and return the…
Companies: Amazon, Apple, Meta, Oracle +2
Stack · String
Last reported Sep 2026
Determine whether the string s can be segmented into a sequence of one or more words from wordDict (words may be reused). The core challenge…
Companies: Amazon, Google, Grammarly, Meta +3
Array · Brute-Force Search · Dynamic Programming · Hash Table
Last reported Sep 2026
Return the index of the first character in s that occurs exactly once (or -1 if none). This is typically solved by counting character frequencies…
Companies: Apple, Goldman Sachs
Counting · Hash Table · Queue · String
Last reported Sep 2026
Given an absolute Unix-style path, produce its canonical simplified form by collapsing multiple slashes and resolving "." (current dir) and ".." (parent dir) references. This…
Companies: Meta, NVIDIA, Roblox, Snowflake
Stack · String
Last reported Sep 2026
For each string in an array, find the shortest substring that does not occur in any other string (choose the lexicographically smallest one among ties)…
Companies: Airbnb
Array · Hash Table · String · Trie
Last reported Sep 2026
Find the smallest substring of s that contains all characters of t (including duplicates), or return "" if none exists. This is typically solved with…
Companies: Amazon, LinkedIn, Lyft, Meta +2
Hash Table · Sliding Window · String
Last reported Sep 2026
Design a spreadsheet supporting set/get and sum operations where sum formulas can reference individual cells and rectangular ranges; the core challenge is maintaining a…
Companies: Airbnb, Discord
Array · Design · Graph Theory · Hash Table
Last reported Sep 2026
Design a Spreadsheet class with 26 columns and a specified number of rows that supports setCell and resetCell operations and stores integer values (unset cells…
Companies: Citadel, Discord
Array · Design · Hash Table · Matrix
Last reported Sep 2026
Given pairwise variable ratios, build a weighted graph (or use union-find with multiplicative weights) where edges represent divisions, and answer each query by finding a…
Companies: Amazon, Bloomberg
Array · Bellman–Ford Algorithm · Breadth-First Search · Depth-First Search
Last reported Sep 2026
Convert a fraction to its decimal string form, enclosing any repeating fractional cycle in parentheses. The core challenge is simulating long division while handling sign…
Companies: Goldman Sachs, Meta
Hash Table · Math · String
Last reported Sep 2026
Count the number of contiguous substrings of s that are palindromes. With |s| up to 1000, the core challenge is to enumerate/detect all palindromic centers…
Companies: Goldman Sachs, Meta, Microsoft
Dynamic Programming · String · Two Pointers
Last reported Sep 2026
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
Given a sorted list of words in an unknown alphabet, infer the relative ordering of characters by deriving precedence constraints between first differing letters, then…
Companies: Amazon, Bloomberg, Google, Intuit +3
Array · Breadth-First Search · Depth-First Search · Directed Acyclic Graph
Last reported Aug 2026
Given a start IPv4 address and a number of consecutive addresses, produce the minimal list of CIDR blocks that exactly cover that range. The key…
Companies: Databricks
Bit Manipulation · String
Last reported Aug 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