Part 1 of 14

Linear Data Structures

Arrays, dynamic arrays, strings, hash maps, hash collisions, stacks, queues, deques, matrix manipulation. The vocabulary every interview problem assumes you have.

Chapters
8
Hours
2
Difficulty
Beginner
  1. 1.0beginner

    Arrays: static, dynamic, multi-dimensional

    Arrays: contiguous memory, O(1) indexing, and the operations that differ between fixed-size arrays and dynamic arrays.

    10 min
  2. 1.1intermediate

    Dynamic array internals

    How dynamic arrays grow: amortised O(1) append, the doubling trick, capacity vs length, and what each language calls them.

    15 min
  3. 1.2beginner

    Strings: encoding, immutability, builders

    Strings as character arrays and beyond: immutability, encoding, concatenation cost, and the per-language trade-offs that catch interviews out.

    15 min
  4. 1.3intermediate

    Hash maps and hash sets

    Hash maps from first principles: hash functions, buckets, average vs worst-case complexity, and the standard library implementations.

    20 min
  5. 1.4advanced

    Hash collisions and the load factor

    Hash collisions: separate chaining, open addressing, load factor, rehashing, and why hash maps degrade to O(n) under adversarial keys.

    20 min
  6. 1.5beginner

    Stacks and the call stack analogy

    Stacks as data structures and algorithmic primitives: LIFO, function-call stacks, and the interview problems that scream 'stack'.

    20 min
  7. 1.6intermediate

    Queues, deques, and circular buffers

    Queues and deques: FIFO, double-ended, ring buffers, and the BFS / sliding-window problems where the right primitive is a deque.

    15 min
  8. 1.7intermediate

    Matrix manipulation

    2D arrays and matrix manipulation: in-place rotation, transposition, spiral traversal, and indexing without off-by-one bugs.

    15 min