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 1,326–1,350
Given m product types and n stores where each store can hold at most one type (but any amount), minimize the maximum number of items…
Companies: Microsoft
Last reported Jan 2020
Design a system to remove duplicate lines from a very large file that cannot be loaded into memory all at once. The solution should efficiently…
Companies: Microsoft
Last reported Jan 2020
Given a non-decreasing sorted array rotated at an unknown pivot (and possibly containing duplicates), determine whether a target value exists in the array. The core…
Companies: Microsoft
Last reported Jan 2020
For each cell in a binary m×n grid, compute the minimum number of orthogonal steps to reach the nearest 0; the core challenge is efficiently…
General practice
Given a binary array where 0 represents a one-bit character and 10/11 represent two-bit characters, determine whether the final 0 (the array is guaranteed to…
General practice
Companies: Tesla
Determine whether the array contains indices i < j < k such that nums[i] < nums[k] < nums[j] (a "132" subsequence). With n up to…
Companies: DoorDash
Array · Binary Search · Monotonic Stack · Ordered Set
Starting from one 'A', find the minimum number of Copy All and Paste operations to reach exactly n 'A's. The core challenge is number-theoretic: the…
General practice
Given four numbers 1–9, determine whether you can permute them and insert binary operators (+, −, *, /) and parentheses to form an expression that…
General practice
Companies: Uber
Given an integer array and a target, find three numbers whose sum is closest to the target (unique solution guaranteed) and return that sum. This…
Companies: Bloomberg
Array · Sorting · Two Pointers
Count the number of index triplets (i<j<k) in an integer array whose sum is strictly less than a given target. The challenge is to do…
General practice
Count the number of index triplets i<j<k with arr[i]+arr[j]+arr[k]==target (answer mod 1e9+7). The challenge is to handle multiplicity efficiently by using value frequencies…
General practice
Given N keystrokes and four operations (type 'A', select-all, copy, paste), compute the maximum number of 'A's you can produce; the core challenge is choosing…
General practice
Find all unique quadruplets of distinct elements in an integer array whose values sum to a given target. Results must avoid duplicates (order irrelevant); with…
Companies: Oracle
Array · Sorting · Two Pointers
Count the number of quadruplets (i,j,k,l) with nums1[i]+nums2[j]+nums3[k]+nums4[l]==0; exploit n ≤ 200 by using pairwise-sum frequencies (e.g., sums of two arrays and matching…
General practice
Determine whether reversing an integer's decimal digits twice returns the original number; because reversal removes leading zeros, this holds exactly when num has no trailing…
General practice
Companies: TikTok
Compute the product of all integers in [left, right] and return its abbreviated form " ...<suf>eC" where C is the count of trailing zeros removed…
General practice
Given multiple lists of candidate IDs/names representing which applicants each interviewer accepted, return the distinct candidates who were accepted by at least two…
General practice