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,226–3,250
Given an uppercase string s, you may insert at most one uppercase letter anywhere — determine the maximum number of subsequences equal to "LCT" that…
General practice
Given tasks with strength requirements and workers with strengths (each worker can get at most one +strength pill, with only p pills available), find the…
General practice
Given a list of servers each with an upgrade cost and a limited budget (or limited upgrade tokens), determine the maximum number of servers you…
General practice
Convert each point to its polar angle around your location (counting points at the exact location separately), sort these angles and handle the circular wrap…
Companies: Anduril
Array · Geometry · Math · Sliding Window
Given string s and integer k, return the maximum number of vowels ('a','e','i','o','u') contained in any contiguous substring of length k. The core challenge is…
General practice
Given nums and a value k, find the maximum number of pivot indices (1 ≤ pivot < n) where the sum of elements left of…
General practice
Given milestone counts for projects and the rule you must do exactly one milestone per week without working the same project in consecutive weeks, compute…
General practice
Given an array of sentences where words are separated by single spaces, compute the number of words in each sentence and return the maximum count…
General practice
Given a space-separated string and a set of broken letter keys, count how many words contain none of the broken letters. Essentially, for each word…
General practice
Given an array of nonnegative integers and an upper bound, find the largest integer k (within the allowed range) such that k & num ==…
General practice
Given k and x, define price(num) as the count of 1-bits in num at bit positions x, 2x, 3x, ... (LSB = position 1); the…
General practice
Rearrange the bits of a binary string (which contains at least one '1') to form the largest possible odd binary number; since oddness requires the…
General practice
Given two equal-length arrays, compute the maximum value of |arr1[i]-arr1[j]| + |arr2[i]-arr2[j]| + |i-j| over all pairs (i,j) by observing the expression reduces to a…
General practice
Given an array, compute for every window size k (1..n) the maximum value among the minimums of all contiguous subarrays of length k. The efficient…
General practice
Given that you can swap any characters between any positions in the array, redistribute the global multiset of letters to maximize how many words can…
General practice
Companies: Gameskraft, Google
Array · Binary Search · Breadth-First Search · Depth-First Search
Companies: Google, Microsoft
Array · Dynamic Programming · Matrix
Choose up to k engineers to maximize (sum of chosen speeds) * (minimum efficiency among them). Greedy solution: iterate engineers by descending efficiency while maintaining…
General practice
Given a rooted tree with coin values, decide for each node whether to collect coins as coins[i]-k or as floor(coins[i]/2), where choosing the latter also…
General practice
Given enemy energy costs and an initial energy, maximize points by repeatedly either spending energy to defeat an unmarked enemy (gain a point) or spending…
General practice
Given 12 scoring zones and a limited number of arrows, choose which zones to strictly outshoot Alice in (each zone i requires aliceArrows[i]+1 arrows) to…
General practice
Choose an axis-aligned square centered at the origin to maximize the number of points inside it with all tags distinct. Because a square includes exactly…
General practice
Choose a starting city and sequence of k daily actions (stay to earn stayScore[day][city] or move to any other city to earn travelScore[from][to]) to maximize…
General practice