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–19
Place n queens on an n×n chessboard so no two queens share a row, column, or diagonal, and return all distinct board configurations. This is…
Companies: Microsoft, Netapp
Algorithm X · Array · Backtracking
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
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
Return the power set of a unique-element integer array by enumerating all 2^n subsets (typical solutions use backtracking/DFS or bitmask iteration), noting the exponential…
Companies: Amazon, Docusign, Meta, Microsoft
Array · Backtracking · Bit Manipulation
Last reported Jun 2026
Control a robot with only move/turn/clean APIs to traverse and clean every reachable cell in an unknown grid with obstacles and no global map. The…
Companies: Google, LinkedIn, Meta, Waymo
Backtracking · Interactive
Last reported Jun 2026
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
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 all root-to-leaf paths in a binary tree whose node values sum to targetSum, returning each path as a list of values. This is solved…
Companies: Amazon, Meta, Microsoft, Salesforce
Backtracking · Binary Tree · Depth-First Search · Tree
Last reported May 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 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
Count how many ways to assign +/− to each element of nums so the signed sum equals target. This reduces to a subset-sum problem: count…
Companies: Meta, Pinterest
0-1 Knapsack · Array · Backtracking · Dynamic Programming
Last reported Nov 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
Find the maximum sum of unique node values collectible by any walk that starts and ends at node 0 within a given time budget on…
Companies: Amazon, Nutanix
Array · Backtracking · Graph Theory
Last reported Nov 2024
Count the permutations of 1..n such that for every position i, either perm[i] is divisible by i or i is divisible by perm[i]. With n…
Companies: Rippling
Array · Backtracking · Bit Manipulation · Bitmask
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
Partition the input string s into substrings so that every substring is a palindrome, and return all possible such partitions. This is typically solved by…
Companies: Salesforce
Backtracking · Dynamic Programming · String
Find all integers in a given inclusive range whose adjacent digits differ by exactly 1 (stepping numbers), including single-digit and zero cases. Because the range…
Companies: eBay
Backtracking · Breadth-First Search · Math