Resources
Resources
Where this site fits, complexity basics, practice platforms, books, and classic references, curated for pattern-first interview prep.
How this site fits
DSA Patterns is the pattern-recognition layer for LeetCode-style interviews: a curated catalog of techniques, multi-language templates, mental models, and on-site write-up paths. We restate problems and cite sources, we do not copy official editorials.
- Start here: refresh Big-O → roadmap foundations → pattern template → write-up + tests.
- Practice elsewhere: volume on LeetCode / NeetCode; visuals on VisuAlgo; contests on Codeforces / AtCoder; live practice on Pramp or interviewing.io.
- Go deeper with books: CLRS (theory), EPI / CtCI (interview problems), Grokking (visual intuition).
Complexity & Big-O
A practical primer for coding interviews: what Big-O means, common bounds, how to analyze loops, and how space complexity fits in.
Read the Big-O guide →Math foundations
The math behind DSA: growth rates, logarithms, summations, combinatorics, modular arithmetic, probability, and graph theory - visualized and animated.
Explore the math section →Language cards
Interview idioms for the three languages this site ships templates in: Python, TypeScript, and C#.
In the interview
Before coding
- Restate the problem: inputs, outputs, and types.
- Ask for the constraints that change the algorithm: input size, whether you may mutate the input, and any time or memory bound.
- Walk a normal example, then an empty one and a one-element one. Check that reading with the interviewer.
- Name the pattern family: scan, search, window, graph, tree, or dynamic programming.
While coding
- Put a correct brute force on the table and state its complexity, then tighten it.
- Keep talking. Narrate the approach, the trade-off, and the alternative you did not pick.
- Use names that say what the value is.
After coding
- Trace the examples you already agreed on.
- Trace the edge cases below.
- State time and extra space, and which line dominates.
- If a tighter bound or a cleaner shape is obvious, say what it is.
Edge cases
- Numbers: zero, negatives, and the stated minimum and maximum. Fixed-width overflow in Java and C. Python ints do not overflow. Division by zero. Floats: compare with a tolerance, not
==. - Strings: empty string and a single character. All characters the same. Spaces, punctuation, and non-ASCII.
Noneversus""in languages that have both. - Arrays: empty, one element, all duplicates. Already sorted and reverse sorted.
Noneentries, if the language allows them. - Trees and graphs: empty, and a single node. Only left children, or only right children. Disconnected graph, self-loop, cycle. Topological sort needs a DAG. Dijkstra needs non-negative weights.
- Matrices: empty, 1×1, a single row, a single column. Square versus rectangular.
Habits that help
- Agree on the approach before writing it down. A few quiet minutes of thinking are useful. Going silent for the rest of the interview is the failure mode.
- Ask when a constraint is missing.
- Test before you are asked.
- State time and space every time.
- Treat a hint as new information and change the solution.
Habits that hurt
- Coding before you can restate the problem.
- Skipping the empty input.
- Ignoring a hint.
- Defending a bug instead of tracing it.
- Building a framework for a problem that needed one loop.
- Stopping without a complexity.
Practice platforms
Mock interviews
Books
- Introduction to Algorithms (CLRS) (opens in new tab)Publisher / official page
- Elements of Programming Interviews (EPI) (opens in new tab)Publisher / official page
- Grokking Algorithms (opens in new tab)Publisher / official page
- A Common-Sense Guide to Data Structures and Algorithms (opens in new tab)Publisher / official page
- Cracking the Coding Interview (opens in new tab)Publisher / official page
Online references
- Big-O Cheat Sheet (opens in new tab)www.bigocheatsheet.com
- CP-Algorithms (opens in new tab)cp-algorithms.com
- VisuAlgo (opens in new tab)visualgo.net
- Khan Academy — Algorithms (opens in new tab)www.khanacademy.org/computing/computer-science/algorithms
- Cornell CS 3110 — Data Structures & Functional Programming (opens in new tab)www.cs.cornell.edu/courses/cs3110/2024sp
- Algorithms by Jeff Erickson (Illinois) (opens in new tab)jeffe.cs.illinois.edu/teaching/algorithms
External links are recommendations only. We are not affiliated with these products or sites.