MEDIUMasked at 6 companies

Number of Black Blocks

A medium-tier problem at 39% community acceptance, tagged with Array, Hash Table, Enumeration. Reported in interviews at Block and 5 others.

Founder's read

Number of Black Blocks is a medium-difficulty problem that's been asked by Block, X, SIG, Capital One, Visa, and Uber. The 39% acceptance rate signals that this isn't a straightforward enumeration task. Most candidates who hit this problem in their OA either misread the constraints or brute-force into a timeout. The trick lives in efficient counting, not in parsing the problem statement. If you blank on the optimization during a live assessment, StealthCoder surfaces the working approach in seconds, invisible to the proctor.

Companies asking
6
Difficulty
MEDIUM
Acceptance
39%

Companies that ask "Number of Black Blocks"

If this hits your live OA

Number of Black Blocks 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 Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The problem requires you to count black blocks under specific conditions, which sounds straightforward until you realize the naive enumeration approach scales poorly. The key insight is recognizing that you can't just iterate through every possible block; you need to collapse the search space using a hash table to track states or patterns, then enumerate only the relevant ones. Array indexing and careful boundary handling matter more than people expect. Hash table lookups become your speed multiplier. Most candidates default to checking every combination and hit memory or time limits. The pattern-based enumeration approach is not obvious without prior exposure. During a live OA, if you're stuck between brute force and optimization, StealthCoder gives you the exact structure to move forward.

Pattern tags

The honest play

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

Number of Black Blocks 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 Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Number of Black Blocks interview FAQ

Why is the acceptance rate so low for a medium problem?+

Candidates often misinterpret what counts as a black block or default to naive enumeration. The 39% acceptance rate reflects that the optimization leap isn't obvious. Hash table and enumeration techniques together unlock the solution, but recognizing when to apply them requires pattern recognition that takes trial and error.

Is this still asked at these companies or is it dated?+

Block, X, SIG, Capital One, Visa, and Uber have all asked this. Block especially, given the company name. These are active companies with ongoing hiring, so the problem remains relevant. Its lower acceptance rate makes it a strong signal differentiator in their screening loop.

What's the trick to avoiding a timeout?+

Don't enumerate all possible blocks. Use a hash table to store counts or patterns, then iterate only over unique states or bounded ranges. The optimization converts a potentially exponential search into polynomial time. Array bounds matter; enumerate smartly, not exhaustively.

How does hash table fit into this problem?+

Hash tables let you deduplicate or cache intermediate results so you don't recompute. Instead of checking every block position individually, you group them by a key property and count once per group. This collapses redundant work and keeps you within time limits.

Will I see enumeration problems like this in a real OA?+

Yes. Enumeration combined with array and hash table manipulation is a common OA pattern at fintech and payment companies like Block, Capital One, and Visa. If you can solve this one, you're prepared for similar constraint-based counting problems in their assessments.

Want the actual problem statement? View "Number of Black Blocks" 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.