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 3,626–3,650
Given an array and integer k, determine the minimum number of single-bit flips (you may flip any bit of any element, including leading zeros) required…
General practice
Given two equal-length arrays where an operation adds 2 to one element and subtracts 2 from another, find the minimum operations to make their multisets…
General practice
You are given an array and can repeatedly remove the first three elements (or all remaining if fewer than three); return the minimum number of…
General practice
Compute how many distinct permutations of the multiset of characters in s are lexicographically smaller than s (equivalently the number of previous-permutation steps to reach…
General practice
Partition the string into n/k contiguous blocks of length k; each operation copies one block over another, so the problem reduces to making all blocks…
General practice
Find the minimum number of steps to transform integer x into y using operations ±1 or dividing by 5 or 11 when divisible; this is…
General practice
Given a binary string where '1' marks a ball in a box, compute for each index the minimum total number of adjacent moves required to…
General practice
Given an even n and a fixed reindexing operation on perm, find the minimum positive number of times to apply it to restore the identity…
General practice
Pick a single value for each column (so every column is constant) such that adjacent columns have different values, minimizing the total number of cell…
General practice
Given a binary tree with unique values, compute the minimum number of value-swaps between nodes on the same level required to make every level strictly…
General practice
Given users with known languages and friendship edges, choose one language to teach to some users so that every friendship pair shares at least one…
General practice
Given a target integer, find the minimum number of prime numbers (repetition allowed) whose sum equals the target. The challenge combines prime testing and number‑theory…
General practice
Assign distinct letters to 8 telephone keys to minimize total pushes, where the i-th letter on a key costs i pushes. This is a greedy…
General practice
Assign each distinct letter in the word to a press-count position (typing a letter costs its position index on the key) subject to at most…
General practice
Given a target distance, initial fuel, and stations at positions with fuel amounts, determine the minimum number of refueling stops needed to reach the target…
Companies: D. E. Shaw, Uber, Waymo
Array · Dynamic Programming · Greedy · Heap (Priority Queue)
Find the minimum removals by keeping the longest strict bitonic subsequence (strictly increasing then strictly decreasing with the peak not at an endpoint). Compute for…
General practice
Given a mountain height H and workers where assigning x units to worker i costs workerTimes[i] * x*(x+1)/2 seconds, allocate integer reductions summing to H…
General practice
Given two equal-length lowercase strings s and t, compute the minimum number of single-character replacements in t needed to make it an anagram of s…
General practice
Given two lowercase strings, find the minimum number of single-character append operations to make them anagrams — this reduces to computing character frequencies and summing…
General practice
Determine whether the counts of 0s and 1s allow an alternating arrangement (they can differ by at most 1), and if so compute the minimum…
General practice
Given an even-length string with equal numbers of '[' and ']', compute the minimum number of swaps of any two characters needed to transform it…
General practice
Given n and ranges for taps at positions 0..n (each tap i covers [i - ranges[i], i + ranges[i]]), find the minimum number of taps…
General practice
Given words and a target, find the minimum number of segments needed to partition target so each segment is a prefix of some word in…
General practice
Given a directed acyclic graph, find the smallest set of starting vertices from which every node is reachable. In a DAG this is uniquely achieved…
Companies: Anduril
Directed Acyclic Graph · Graph Theory