Find All Numbers Disappeared in an Array
A easy-tier problem at 62% community acceptance, tagged with Array, Hash Table. Reported in interviews at Tinkoff and 0 others.
You're given an array of n integers where each number should appear between 1 and n. Some numbers are missing. Find all of them. It sounds trivial until you realize the constraint: you need O(1) space. That's not a suggestion. Hash tables are off the table. The trick separates candidates who memorize from those who think. Tinkoff has asked this. Most candidates either blow through the space constraint or spend 20 minutes chasing a solution that doesn't exist. If you hit this live and your first instinct is a set or map, StealthCoder surfaces the array-reuse pattern in seconds.
Companies that ask "Find All Numbers Disappeared in an Array"
Find All Numbers Disappeared in an Array 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 for the engineer who has done the work but might still blank with a webcam pointed at him.
Get StealthCoderThe trap is treating this as a straight-up lookup problem. Your brain says hash table. Your interviewer says no extra space. The real solution marks indices in the original array as visited. When you see number k, go to index k-1 and flip the sign to negative. At the end, any positive values at indices correspond to missing numbers. The pattern matters because it teaches you to abuse the input structure itself as your data structure. Most OAs let you get away with inefficient space. This one doesn't. That's the entire test. Common mistake: overthinking it as a cycle-detection problem when it's just marker-based indexing. If this hits your assessment and you blank on the trick, you lose 10-15 minutes or guess your way to wrong output. StealthCoder handles it invisibly and moves you forward.
Pattern tags
You know the problem.
Make sure you actually pass it.
Find All Numbers Disappeared in an Array 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 for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find All Numbers Disappeared in an Array interview FAQ
Is this problem actually asked at interviews, or is it just in problem banks?+
Tinkoff has confirmed it. Acceptance rate is solid at 62%, meaning most who tackle it solve it, but the space constraint trips up a lot of people in live conditions. It's a real ask, not theoretical. Shows up when the company wants to test constraint awareness, not just basic array skills.
What's the actual trick? Doesn't every solution need a hash table?+
No. Mark indices by negating values. Loop through the array. For each number n, visit index n-1 and set it negative. Second pass: positive values mean those indices weren't visited, so their corresponding numbers are missing. Zero space overhead. That's the entire pattern.
Is this really an easy problem or is the difficulty rating wrong?+
It's easy once you know the trick. The 62% acceptance suggests some find it straightforward. But in a live OA without hints, most candidates waste time on hash tables before realizing the constraint. Difficulty depends on whether you've seen array-reuse before.
How does this relate to the Array and Hash Table topics listed?+
It's categorized under both because a naive solution uses a hash table. The real solution uses arrays and index manipulation instead. The problem teaches you when to reject the obvious tool and rethink using only input structure.
What if I freeze on this during an assessment?+
That's exactly the scenario StealthCoder is designed for. You read the constraint, realize you can't use a hash table, and blank. StealthCoder reads the problem screen-share-invisible, instantly provides the marking-indices approach, and you're unblocked in seconds. No proctor sees it.
Want the actual problem statement? View "Find All Numbers Disappeared in an Array" on LeetCode →