awesome-everything RU
↑ Back to the climb

Algorithms from zero

Arrays & strings: interview drill

Crux Timed two-pointer and sliding-window 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 patterns. Interviews test whether you can reach for them under a timer, cold, and explain the cost 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.

Six NeetCode-150 problems on the two 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/6 solved

two pointers

#125 Valid PalindromeEasy10m
MetaAmazon
Follow-up (aloud)

What changes if you must ignore only spaces but keep punctuation significant? Where does the skip condition live?

#167 Two Sum II - Input Array Is SortedMedium12m
Amazon
Follow-up (aloud)

Why is the two-pointer move provably correct here but unsound on an unsorted array? Tie it back to the invariant.

#15 3SumMedium20m
AmazonMeta
Follow-up (aloud)

Could you reach the target sum faster than O(n²)? What lower bound makes that hard for general 3-sum?

sliding window

#121 Best Time to Buy and Sell StockEasy10m
Amazon
Follow-up (aloud)

If you were allowed multiple buy/sell transactions, how does the greedy idea change?

AmazonGoogle
Follow-up (aloud)

Why is the total work O(n) even though left can move many times — what amortizes it?

Google
Follow-up (aloud)

Many solutions never shrink the window's max-frequency tracker. Why does the answer stay correct even when that count is stale?

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.

Continue the climb ↑Why sort?
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.