Skip to content
ΣDSA Patterns
Menu
Language

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. None versus "" in languages that have both.
  • Arrays: empty, one element, all duplicates. Already sorted and reverse sorted. None entries, 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

  1. 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.
  2. Ask when a constraint is missing.
  3. Test before you are asked.
  4. State time and space every time.
  5. Treat a hint as new information and change the solution.

Habits that hurt

  1. Coding before you can restate the problem.
  2. Skipping the empty input.
  3. Ignoring a hint.
  4. Defending a bug instead of tracing it.
  5. Building a framework for a problem that needed one loop.
  6. Stopping without a complexity.

Practice platforms

Mock interviews

Books

Online references

External links are recommendations only. We are not affiliated with these products or sites.