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,651–3,675
Find the minimum number of cells visited to reach bottom-right in an m×n grid when from (i,j) you can jump right to any (i,k) with…
General practice
Partition a set of up to 14 tasks into the fewest "sessions" (bins) of capacity sessionTime such that each task is wholly contained in one…
General practice
Starting from zeros, you may increment any single element by 1 or double all elements; find the minimum calls to reach the target array. Key…
General practice
Given an integer n, find the minimum number of bit-flip operations to reduce n to 0 where you can flip the 0th bit anytime, but…
General practice
Given an array where each operation pops the last element into your collection, return the minimum number of pops required so the collected set contains…
General practice
Given a nonnegative integer array, each operation picks a contiguous subarray and sets all occurrences of the minimum value in that subarray to 0; compute…
General practice
Given start and a set of numbers, find the minimum number of +, -, or bitwise-XOR operations (using any nums[i] repeatedly) to reach goal; because…
General practice
Given an array where one operation selects a contiguous subarray and replaces every element with the bitwise AND of that subarray, compute the minimum number…
General practice
Given a binary string s and an integer k, each operation flips exactly k distinct bits; find the minimum operations to make all characters '1'…
General practice
Given an array nums and threshold k, repeatedly remove the current smallest element until every remaining value is >= k; return the minimum number of…
General practice
Repeatedly take the two smallest elements x and y and replace them with (2*min(x,y) + max(x,y)); return the minimum number of such greedy merges needed…
General practice
Given an array of powers of two where you can replace any 2^k with two 2^(k-1) at cost 1 (the halves are appended to the…
General practice
Given an array of positive integers where an operation halves any chosen element, find the minimum number of operations to reduce the total sum by…
Companies: Nutanix
Array · Greedy · Heap (Priority Queue)
Companies: Google
Enumeration · Math · String
Given a string representing a nonnegative integer, remove the fewest digits so the resulting number is divisible by 25. Observe only the suffixes "00", "25"…
General practice
Reduce arr to the sequence of positions of its elements in target (ignoring elements not in target); the problem then becomes finding the longest strictly…
General practice
Check whether every grid value is congruent modulo x (otherwise return -1); if they are, treat the flattened values and minimize total |delta| by choosing…
General practice
For each query value q, compute the minimum number of +/-1 operations to make all elements of nums equal to q, which equals the sum…
General practice
For each query [l,r], you must reduce every integer in nums = [l..r] to zero by repeatedly picking two elements and replacing them with floor(a/4)…
General practice