EASYasked at 13 companies

Single Number

A easy-tier problem at 76% community acceptance, tagged with Array, Bit Manipulation. Reported in interviews at Palantir Technologies and 12 others.

Founder's read

Single Number looks easy until you realize the naive hash-map approach is exactly what the interviewer doesn't want. You've got an array where every element appears twice except one, and you need to find that one. Google, Amazon, and Palantir ask this regularly. The trick lives in bit manipulation, not brute force. Most candidates solve it the hard way first, then panic when asked to optimize. If this problem hits your live assessment and you blank on the XOR pattern, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
13
Difficulty
EASY
Acceptance
76%

Companies that ask "Single Number"

If this hits your live OA

Single Number 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. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.

Get StealthCoder
What this means

The obvious move is a hash map or set, which works but signals you're not thinking like a systems engineer. The real solution uses XOR: any number XOR'd with itself is zero, and zero XOR'd with any number is that number. So XOR all elements together and the duplicates cancel out, leaving only the single number. This is an Array and Bit Manipulation problem compressed into one insight. Most candidates either don't know XOR well enough to spot it immediately, or they know it theoretically but freeze under pressure. That's where StealthCoder becomes your safety net. The solution is O(1) space and O(n) time, which beats every other approach. Once you see it, it's unforgettable. But getting there in a live OA without practice is where people stumble.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Single Number recycles across companies for a reason. It's easy-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. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Single Number interview FAQ

Is Single Number still asked at major companies?+

Yes. Google, Amazon, Palantir, Airbnb, and Qualcomm all report asking it. With a 76% acceptance rate, it's not a hard problem statistically, but that acceptance rate includes people who've seen it before. First-time solvers often miss the XOR optimization.

What's the trick everyone expects?+

XOR all elements. XOR has the property that a XOR a = 0 and 0 XOR a = a. So duplicates cancel, leaving only the single number. It's O(1) space, which breaks the hash-map solution. Interviewers grill you on why XOR works here, not just that it does.

Can I just use a hash map?+

You can pass the problem, but you won't impress. Hash map is O(n) space and O(n) time. The bit-manipulation solution is O(1) space and O(n) time. Interviewers always ask 'can you do better on space.' If you only know hash map, you've already lost that follow-up.

How does this relate to Bit Manipulation as a topic?+

This is a textbook bit-manipulation problem because it teaches XOR as a tool for pairing and cancellation. You won't solve it efficiently without understanding XOR properties. It's often a warm-up before harder bit problems like Number of 1 Bits or Power of Two.

What do I need to know going in?+

Know XOR basics: how it behaves with duplicates, why a XOR a = 0. Know array iteration. Know that bit tricks trade space for time. The problem itself is easy once you know the pattern, so the real prep is drilling XOR until you spot it instantly.

Want the actual problem statement? View "Single Number" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.