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 2,726–2,750
Companies: Stripe
Given a binary tree and a limit, prune (delete) every node for which every root-to-leaf path passing through it has a sum strictly less than…
General practice
Given n, partition it into at least two positive integers to maximize the product of the parts and return that maximum product. This can be…
General practice
Given a positive integer n, repeatedly apply n/2 if n is even or either n+1 or n−1 if n is odd and return the minimum…
General practice
Convert an integer in the range 1..3999 to its Roman numeral representation by greedily decomposing the number using value-to-symbol mappings and handling the allowed…
General practice
Check whether s3 can be formed by merging s1 and s2 while preserving the relative order of characters from each string (their lengths must sum…
General practice
Return the ascending list of integers that appear in every subarray of a given list of integer arrays — i.e., compute the intersection across all…
General practice
Given three sorted integer arrays, return all values that appear in all three arrays. Arrays may contain duplicates; the result should list the unique common…
General practice
Return the distinct integers that appear in both input arrays (order does not matter). The core challenge is deduplicating and computing the set/hash-based intersection of…
General practice
Return the intersection of two integer arrays including duplicates — each value should appear min(count in nums1, count in nums2) times and order doesn’t matter…
General practice
Implement cancellable(fn, args, t) to invoke fn immediately with the given args and then repeatedly every t milliseconds, returning a cancel function that, when called…
General practice
For each array index, compute the sum of absolute differences between its index and the indices of all other elements with the same value. With…
General practice
Given a Tweets table, return the tweet_id(s) of tweets whose content length is strictly greater than 15 characters. The order of results does not matter.
General practice
Given an array of tweet strings and a set of validation rules (e.g., length limits, allowed characters/words, duplicate or disallowed mentions/hashtags), identify which tweets…
General practice
Given the 1-indexed array numWays[i] of how many ways to make amount i with an unlimited supply of unknown positive coin denominations (each ≤ n)…
General practice
Given an object mapping keys to values, return a new object with keys and values swapped. If multiple original keys share the same value, aggregate…
General practice
Return the total tiv_2016 (rounded to two decimals) for policy records whose tiv_2015 value appears more than once among policies and whose (lat, lon) pair…
General practice
Given initial capital and n projects each with a required capital and profit, pick up to k distinct projects to maximize your final capital; the…
General practice
Given an array of node values (and possibly null markers), determine whether it can represent the preorder traversal of some binary tree. The core challenge…
General practice
Given a parsed JSON value that is either an object or an array, determine whether it is empty (an object with no own keys or…
General practice
Determine whether there exists a consistent one-to-one character mapping from s to t that transforms s into t (i.e., each character in s always maps…
Companies: Meta
Hash Table · String