foundation
Interview task patterns
Arrays, strings, maps, trees, graphs, intervals, async JavaScript, and utility implementations.
Coding interviews cluster around a few families: array and string scans with one extra technique, hash map indexing, tree and graph traversal, interval sorting and sweeps, async JavaScript coordination, and utility implementations like debounce or memoize. The winning move is naming the family before writing code.
Start with brute force, identify repeated work, then pick the pattern that removes it. Clarify ordering, mutation, endpoint semantics, concurrency limits, and API contracts early.
Trade-off: compare time, memory, and implementation complexity before committing to a structure or pattern.
On interviews: explain your pattern choice, state edge cases, and give complexity after the approach is clear.
Common pitfalls: optimizing before requirements are locked; treating a graph as a tree; starting all async work with map(async).
Checklist:
- Name the pattern family.
- Clarify constraints and edge cases.
- Compare time and memory.
- Use child topics for technique depth.