Subarray Interview Questions
11 interview questions in our bank cover Subarray, most of them Coding Questions. They average 2.9/5 difficulty — medium — and each one was reported by a candidate after a real interview. Companies known to ask about Subarray: Uber, Google, Roblox, The Trade Desk, D. E. Shaw, and 4 more.
Practice these on the problems board →Companies that ask about Subarray
Question mix
- Coding Questions11
Difficulty
- 2/5 — easy1
- 3/5 — medium10
Subarray questions at Uber
Find Maximum Length
3/5Find the largest window length for which every window of that length sums to less than a threshold. This Uber question inverts the usual sliding-window objective: you are not looking for one qualifying window but for a length at which no window fails. You will exploit the fact that the property is monotone in the length, use prefix sums to test a candidate length quickly, and handle the case where even a single element exceeds the threshold. The full problem and the reference solution require a subscription.
Coding QuestionsUberCount the Number of Good Subarrays
3/5Count the contiguous stretches of an array that contain at least a required number of equal-value pairs. This Uber question is a sliding window with a monotone property worth stating out loud: once a window qualifies, every longer window starting at the same place also qualifies, so each left edge contributes a run of answers at once. You will maintain pair counts incrementally as values enter and leave, and keep the arithmetic within range for large inputs. Subscribers get the complete problem and the model solution.
Coding QuestionsUber
Subarray questions at Google
Maximum Contiguous Subarray Sum
3/5A coding question on scanning a list of positive and negative integers to find the run of adjacent values with the largest total. The learner returns that total and the run's start and end positions, following a stated rule for ties.
Coding QuestionsGoogleMaximum Subarray Endpoint Score
3/5A coding question on scoring contiguous ranges of an integer list by rewarding the two end values and penalizing the values between them. It asks for the best achievable score, its location with a defined tie rule, and a strict linear-time, constant-space budget.
Coding QuestionsGoogle
More Subarray questions
Interval Counting
3/5Count the contiguous stretches of an array whose elements add up to exactly a target value, with negative numbers allowed. This Roblox question is the prefix-sum-and-hash-map pattern, and the presence of negatives is what rules out the sliding window that would otherwise work. You will count prefix sums as you go, look up the complement rather than searching, and remember to seed the map so that a prefix matching the target is counted. The complete problem and the reference solution are available with a subscription.
Coding QuestionsRobloxTally the Number of Friend Groups with K Sets of Matching Traits
3/5Examine an advanced subarray analysis puzzle reported during technical evaluations at The Trade Desk, designed to test your algorithmic efficiency with contiguous segments. The objective involves scanning a collection to identify subsegments containing a minimum threshold of matching element pairs, requiring optimized sliding window or prefix calculation techniques. This task evaluates your proficiency in maintaining state dynamically over sequential data structures. Access the complete problem specifications and expert implementation through our paid subscription.
Coding QuestionsThe Trade DeskSubarray Removal
3/5Test your algorithmic thinking with this intriguing subarray elimination puzzle featured in D. E. Shaw recruitment rounds. The problem challenges you to determine how many different contiguous segments can be dropped from a sequence so that the remaining elements form a strictly increasing order. This task examines your capability to optimize linear scans and manage range boundaries effectively. To view the complete problem instructions and comprehensive model solution, please subscribe.
Coding QuestionsD. E. ShawMaximum Number of Moves with Same Result
3/5Count the most moves you can make on an array when each move removes two elements from the ends or the front, and every move must produce the same total. This Microsoft question becomes tractable once you notice there are only three candidate totals to try, each determined by the first move. You will simulate each candidate with two pointers, count the moves it sustains, and take the best of the three. The full problem and the reference solution require a subscription.
Coding QuestionsMicrosoftMaximum Sum Subarray
2/5Finding the most lucrative contiguous segment within a numeric sequence is a foundational algorithmic challenge frequently encountered in technical screenings. As asked in recent developer interviews at Glean, this problem tests your ability to scan a linear collection of integers and efficiently isolate a sublist that yields the absolute highest cumulative sum. You will need to implement an optimized linear-time approach that dynamically evaluates running totals without relying on brute-force nested iterations. Unlock the complete problem guide, complexity analysis, and clean model implementation with our paid subscription.
Coding QuestionsGleanBitwise XOR Subsequences
3/5Find the longest contiguous stretch of an array whose combination under bitwise exclusive-or equals a target. This Goldman Sachs question is the prefix-xor-and-hash-map pattern: because the operation is its own inverse, the first occurrence of each prefix value is what gives the longest span. You will store first occurrences only, seed the map for the empty prefix, and handle a target of zero. A subscription unlocks the complete problem and the model solution.
Coding QuestionsGoldman SachsSubarray Containing Two Values With the Fewest Distinct Numbers
3/5A coding question on finding a contiguous stretch of an integer array that includes both of two given values while containing as few different values as possible, and returning that count.
Coding QuestionsAmazon
Studied alongside
Subarray interview FAQ
- How many Subarray interview questions are there?
- 11 reported questions, mostly Coding Questions.
- Which companies ask Subarray questions?
- Uber (2), Google (2), Roblox (1), The Trade Desk (1), D. E. Shaw (1), Microsoft (1), Glean (1), Goldman Sachs (1).
- How hard are Subarray questions?
- They average 2.9 out of 5: 1 at 2/5, 10 at 3/5.