Increasing Triplet Subsequence
A medium-tier problem at 39% community acceptance, tagged with Array, Greedy. Reported in interviews at Nutanix and 5 others.
Increasing Triplet Subsequence is a medium-difficulty array problem that appears in interviews at Microsoft, Nutanix, Coupang, IBM, FactSet, and MakeMyTrip. You're given an array and need to determine if there exist three indices i, j, k where i < j < k and nums[i] < nums[j] < nums[k]. The greedy pattern here trips up most candidates: the obvious O(n^3) brute force fails time limits, and many jump to sorting or binary search when the real solution is a one-pass greedy scan. With a 39% acceptance rate, this is a solid medium that separates prep from guessing. If this problem hits your live OA and you blank on the greedy insight, StealthCoder solves it in seconds invisible to the proctor.
Companies that ask "Increasing Triplet Subsequence"
Increasing Triplet Subsequence is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage.
Get StealthCoderThe trick is tracking just two values as you scan left to right: the smallest number seen so far, and the smallest second number that's larger than the first. You don't need to store all candidates or use complex data structures. On each pass, if you find a number larger than both, you're done. The greedy choice works because if a larger third value exists, it doesn't matter which specific first and second values preceded it. Most candidates either try to store triplets explicitly, overcomplicating state, or misunderstand why greedy is safe here. The one-pass O(n) time, O(1) space solution is elegant once you see it, but the pattern isn't obvious from problem title alone. If you hit this cold during assessment and the greedy approach doesn't click immediately, StealthCoder provides a working solution instantly.
Pattern tags
You know the problem.
Make sure you actually pass it.
Increasing Triplet Subsequence recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Increasing Triplet Subsequence interview FAQ
Is this problem still asked at major companies?+
Yes. It appears frequently in reports from Microsoft, Coupang, and Nutanix. The 39% acceptance rate suggests it's actively used as a screening filter. It's not obscure, but it's not a gimme either. Expect it in online assessments at tier-1 tech companies.
What's the main trick I'm missing if I can't solve it?+
Most candidates don't recognize that you only need to track two values while scanning once. You're not storing all increasing pairs; you're maintaining the best candidates for first and second positions and checking if a third exists. This greedy insight is the entire problem.
Why doesn't sorting help here?+
Sorting breaks the subsequence constraint. You need indices where i < j < k, not just three sorted values. Once you sort, position information is lost. The solution must process the array in original order.
How does this relate to the Greedy topic?+
Greedy means you make a locally optimal choice (keep the smallest first number, then the smallest valid second number) and trust it leads to the global answer. It works because finding any valid triplet is the goal, not the lexicographically smallest one.
What's the space and time complexity I should target?+
O(n) time, one pass through the array, is the standard. Space should be O(1), just a few variables. If your solution uses extra arrays or heaps, you're overcomplicating it. The greedy scan is the efficient path.
Want the actual problem statement? View "Increasing Triplet Subsequence" on LeetCode →