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 4,751–4,775
Given a BST and bounds [low, high], remove all nodes with values outside the interval while preserving the relative parent–child structure of remaining nodes; exploit…
General practice
Determine whether the array can be partitioned at indices 0 < p < q < n-1 into three contiguous segments that are strictly increasing, then…
General practice
Find the maximum-sum contiguous subarray that can be partitioned (at two interior pivots) into three strict monotone runs: strictly increasing, then strictly decreasing, then…
General practice
Count the number of ordered triples (i, j, k) such that nums[i] & nums[j] & nums[k] == 0. With nums.length up to 1000 and values…
General practice
Return the substring containing the first k words from a space-separated sentence s. This is a simple string-parsing/truncation task (words are separated by single spaces…
General practice
Count the number of ordered 4-tuples (a,b,c,d) of distinct elements from nums such that a*b = c*d by grouping all element-pairs by their product and…
General practice
Count the number of unique paths from (0,0) to (m-1,n-1) on an m×n binary grid where moves are only right or down, but attempting to…
General practice
Companies: Palantir
Assign 2n people to two cities so exactly n go to each city and the total travel cost is minimized. The core challenge is selecting…
General practice
Given an array of house colors, return the maximum absolute index distance |i - j| between two houses with different colors. Essentially, find the farthest…
General practice
Return a list of distinct integers that appear in at least two of the three input arrays (order doesn't matter). Array lengths and values are…
General practice
Given two binary search trees and a target integer, determine whether there exists one node from each tree whose values sum to the target. Leverage…
General practice
Design a data structure that supports adding integers and checking whether any two previously added numbers sum to a given target, handling duplicates correctly and…
General practice
Given the root of a binary search tree and an integer k, determine whether there exist two distinct nodes whose values sum to k, leveraging…
General practice
Given an array of integers and an integer K, find the largest sum of any two distinct elements that is strictly less than K (return…
General practice
Given a list of two-letter cards and a target letter x, repeatedly remove disjoint pairs of cards that both contain x and differ in exactly…
General practice
Given three side lengths, determine whether they satisfy the triangle inequality (sum of any two sides > the third) and, if so, classify the triangle…
General practice
Companies: Stripe
Companies: Tesla
Companies: Roblox
Determine whether an integer n is an "ugly number" — a positive integer whose only prime factors are 2, 3, and 5 (return false for…
General practice