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 51–75
Arrange the characters of a string into a zigzag pattern across numRows and then read the rows sequentially to produce the converted string. The core…
Companies: Amazon, Bloomberg, Google, Oracle +1
String
Last reported Mar 2026
Convert a non-negative integer to its English words representation. The core challenge is chunking the number into three-digit groups (ones, thousands, millions, billions)…
Companies: Amazon, Microsoft
Math · Recursion · String
Last reported Mar 2026
Check whether any substring of s2 of length |s1| is a permutation of s1 (i.e., has the same character multiset). The core challenge is to…
Companies: Apple, Meta
Hash Table · Sliding Window · String · Two Pointers
Last reported Mar 2026
Given recipes whose ingredients may include other recipes and an initial set of supplies, determine which recipes can be produced; the core challenge is dependency…
Companies: Amazon, Google, Tesla
Array · Directed Acyclic Graph · Graph Theory · Hash Table
Last reported Feb 2026
Given strings s and p, return all start indices of substrings in s that are anagrams of p; the core challenge is to detect equal…
Companies: Amazon, Databricks, Microsoft
Hash Table · Sliding Window · String
Last reported Feb 2026
Given a valid parentheses string, compute its maximum nesting depth — the largest number of parentheses that are open at the same time. (Equivalent to…
Companies: Meta, Rippling
Bracket Sequences · Stack · String
Last reported Feb 2026
Given a numeric string n (up to 18 digits), find the closest integer palindrome different from n (ties broken by smaller value). The typical approach…
Companies: Meta, Uber
Math · String
Last reported Jan 2026
Compress an array of characters in-place by replacing each run of consecutive identical characters with the character followed by its run length (omit the length…
Companies: Apple, Goldman Sachs, Morgan Stanley, Pinterest +1
String · Two Pointers
Last reported Jan 2026
Given a digit string and a target value, insert the binary operators +, -, and * between digits (without creating operands with leading zeros) to…
Companies: LinkedIn, Meta, Pinterest
Backtracking · Math · String
Last reported Jan 2026
Given a list of words and two distinct target words, find the minimum absolute index distance between any occurrence of the two targets. This is…
Companies: LinkedIn, Snowflake
Array · String
Last reported Dec 2025
Given a string of '(' and ')', return the minimum number of parentheses insertions needed to make the string valid. This is solved greedily by…
Companies: Meta, Microsoft
Bracket Sequences · Greedy · Stack · String
Last reported Dec 2025
Find the length of the longest substring that can be turned into all the same letter by performing at most k character replacements; this is…
Companies: D. E. Shaw, Goldman Sachs, Meta, Microsoft +1
Hash Table · Sliding Window · String
Last reported Oct 2025
Multiply two non-negative integer strings without converting them to numeric types or using BigInteger: compute the product by simulating grade-school digit-by-digit…
Companies: Meta, Microsoft, Pinterest
Math · Simulation · String
Last reported Sep 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
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
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
Rearrange the characters of a string so that no two adjacent characters are the same, returning any valid permutation or "" if none exists. Key…
Companies: Amazon, D. E. Shaw, Tesla
Counting · Greedy · Hash Table · Heap (Priority Queue)
Last reported Jan 2025
Given a string and allowed index swap pairs, view pairs as edges in a graph to find connected components where characters can be freely permuted…
Companies: Goldman Sachs, Google
Array · Breadth-First Search · Depth-First Search · Hash Table
Last reported Oct 2024
Add two binary strings and return their sum as a binary string by performing digit-wise addition from the least significant bit with carry, handling unequal…
Companies: Meta
Bit Manipulation · Math · Simulation · String
Convert each target letter to its board coordinates and output a shortest sequence of moves (U/D/L/R) plus '!' to spell the string by walking between…
Companies: Atlassian
Hash Table · String
Given a string with brace-enclosed comma-separated option groups and implicit concatenation (e.g., "{a,b}c{d,e}"), generate all unique strings formed by choosing one option…
Companies: Anduril
Backtracking · Breadth-First Search · Sorting · Stack
Count the non-empty substrings of a binary string that contain an equal number of 0s and 1s with all 0s and all 1s each grouped…
Companies: D. E. Shaw
String · Two Pointers
Count the number of contiguous substrings that consist only of vowels and contain all five vowels (a, e, i, o, u) at least once. The…
Companies: D. E. Shaw, Expedia, Salesforce, Snowflake
Hash Table · String
Count the number of distinct subsequences of s that equal t — i.e., the number of ways to delete characters from s (keeping relative order)…
Companies: Swiggy
Dynamic Programming · String
Implement an Encrypter that maps each character to a two-letter code and supports encrypting by replacing characters and decrypting by counting how many dictionary words…
Companies: Duolingo
Array · Design · Hash Table · String