Learning path

DSA

Data structures and algorithms, one pattern at a time, with live animations you can play, pause and replay.

  1. 1

    DSA Introduction

    What data structures and algorithms really are, why every big tech interview tests them, the 15 patterns that solve most problems, and the 6-step method you will use…

    5 min read
  2. 2

    Big O Notation

    Measure how an algorithm's work grows with input size. Learn O(1), O(log n), O(n), O(n log n), O(n²) and O(2ⁿ) with a live chart, how to read complexity…

    5 min read
  3. 3

    Arrays and Strings

    How arrays live in memory, why indexing is O(1) but inserting is O(n), linear search, in-place techniques, and classic string problems like palindromes and reversing words.

    5 min read
  4. 4

    Hashing: Hash Maps and Sets

    The most useful tool in DSA. How hash maps and sets give O(1) lookups, and the patterns they unlock: seen-before checks, counting, Two Sum, anagram groups and more.

    5 min read
  5. 5

    Two Pointers

    Solve sorted-array and pair problems in one pass with O(1) memory. Opposite-end pointers, slow and fast writer pointers, palindromes, removing duplicates and Container With Most Water.

    5 min read
  6. 6

    Sliding Window

    Solve "best contiguous subarray or substring" problems in O(n). Fixed-size windows, growing and shrinking windows, and the template behind longest substring, minimum window and more.

    5 min read
  7. 7

    Prefix Sums

    Precompute running totals once and answer any range sum in O(1). Then combine prefix sums with a hash map to count subarrays that sum to k, even with…

    4 min read
  8. 8

    Kadane’s Algorithm: Maximum Subarray

    Find the contiguous subarray with the biggest sum in one pass. The "extend or restart" idea behind Kadane's algorithm, the stock-trading variant, and maximum product.

    4 min read
  9. 9

    Binary Search

    Halve the search space every step for O(log n). The bug-free template, first and last positions, search insert position, rotated arrays, and "binary search on the answer".

    5 min read
  10. 10

    Sorting Basics

    Bubble, selection and insertion sort animated step by step, what stable sorting means, Python's built-in sort with custom keys, and when sorting first makes a problem easy.

    5 min read
  11. 11

    Merge Sort and Quick Sort

    The two classic O(n log n) sorting algorithms, animated. Divide and conquer, merging sorted halves, partitioning around a pivot, and Quickselect for the k-th largest element.

    5 min read
  12. 12

    Recursion

    Functions that call themselves, explained with a live call tree. Base cases, the call stack, the "trust the recursion" mindset, memoization, and classic problems like power, palindromes and…

    5 min read
  13. 13

    Backtracking

    Explore every choice with choose, explore, un-choose. Subsets, permutations, combination sum, generate parentheses and word search, with a live decision tree.

    5 min read
  14. 14

    Linked Lists

    Nodes connected by pointers. Build a linked list in Python, traverse, insert and delete, reverse it with three pointers (animated), merge two sorted lists, and use the dummy-node…

    5 min read
  15. 15

    Fast and Slow Pointers

    The tortoise and hare technique. Find the middle of a linked list, detect cycles and where they start, remove the n-th node from the end, and spot cycles…

    6 min read
  16. 16

    Stacks

    Last in, first out. Use Python lists as stacks, match brackets (animated), build a min stack, evaluate expressions, simplify file paths and decode strings.

    5 min read
  17. 17

    Monotonic Stack

    A stack kept in sorted order answers "next greater" and "previous smaller" questions in O(n). Daily temperatures, stock span, and the largest rectangle in a histogram.

    5 min read
  18. 18

    Queues and Deques

    First in, first out. Use collections.deque for O(1) queues, build a queue from two stacks, process things in order, and solve sliding window maximum with a monotonic deque.

    4 min read
  19. 19

    Binary Trees and Traversals

    Nodes with left and right children. Build trees in Python, watch inorder, preorder, postorder and level-order traversals, and solve depth, invert, diameter and path-sum problems with recursion.

    6 min read
  20. 20

    Binary Search Trees

    Trees kept in sorted order. Search and insert in O(log n) (animated), validate a BST with bounds, find the k-th smallest with inorder traversal, and the lowest common…

    6 min read
  21. 21

    Heaps and Priority Queues

    Always know the smallest item in O(1) and add or remove in O(log n). Python's heapq, max-heaps with negatives, top-k problems, merging k sorted lists and the running…

    5 min read
  22. 22

    Graphs: BFS and DFS

    Model networks of friends, cities and web pages. Adjacency lists, breadth-first and depth-first search animated, connected components, shortest paths in unweighted graphs, and cycle detection.

    6 min read
  23. 23

    Grid Problems (Flood Fill and BFS)

    Treat a 2D grid as a graph. Count islands with flood fill (animated), find the largest area, spread through a grid with multi-source BFS like rotting oranges, and…

    5 min read
  24. 24

    Topological Sort

    Order tasks so every prerequisite comes first. Kahn's algorithm with in-degrees (animated), the DFS version, detecting impossible cyclic dependencies, and the course schedule problems.

    5 min read
  25. 25

    Shortest Paths (Dijkstra)

    Find the cheapest route in a weighted graph. Dijkstra's algorithm with a heap (animated), why it needs non-negative weights, network delay time, cheapest flights with k stops, and…

    6 min read
  26. 26

    Dynamic Programming (1D)

    Dynamic programming without the fear. Remember answers instead of recomputing them. Memoization vs tabulation, climbing stairs and coin change animated, house robber, and a 4-step recipe that works…

    6 min read
  27. 27

    2D Dynamic Programming

    DP tables with rows and columns. Unique paths in a grid, longest common subsequence animated cell by cell, edit distance (how spell-checkers work) and the 0/1 knapsack.

    6 min read
  28. 28

    Greedy Algorithms and Intervals

    Make the best local choice and never look back. When greedy works (and when it fails), merging intervals animated, meeting rooms, non-overlapping intervals, jump game and gas station.

    6 min read
  29. 29

    The DSA Interview Playbook

    Everything in one place. A pattern cheat sheet that maps problem clues to techniques, a 6-step method for any coding interview, how to talk while you code, and…

    5 min read