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,601–3,625
Given a string of events where 'E' means a person enters and 'L' means a person leaves (starting from empty), compute the peak number of…
General practice
Given an even-length binary string, compute the minimum number of bit flips needed so the string can be partitioned into one or more even-length substrings…
General practice
Given prices where buying the (i+1)-th fruit at prices[i] coins grants you up to the next i fruits for free, choose which fruits to purchase…
General practice
Given prices for a collection of fruits and limited coin denominations/change rules, compute the minimum number of coins needed to buy a target set of…
General practice
Given coin values and a target, find the minimum number of extra coins to add so every integer in [1, target] can be formed as…
General practice
Given an m×n binary grid of land (1) and water (0), return the minimum number of single-cell land-to-water removals needed to make the grid "disconnected"…
General practice
Given a small m×n (m,n ≤ 3) binary matrix, find the minimum number of operations that flip a chosen cell and its up/down/left/right neighbors to…
General practice
Given an m×n binary matrix, find the minimum number of cell flips so that either every row or every column becomes palindromic (reads the same…
General practice
Given an m×n binary grid, flip the minimum number of cells so every row and column is palindromic and the total number of 1s is…
General practice
Given a binary string where you can perform any number of cyclic rotations for free and flip individual bits at cost 1, find the minimum…
General practice
Place the minimum number of buckets on '.' positions in a 1D string so that every 'H' has a bucket at index i-1 or i+1…
General practice
Given a string formed by interleaving multiple "croak" sequences, determine the minimum number of frogs that must be croaking concurrently to produce it (or return…
General practice
Given counts of numbered balls, split them into the fewest monochromatic boxes (you may split identical-valued balls across boxes) so that every box contains only…
General practice
Given a target array and allowed to increment any contiguous subarray by 1, find the minimum operations to build it — a greedy/scan problem where…
General practice
Given a binary array and an integer k, compute the minimum number of length-k subarray flips needed to make all elements 1 (or return -1…
General practice
Given frequencies for characters and a fixed number of keys each supporting a limited number of press levels, assign characters to key-press positions to minimize…
General practice
Given a set of 2D points, find the smallest number of straight lines needed so that every point lies on at least one line; the…
General practice
Given a lowercase string s (length ≤ 2000) that can be rearranged into a palindrome, compute the minimum number of adjacent swaps needed to transform…
General practice
Given positions of n seats and n students, minimize the total number of moves (sum of absolute position changes) to assign each student to a…
General practice
Given two 24-hour times current <= correct, find the minimum number of operations to reach correct by repeatedly adding 1, 5, 15, or 60 minutes…
General practice
Companies: Accenture
Array · Hash Table
You may replace either number of any adjacent pair with their gcd; compute the minimum operations to make every element 1 (or return -1 if…
General practice
Given an array where you can replace any element with any integer, compute the minimum replacements to make all elements unique and form a consecutive…
General practice
Given an array where you can repeatedly remove either two or three equal elements, compute the minimum number of such operations to delete all elements…
General practice