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,576–3,600
Find the minimum number of jumps to reach x using jumps of +a or -b while avoiding forbidden positions and disallowing two consecutive backward jumps…
General practice
Companies: Google
Array · Binary Search
Given a string s known to be a concatenation of anagrams of some string t, find the smallest block length L (which must divide |s|)…
General practice
Given a string of 'a', 'b', and 'c', repeatedly delete a non-empty prefix and non-empty suffix that are runs of the same character and equal…
General practice
Given a string s, you may repeatedly pick an index i whose character appears at least once both to its left and to its right…
General practice
Given a binary array where playing a level gives +1 for 1 and -1 for 0, find the minimum number of initial levels Alice must…
General practice
Given bags with ball counts and a limit on splitting operations, minimize the maximum balls in any bag after at most maxOperations splits. This is…
General practice
Given points (day, price), find the minimum number of straight line segments needed to draw the polyline connecting points in increasing day order — equivalently…
General practice
Find the minimum starting money that guarantees you can complete all given transactions (cost, cashback) no matter the order they're performed; the core challenge is…
General practice
Companies: Bloomberg
Array · Greedy · Sorting
Given positions of a white rook, a white bishop, and a stationary black queen on an 8x8 chessboard, compute the minimum number of moves (moving…
General practice
Find the minimum moves to collect all 'L' cells in a grid where each step costs 1 energy, obstacles block movement, and landing on 'R'…
General practice
Given a string of 'X' and 'O', compute the minimum number of operations (each converts any chosen length-3 contiguous substring to 'O') needed to turn…
General practice
Given an n×n board with some occupied cells, compute the minimum number of single-piece moves needed to rearrange pieces so the board becomes "peaceful" (no…
General practice
Given an even-length array nums and a limit, you may replace any element with a value in [1, limit]; find the minimum number of single-element…
General practice
Choose any start index and, using at most maxChanges zero→one flips (each counting as a move) and adjacent swaps of 1s toward your position (each…
General practice
Given start (sx,sy) and target (tx,ty) on an infinite grid where each move adds m = max(x,y) to either x or y, determine the minimum…
General practice
Starting from 1, find the minimum number of moves to reach target using unlimited +1 operations and at most maxDoubles doublings; the core challenge is…
General practice
Find the minimum number of moves to slide a 2-cell snake from the top-left to the bottom-right of an n×n obstacle grid using right/down moves…
General practice
Given a 3x3 grid containing nine stones (possibly stacked), compute the minimum number of adjacent side moves needed to reach a configuration with exactly one…
General practice
Given p, you may swap corresponding bits between any pair of numbers in the set {1,...,2^p-1}; compute the minimum possible non-zero product of the array…
General practice
Given an even-length array, repeatedly remove the two smallest remaining elements each round and append them to the result with the second-smallest first (i.e., for…
General practice