Unique Supersequence Merge
Reported by candidates from Blinkit's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Blinkit reported this one in July 2026, and the detail that matters is in the title: arr3 must hold only unique numbers. That means any value shared by both arrays gets exactly one slot, and both arrays have to agree on where it goes. So this is really an ordering-consistency check dressed up as a merge problem. Example 2 is the whole trap: [2,3,5,1] wants 5 before 1, [2,3,1,5] wants 1 before 5, and no unique array can do both. If you blank during the live OA, StealthCoder runs invisibly on your desktop as a safety net, but the idea below is short enough to hold in your head.
The problem
You are given two arrays arr1 and arr2. Each array contains unique numbers. Return true if there exists an array arr3 such that: arr1 is a subsequence of arr3. arr2 is a subsequence of arr3. All numbers in arr3 are unique. Otherwise return false. Function canMergeUniqueSubsequences(arr1: int[], arr2: int[]) → boolean Examples Example 1 arr1 = [2,3,5,1] arr2 = [4,3,5,1,9] return = true One valid merged array is [2,4,3,5,1,9]. Example 2 arr1 = [2,3,5,1] arr2 = [2,3,1,5] return = false The first array requires 5 before 1, while the second array requires 1 before 5. Both cannot be true in one unique array.
Reported by candidates. Source: FastPrep
Pattern and pitfall
Treat each array as a chain of ordering constraints. Every adjacent pair (a, b) in an array means a must come before b in arr3. Build a directed graph from those edges across both arrays, then check for a cycle. If there's no cycle, a topological order exists, and that order is a valid unique arr3. If there's a cycle, return false. Example 2 produces 5 to 1 and 1 to 5, which is a two-node cycle. Shared numbers are what link the two chains, so the hash map of node to neighbors does the work. The common pitfall is comparing only shared elements pairwise and missing a longer cycle that runs through non-shared values. Use Kahn's algorithm with in-degree counts, and if the processed count is less than the number of distinct values, a cycle exists. Time is linear in the total length. StealthCoder is your hedge in the live OA if the graph setup slips under pressure.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Unique Supersequence Merge cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Blinkit's OA.
Blinkit reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Unique Supersequence Merge FAQ
What's the trick in Unique Supersequence Merge?+
Convert both arrays into precedence edges between adjacent elements, then detect a cycle in the combined directed graph. No cycle means a valid unique arr3 exists. A cycle means the two arrays disagree on the relative order of some values, so return false.
How hard is this problem really?+
Medium. The code is short, but you have to spot that it's a topological sort question. Once you see the ordering constraints, it's a standard graph build plus Kahn's algorithm. Most people lose time trying to merge the arrays directly with two pointers.
Why does Example 2 return false?+
arr1 = [2,3,5,1] forces 5 before 1. arr2 = [2,3,1,5] forces 1 before 5. Since arr3 can't repeat numbers, each value appears once, so 5 can't be both before and after 1. That's a cycle, and a cycle means no valid ordering.
Do I need to handle numbers that appear in only one array?+
Yes, they're just nodes with edges from one chain. They add no conflict by themselves but they can sit on a cycle path. Add every value as a node, and the in-degree counting handles them automatically without special cases.
How do I prepare for this in 48 hours?+
Practice topological sort with Kahn's algorithm until you can write it from memory, including the cycle check by comparing processed count to node count. Then rehearse turning ordering rules into edges. That one conversion is the whole problem.