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,551–3,575
Given a binary tree that encodes a boolean expression (leaves are 0/1 and internal nodes are AND/OR gates, with some gates allowed to be changed)…
General practice
Find the minimum number of single-bit flips in a and b required so that (a | b) == c. Each bit is independent: if c's…
General practice
Given apples at each integer point (i, j) equal to |i|+|j|, find the smallest axis-aligned square centered at the origin whose contained lattice points sum…
General practice
Given 8-char gene strings and a bank of allowed genes, find the minimum number of single-character mutations to transform startGene into endGene by moving only…
General practice
Given an undirected tree, return all node labels that, when chosen as root, yield the minimum possible tree height. This is equivalent to finding the…
General practice
Determine the minimum number of +1 training hours to energy and experience so you can beat a sequence of opponents who require strictly greater energy…
General practice
Find the smallest positive integer x that cannot be formed as the bitwise OR of any subsequence of nums. The key challenge is reasoning about…
General practice
Partition an array of up to 16 numbers into k equal-size subsets with no duplicate within any subset, minimizing the sum of each subset's incompatibility…
General practice
Companies: LinkedIn
Array · Dynamic Programming · Greedy · Prefix Sum
Make the minimum total +1 increments so every subarray of length ≥3 has max ≥ k — equivalently, choose indices to raise to at least…
General practice
Given an integer array, compute the minimum number of +1 moves needed to make all elements distinct — a problem typically solved by sorting (or…
General practice
Given nums and a small set of targets (<=4), compute the minimum total +1 increments to transform some elements of nums so that each target…
General practice
Given a rooted tree with node traversal costs, you may increase the cost of any nodes by arbitrary non-negative amounts so that all root-to-leaf path…
General practice
Given an array that has a guaranteed global dominant element, find the smallest split index i (0 <= i < n-1) such that the same…
General practice
Given two lists of strings, find all strings that appear in both lists whose sum of indices (index in list1 + index in list2) is…
General practice
Given two lists of unique strings, find all strings that appear in both lists whose sum of indices (i + j) is minimal, returning all…
General practice
Given tasks specified by (actual, minimum) energy where you must have at least minimum energy to start a task and then lose actual energy, find…
General practice
Given a string s, compute the minimum number of character insertions anywhere to make it a palindrome. Key insight: this equals |s| minus the length…
General practice
For each query, return the length of the smallest interval [left, right] that contains the query (right - left + 1), or -1 if none…
General practice
Find the minimum jumps from index 0 to n-1 in an array where you can move to adjacent indices or, if nums[i] is a prime…
General practice