Learn Algorithm Patterns

Master the patterns that appear in every coding interview. Each track teaches you when to use the pattern, common traps, and walks you through problems from easy to hard.

Arrays & Hashing

Use hash maps, sets, and array manipulation to solve problems involving lookups, frequency counting, and element relationships.

63 problems25 easy36 med2 hard

Two Pointers

Use two pointers moving through the data to find pairs, partitions, or solve problems on sorted arrays in O(n) time.

12 problems5 easy6 med1 hard

Sliding Window

Maintain a dynamic window over a contiguous subarray or substring to find optimal ranges in O(n) time.

18 problems3 easy13 med2 hard

Stack

Use LIFO ordering to match pairs, track state, or maintain monotonic sequences for next-greater/smaller element problems.

23 problems7 easy13 med3 hard

Binary Search

Halve the search space each step to find targets or boundaries in O(log n) time on sorted or monotonic data.

24 problems5 easy13 med6 hard

Linked List

Manipulate node-based data structures using pointer techniques like fast/slow, dummy heads, and in-place reversal.

12 problems6 easy6 med0 hard

Trees

Traverse and manipulate hierarchical structures using DFS (pre/in/post-order) and BFS (level-order) traversals.

22 problems5 easy12 med5 hard

Graphs

Model relationships as nodes and edges, then traverse with BFS (shortest path) or DFS (all paths, connectivity).

29 problems0 easy22 med7 hard

Heap / Priority Queue

Maintain quick access to the min or max element for top-k, merge, and scheduling problems.

12 problems0 easy10 med2 hard

Intervals

Sort and merge overlapping or adjacent intervals to solve scheduling, coverage, and overlap problems.

5 problems1 easy4 med0 hard

Greedy

Make locally optimal choices at each step, proving they lead to a globally optimal solution.

10 problems0 easy9 med1 hard

Dynamic Programming

Break problems into overlapping subproblems, cache results, and build up to the final answer.

42 problems3 easy25 med14 hard

Backtracking

Explore all candidates by building solutions incrementally and abandoning paths that can't lead to valid answers.

17 problems0 easy13 med4 hard

Trie

Build prefix trees for efficient string operations like autocomplete, prefix matching, and word search.

10 problems0 easy9 med1 hard

Union Find

Track connected components efficiently with union and find operations, using path compression and rank optimization.

9 problems0 easy8 med1 hard