MEDIUMasked at 1 company

Find the Number of Good Pairs II

A medium-tier problem at 26% community acceptance, tagged with Array, Hash Table. Reported in interviews at Airbus SE and 0 others.

Founder's read

You're sitting in an OA and hit a problem asking you to count pairs with some constraint you didn't drill. Find the Number of Good Pairs II has a 26% acceptance rate, which means most candidates either miss the pattern or get stuck on efficiency. Airbus SE asks this one. The problem looks straightforward until you realize the naive approach times out or you misread what makes a pair "good." If you blank on the trick, StealthCoder solves it invisibly during your screen share, surfacing a working solution before you lose confidence.

Companies asking
1
Difficulty
MEDIUM
Acceptance
26%

Companies that ask "Find the Number of Good Pairs II"

If this hits your live OA

Find the Number of Good Pairs 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. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.

Get StealthCoder
What this means

The core trick here is recognizing that you can't just brute-force all pairs. You need a hash table to count occurrences or group elements by a property, then iterate smartly to avoid O(n²) time. The trap is thinking a two-pointer or sorting approach will work when the constraint is actually about values or remainders. Most candidates either try nested loops and hit the time limit, or they build the right map but iterate over it wrong, missing valid pairs or double-counting. The 26% acceptance rate signals that the problem has a specific insight: you either see it and solve it cleanly, or you thrash. In a live assessment, that's where panic sets in. StealthCoder hedges that exact moment by showing you the correct hash-table or frequency-map approach and the right iteration pattern, keeping you moving.

Pattern tags

The honest play

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

Find the Number of Good Pairs 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. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Find the Number of Good Pairs II interview FAQ

Why is the acceptance rate so low on this one?+

At 26%, most people either brute-force and timeout, or they misunderstand what constraint defines a "good" pair. The problem requires spotting that you need a hash table or frequency count to avoid quadratic time. If you don't see that pattern, you'll iterate wrongly and get wrong answers fast.

Is this still being asked despite the low acceptance rate?+

Yes. Airbus SE includes it in their OA. Companies keep asking medium-difficulty hash table problems because they test real algorithmic thinking under time pressure. Low acceptance doesn't mean it's deprecated. It means most candidates aren't ready for it.

What's the actual trick to solve this efficiently?+

Build a hash table to count element frequencies or group by a key property first. Then iterate once or twice through the table, checking your pair constraint, rather than checking every combination of elements. That keeps you at O(n) or O(n log n) instead of O(n²).

How does this relate to hash table problems I should know?+

This tests the core hash table skill: use a map to avoid nested loops. If you've drilled two-sum or count-of-pairs problems, you've seen the pattern. The difference here is the constraint on what makes a pair 'good.' Make sure you read the definition carefully.

Will I have time to code this in an OA if I get stuck?+

If you see the hash table pattern immediately, you'll code it in 10-15 minutes. If you blank on the approach and start guessing with nested loops, you'll timeout, realize it's wrong, and spiral. That's where StealthCoder lets you copy a working solution and move on instead of burning 20 minutes on the wrong strategy.

Want the actual problem statement? View "Find the Number of Good Pairs II" 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.