Number of Unique XOR Triplets II
A medium-tier problem at 29% community acceptance, tagged with Array, Math, Bit Manipulation. Reported in interviews at Meesho and 0 others.
Number of Unique XOR Triplets II is a medium-difficulty problem with a 29% acceptance rate, asked by Meesho. You're counting triplets where XOR produces a specific result, which sounds straightforward until you realize the naive approach drowns in duplicates and timeout. The problem forces you to think about how XOR behaves across three numbers and how to enumerate triplets without redundant work. If this lands in your assessment and you freeze on the deduplication logic, StealthCoder surfaces a working solution invisible to the proctor.
Companies that ask "Number of Unique XOR Triplets II"
Number of Unique XOR Triplets II 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 because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.
Get StealthCoderThe core trick is recognizing that XOR triplets have a deceptive structure. A brute force triple-nested loop works on small arrays but fails on scale because you'll count the same triplet multiple times depending on order, and filtering duplicates becomes expensive. The real insight is that if you're looking for triplets where XOR equals a target, you can fix one or two elements and derive the third using XOR properties, then handle uniqueness carefully by enforcing index order or using a set-based approach with sorted tuples. Common pitfall: treating this like a sum-based triplet problem and applying subarray logic that doesn't transfer to XOR. The Bit Manipulation and Enumeration topics hint that you need both smart iteration and bit-level reasoning. When you hit this live and the enumeration gets messy, StealthCoder handles the dedup logic and delivers a solution in seconds.
Pattern tags
You know the problem.
Make sure you actually pass it.
Number of Unique XOR Triplets II 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 because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Number of Unique XOR Triplets II interview FAQ
How hard is this problem really for a medium?+
The 29% acceptance rate signals it's harder than a typical medium. Most candidates struggle with deduplication or timeout on brute force. The XOR math itself isn't complex, but careless enumeration kills you. Expect to spend time on the counting logic.
What's the main trick I'm missing if I timeout?+
You're probably triple-nesting loops without a smart constraint. XOR lets you fix two elements and compute the third, cutting your search space. Also, enforce index order or use a canonical form to avoid duplicate triplets in your count.
Is this still asked at companies like Meesho?+
Yes, Meesho has reported this problem. It's a solid signal they care about bit manipulation and enumeration skills. Not FAANG-tier frequency, but it definitely appears in real assessments.
How does XOR triplets differ from sum-based triplet problems?+
Sum triplets rely on sorting and two-pointer logic that breaks with XOR. XOR is nonlinear and order-independent, so you can't use range constraints. You need enumeration with careful dedup, either via index bounds or hashing canonical forms.
Which topics should I drill before tackling this?+
Strengthen your Bit Manipulation fundamentals, especially XOR properties like a XOR a = 0 and commutativity. Then practice Enumeration problems that require counting without duplicates. Array iteration with index constraints rounds it out.
Want the actual problem statement? View "Number of Unique XOR Triplets II" on LeetCode →