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,726–3,750
Partition 4n tasks into n groups of four and assign each group to a processor so as to minimize the makespan, where a processor's completion…
General practice
Given a string of 'W'/'B' blocks and an integer k, compute the minimum number of white blocks you must recolor so some contiguous substring of…
General practice
Given points (x,y) and rectangles that are vertical strips starting at y=0 with x-width at most w, find the minimum number of such strips needed…
General practice
Given a sequence of chocolate prices, determine the smallest possible relative loss (loss as a fraction of the buy price) you can guarantee by optimally…
General practice
Given nums and k, remove the fewest elements so the remaining array has max ≤ k * min. Equivalently, find the largest subset of numbers…
Companies: Salesforce
Array · Binary Search · Sliding Window · Sorting
Given an integer array where you may replace any element with two positive integers summing to it, find the minimum number of such split operations…
Companies: Salesforce
Array · Greedy · Math
Given an array of length n with a single 1 at p and some banned positions, compute for each index the minimum number of fixed-size…
General practice
Check whether the array is a cyclic rotation of its ascending-sorted order; if so, return the minimum number of right circular shifts required to restore…
General practice
Partition tasks by difficulty and for each frequency determine the minimum number of rounds (each round completes exactly 2 or 3 tasks of the same…
General practice
Given a multiset of available runes and a target spell (both strings), determine the minimum extra runes (characters and counts) you must add so the…
General practice
Given a tree with integer node values, remove two edges to split it into three components and minimize the difference between the largest and smallest…
General practice
Given an integer array where you may replace any two elements arbitrarily, minimize the sum of the maximum and minimum pairwise absolute differences (which, since…
General practice
Given a convex n-gon with integer values at vertices, find a triangulation that minimizes the sum of triangle weights where each triangle's weight is the…
General practice
Place sensors that each cover a square of side length 2k+1 under Chebyshev distance; the task is to minimize sensors to cover an n×m grid…
General practice
Given a 3-lane road with obstacles (at most one per position) and a frog starting at lane 2 point 0, find the minimum number of…
General practice
Given a finite array repeated infinitely, find the length of the shortest contiguous subarray in that infinite periodic array whose sum equals target (or return…
General practice
Given road lengths and a speed where after each road you must wait until the next integer hour (unless you skip the wait), find the…
General practice
Choose one supplier whose infinite-supply box sizes must each be at least as large as the package they hold, and minimize the total wasted space…
General practice
Find the minimum positive integer speed such that, when intermediate trains can only depart at integer hours (so each of the first n-1 rides contributes…
General practice
Partition an integer array into the minimum number of contiguous subarrays such that each subarray's GCD is greater than 1 (i.e., all elements in a…
General practice
Given an array nums and an allowance of at most maxC arbitrary element replacements, a subarray is "stable" if its gcd (HCF) ≥ 2; compute…
General practice