Home / Coding / Start Here

Start Here

These guides assume coding interviews are not new to you. The goal is fast pattern recognition — not learning from scratch. Each guide covers one pattern with templates, key problems, and the insights that matter under pressure.


How to Use These Guides

Each guide follows the same structure so you always know where to look:

  • Quick Revision table — the must-do problems for that pattern. Short on time? Solve only these.
  • Practice Tips — how to identify the pattern in a problem, what to reach for instead, and how to approach it in an interview.
  • Patterns + Templates — the core code templates you need to have in your head.
  • Problems — ordered Easy → Medium → Hard, with solutions and complexity analysis.
  • Quick Reference — one-row-per-problem summary at the bottom.

Practice Mode — use the toggle in the top-right of any guide to hide solutions and work through problems independently.


The 17 Patterns

Pattern 1 — Fundamentals
Data Structures
Arrays, HashMaps, Sets, and design problems like LRU/LFU Cache. The building blocks every other pattern sits on top of.
Reach for it when: the problem asks you to design a data structure with specific O(1) or O(log n) operations, or you need a refresher on core structures.
Pattern 2
Two Pointer
Replaces O(n²) brute force by moving two indices through the array simultaneously. Converging from both ends, or fast and slow in the same direction.
Reach for it when: finding pairs with a target sum, filtering in place, or partitioning a sorted array.
Pattern 3
Sliding Window
Maintains a running window over a sequence to avoid recomputing from scratch. Fixed size or dynamically expanding and shrinking.
Reach for it when: finding a subarray or substring that satisfies a condition — max sum, longest without repeating, minimum covering.
Pattern 4
Binary Search
Eliminates half the search space each step. Works on sorted arrays, rotated arrays, and any problem with a monotonic condition you can test.
Reach for it when: the input is sorted, or you can frame the answer as "find the smallest X where condition holds."
Pattern 5
Trees
DFS (pre/in/post-order recursion) and BFS (level-order). BST properties enable O(log n) search, insert, and in-order traversal gives sorted output.
Reach for it when: traversing, validating, constructing, or finding paths in a binary tree or BST.
Pattern 6
Dynamic Programming
Breaks problems into overlapping subproblems and caches results. 1D or 2D DP table, built bottom-up or top-down with memoization.
Reach for it when: the problem asks for count, min, max, or true/false over all ways to do something, and subproblems repeat.
Pattern 7
Graphs
BFS for shortest paths and level-by-level exploration. DFS for connectivity and cycle detection. Dijkstra for weighted shortest paths.
Reach for it when: the problem involves nodes and edges, grid traversal, connected components, or finding shortest paths.
Pattern 8
Stack
Tracks context you'll need again soon — matching brackets, pending operations, the nearest boundary. LIFO order makes it natural for nested or sequential structure.
Reach for it when: matching pairs, evaluating expressions, or finding the next greater/smaller element.
Pattern 9
Linked List
Pointer manipulation — reversals, merges, cycle detection. Two-pointer (fast/slow) solves most linked list problems without extra space.
Reach for it when: reversing, finding the middle, detecting cycles, or merging sorted lists.
Pattern 10
Heap
Priority queue that gives O(log n) insert and O(1) peek at min or max. Two-heap trick splits a stream into lower and upper halves for median tracking.
Reach for it when: you need the top-K elements, merging K sorted lists, or tracking a running median.
Pattern 11
Backtracking
Explores all possibilities by building candidates incrementally and abandoning branches the moment they can't lead to a valid solution.
Reach for it when: generating all subsets, permutations, combinations, or solving constraint satisfaction problems.
Pattern 12
Mixed Patterns
Problems that combine multiple techniques — hash maps for O(1) lookup, sorting as a preprocessing step, bit manipulation, and matrix traversal.
Reach for it when: a single pattern isn't enough, or the problem involves grouping, counting, or in-place matrix operations.
Pattern 13
Intervals
Sort by start time, then sweep through to merge overlaps, insert new intervals, or count simultaneous events with a min-heap.
Reach for it when: the problem gives you ranges or intervals and asks about overlaps, merging, or scheduling.
Pattern 14
Monotonic Stack
A stack that stays sorted (increasing or decreasing) by popping elements that violate the order. Answers "next greater element" queries in O(n).
Reach for it when: finding the next/previous greater or smaller element, or computing spans and histogram areas.
Pattern 15
Trie
Prefix tree that shares common prefixes across strings. O(m) insert and search where m is the word length, regardless of dictionary size.
Reach for it when: autocomplete, prefix matching, or searching a dictionary of words efficiently.
Pattern 16
Union Find
Tracks which elements belong to the same group using a forest of trees. Near-O(1) union and find with path compression and union by rank.
Reach for it when: detecting cycles, counting connected components, or dynamically merging groups.
Pattern 17
Concurrency
Thread coordination using Semaphore, ReentrantLock, Condition variables, and CyclicBarrier. Deadlock avoidance through consistent lock ordering.
Reach for it when: the problem involves multiple threads that need to signal each other, take turns, or synchronize on a shared resource.

If you have a week: Work through all 17 guides in order. Solve the must-do problems in each before reading the solutions.

If you have 2–3 days: Focus on the Blind 75 problems spread across the guides. Every ⭐ MUST DO problem marked [B75-XXX] is Blind 75.

If you have one day: Two Pointer, Sliding Window, Binary Search, Trees, Dynamic Programming, Graphs. These cover the highest-frequency patterns.

Day-before: Skim the Quick Reference table at the bottom of each guide you covered. That's it.