Graphs: From Zero to BFS/DFS in One Post
Graphs intimidate more than any other topic — but most problems use just 4 techniques. Master BFS, DFS, topological sort, and union-find with a clear decision framework.
Latest articles, tutorials, and deep dives from ndlab tech blog.
Graphs intimidate more than any other topic — but most problems use just 4 techniques. Master BFS, DFS, topological sort, and union-find with a clear decision framework.
Trees are the most-tested structure in FAANG interviews. Master DFS, BFS, all traversals, LCA, path sums, and BST validation with a recursive framework that makes it click.
Stacks feel easy until the interviewer asks for a queue using two stacks. Learn the monotonic stack, deque patterns, and the BFS connection that unlocks hard O(n) solutions.
Linked lists look simple until live pressure hits. Master reversal, cycle detection, the runner technique, and merging — with the mental model that kills null pointer errors.
The hash map improves interview performance more than any other structure. Learn how it works, when O(1) breaks, and the 5 patterns covering 80% of hash-related problems.
Arrays and strings appear in 40%+ of interviews and hide surprising complexity. Master prefix sums, sliding windows, two pointers, and in-place tricks that turn O(n²) into O(n).
Results