Goal-based paths · 12 steps

DSA for backend engineers

The structures behind caches, job queues, schedulers, rate limiters, database indexes and dependency graphs, and what each operation really costs.

Who it is for
Backend developers who use maps, queues and indexes daily and want to know what happens underneath and when it breaks down.
By the end
You can explain the cost of the collections and indexes your services rely on and choose a structure for caching, queuing, scheduling and dependency resolution.
  1. Step 2: Dynamic arrays and buffers

    Request bodies, batches and result lists are dynamic arrays; growth and copying explain memory spikes.

  2. Step 3: Hash maps: caches, dedup and indexes

    In-memory caches, idempotency keys and deduplication are hash maps and sets; load factor and hashing explain their worst cases.

  3. Step 4: Queues and ring buffers

    Job queues, bounded buffers and log tails are FIFO structures; a ring buffer gives O(1) operations with fixed memory.

  4. Step 6: Sliding windows: rate limits and metrics

    Rate limiters and moving averages are sliding windows over time; the amortized argument explains why they stay cheap.

  5. Step 7: Trees, balanced trees and B-trees

    Database indexes are B-trees and ordered maps are balanced binary trees; balance is what keeps lookups logarithmic.

  6. Step 8: Priority queues: schedulers and timers

    Delayed jobs, timeouts and "next event" loops pop the earliest item repeatedly, which is what a heap does in O(log n).

  7. Step 9: Tries: prefixes and routing

    Autocomplete and longest-prefix routing tables are tries; their memory trade-off matters at scale.

  8. Step 10: Graphs and dependency order

    Build systems, migrations and service start-up order are topological sorts; a cycle is a configuration error you can detect.

  9. Step 11: Connectivity and grouping

    Merging duplicate accounts or clustering related records is union-find over pairwise links.

  10. Step 12: Combined structures

    LRU caches and randomized sets combine a hash map with a list or array, which the final module builds.