awesome-everything RU
↑ Back to the climb

Algorithms from zero

Problem-solving toolbox: interview drill

Crux Timed math-geometry and bit-manipulation problems from the NeetCode-150, with progressive hints — solve each cold, then narrate the complexity.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 120 min

You understand the bit tricks and the in-place matrix moves. Interviews test whether you can reach for XOR or a transpose-then-reverse under a timer, and explain why the trick is correct out loud.

Goal

Solve each problem before you reveal a hint, hit the target time, and narrate the time and space complexity as if an interviewer were listening. The hints exist for when you are genuinely stuck — they nudge you toward the pattern, never the full solution.

Five NeetCode-150 problems on the math-geometry and bit-manipulation patterns this unit teaches. Set a timer, solve each cold without looking at a hint, then say the time and space complexity out loud before you move on. Reveal a hint only when you are truly stuck — the hints nudge, they never hand you the answer.

0/5 solved

math geometry

#48 Rotate ImageMedium15m
AmazonMicrosoft
Follow-up (aloud)

Why does transpose-then-reverse-rows equal a clockwise rotation? What changes if you wanted counter-clockwise instead?

#54 Spiral MatrixMedium20m
AmazonMicrosoft
Follow-up (aloud)

Where exactly do you re-check the bounds to avoid emitting a row or column twice on a non-square matrix?

bit manipulation

#191 Number of 1 BitsEasy10m
Amazon
Follow-up (aloud)

Why is the n & (n - 1) loop O(number of set bits) rather than O(32)? When does that actually matter?

#338 Counting BitsEasy10m
AmazonMeta
Follow-up (aloud)

Both bits[i >> 1] + (i & 1) and bits[i & (i - 1)] + 1 work. Explain what each recurrence is really saying about the bits of i.

#136 Single NumberEasy10m
Amazon
Follow-up (aloud)

Why do XOR's commutativity and associativity make the pairing cancellation order-independent? What if every element appeared three times instead of two?

Recap

Mark each problem solved once you finished it cold, inside the target time, and could state the complexity without hesitation. Come back in a few days and re-solve the ones you marked — spaced revisits are what turn a recognised pattern into a reflex.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources2
expand
  1. 01
  2. 02

Trademarks belong to their respective owners. Editorial reference only.