awesome-everything RU
↑ Back to the climb

Algorithms from zero

Lists, stacks & queues: interview drill

Crux Timed linked-list and stack 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 linked lists and stacks. 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.

Seven NeetCode-150 problems on the linked-list and stack 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/7 solved

linked list

#206 Reverse Linked ListEasy10m
AmazonMicrosoft
Follow-up (aloud)

This is O(n) time, O(1) space iteratively. Sketch the recursive version and explain why its space becomes O(n).

#21 Merge Two Sorted ListsEasy10m
Amazon
Follow-up (aloud)

Why is splicing existing nodes O(1) extra space, and how is this the merge step that powers merge sort on lists?

#141 Linked List CycleEasy10m
AmazonMicrosoft
Follow-up (aloud)

Argue why the fast pointer is guaranteed to lap the slow one inside a cycle, and why they never meet when the list is acyclic.

#143 Reorder ListMedium20m
AmazonMeta
Follow-up (aloud)

Walk the interviewer through how you keep this O(1) extra space, and where an off-by-one in the split would corrupt the result.

stack

#20 Valid ParenthesesEasy10m
AmazonGoogle
Follow-up (aloud)

Name the two failure cases the empty-stack check at the end catches versus the mismatch check catches mid-scan.

#155 Min StackMedium15m
AmazonMicrosoft
Follow-up (aloud)

All four operations must be O(1). Explain why the auxiliary-stack trick beats scanning for the min on every getMin.

#739 Daily TemperaturesMedium15m
AmazonMeta
Follow-up (aloud)

Defend the O(n) bound via amortized analysis, and name another problem the same monotonic-stack idea solves.

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 ↑The binary tree
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.