HARDasked at 40 companies

First Missing Positive

A hard-tier problem at 41% community acceptance, tagged with Array, Hash Table. Reported in interviews at Celigo and 39 others.

Founder's read

First Missing Positive is a hard array problem that has appeared at Netflix, ServiceNow, Geico, and at least 36 other companies. Its 41% acceptance rate reflects a brutal gap between the naive solution and what the interviewer wants. Most candidates reach for a hash table or sort, burn time, and either time out or use O(n) extra space when the problem silently expects O(1). This is the kind of problem where the trick isn't obvious until you see it, and if you blank on it during a live assessment, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
40
Difficulty
HARD
Acceptance
41%

Companies that ask "First Missing Positive"

If this hits your live OA

First Missing Positive 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 Amazon engineer who used it to pass JPMorgan's OA and system design loop.

Get StealthCoder
What this means

The trick is to use the array itself as a hash table. Since you're looking for the first missing positive integer in the range 1 to n (where n is the array length), you can place each number at its 'correct' index: the value k goes to index k-1. After one pass of swaps, a second pass finds the first index where the value doesn't match. The pitfall is overthinking it: candidates waste cycles on sorting, building actual hash tables, or trying to solve it in ways that look smart but violate the O(1) space constraint. The problem statement doesn't scream 'O(1) space' at you, but that's exactly what separates a pass from a reject at this level. If you hit this on your assessment and the obvious approach feels wrong, StealthCoder will show you the index-based placement pattern and get you to the finish line.

Pattern tags

The honest play

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

First Missing Positive recycles across companies for a reason. It's hard-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 Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.

First Missing Positive interview FAQ

Why is hash table not the right answer here?+

Hash table is O(n) space and works functionally, but the problem expects O(1) space. At Netflix or ServiceNow, that constraint matters. The interviewer is testing whether you can think beyond the easy path. Hash table is the warm-up answer; the real solution uses the array itself.

Is this problem still actually asked at top companies?+

Yes. It appears in reports from Netflix, ServiceNow, Geico, and over 35 other firms. The 41% acceptance rate shows it's not gimmes. It's a filter problem designed to separate candidates who know the trick from those who don't.

What's the core trick I need to know?+

Use the array indices as your hash table. Value k belongs at index k-1. Perform a first pass to swap each number into its correct position, then a second pass to find the first mismatch. No extra space, O(n) time.

How does this relate to hash table problems in general?+

It's an inversion: instead of building a separate hash structure, you repurpose the input array. Hash table problems usually ask you to count or track; this one asks you to arrange. It bridges array and hash table thinking.

Will I have time to solve this under pressure?+

If you know the pattern, yes. Two passes and some careful swap logic takes 20-30 minutes to code cleanly. If you don't know it, you'll circle on sorting or hash tables and run out of time. This is why it's a hard filter at that 41% acceptance rate.

Want the actual problem statement? View "First Missing Positive" 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.