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
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
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
Given a string s, return the longest substring that reads the same forwards and backwards. The core challenge is efficiently finding palindromic spans around centers…
Companies: Adobe, Amazon, Bloomberg, Goldman Sachs +6
Dynamic Programming · Manacher · String · Two Pointers
Last reported Aug 2026
Given a source and target string, return the minimum number of subsequences of source that need to be concatenated to form target (or -1 if…
Companies: Pinterest
Binary Search · Greedy · String · Two Pointers
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
Check whether a string of parentheses/brackets is valid by ensuring every closing bracket matches the most recent unmatched opening bracket and the types and nesting…
Companies: Amazon, Apple, Bloomberg, Google +9
Bracket Sequences · Stack · String
Last reported Aug 2026
Determine whether a target word can be formed by a path of horizontally or vertically adjacent cells in an m×n letter grid without reusing a…
Companies: Amazon, Glean, Google, Grammarly +3
Array · Backtracking · Depth-First Search · Matrix
Last reported Jul 2026
Determine whether a string containing '(', ')', and '*' (where '*' can represent '(', ')', or empty) can be assigned so the parentheses are balanced…
Companies: Apple, Microsoft, Oracle
Bracket Sequences · Dynamic Programming · Greedy · Stack
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
Given a binary string where every second all occurrences of "01" simultaneously become "10", determine how many seconds until no "01" remains; the core challenge…
Companies: Salesforce
Dynamic Programming · Simulation · String
Last reported Jun 2026
Return the longest prefix string common to all strings in the array, or an empty string if none exists. The task reduces to comparing characters…
Companies: Amazon, Apple, Bloomberg, Google +3
Array · String · Trie
Last reported Jun 2026
Given an expression "num1+num2", insert a '(' somewhere to the left of '+' and a ')' to the right to minimize the evaluated result —…
Companies: eBay, Meta
Enumeration · String
Last reported Jun 2026
Check whether a string becomes a palindrome after lowercasing and removing all non-alphanumeric characters. The typical challenge is to do this efficiently (O(n)) by scanning…
Companies: Apple, Bloomberg, Meta
String · Two Pointers
Last reported Jun 2026
Given an m×n letter grid and a list of words, find all words that can be formed by sequentially adjacent (horizontal/vertical) non-repeating cells. The core…
Companies: Amazon, Bloomberg, Glean, Google +2
Array · Backtracking · Matrix · String
Last reported Jun 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
Evaluate a string arithmetic expression containing integers, +, -, *, /, parentheses and unary signs, respecting operator precedence and parentheses. The challenge is to parse…
Companies: Google, Intuit, Meta
Math · Recursion · Stack · String
Last reported May 2026
Design an online autocomplete system that processes characters one-by-one, returning the top 3 historically most frequent sentences that match the current prefix (ranked by…
Companies: Google, Netflix, Pinterest, Vercel
Data Stream · Depth-First Search · Design · Heap (Priority Queue)
Last reported May 2026
Given a digit string, count how many ways it can be segmented into valid codes 1–26 (two-digit codes cannot start with '0'), handling invalid zeros…
Companies: Anduril, Lyft, Meta
Dynamic Programming · String
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 a number n, generate all distinct well-formed parentheses strings formed from n pairs of opening and closing brackets. Return all valid combinations as a…
Companies: Amazon, Bloomberg, Microsoft, Salesforce
Backtracking · Bracket Sequences · Dynamic Programming · 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
Find the length of the longest well-formed (balanced) parentheses substring in a string of '(' and ')', handling nested and adjacent valid segments; this typically…
Companies: Amazon, Meta, Microsoft, Uber
Bracket Sequences · Dynamic Programming · Stack · String
Last reported Apr 2026
Design algorithms to serialize an N-ary tree into a single string and deserialize it back, preserving node values and the arbitrary number and order of…
Companies: Apple, Bloomberg, Rubrik, TikTok
Breadth-First Search · Depth-First Search · String · Tree
Last reported Mar 2026