Skip to content
Optimal Lab

Data Structures & Algorithms

Spot the pattern, then watch each approach run and scale.

Sessions

Go in order. Each session is one idea you can drag, step and break.

  1. DSA #01

    Live

    Two Sum, three ways

    Step through brute force, two pointers and a hash map. Then scale n and see the gap.

    Open session →

  2. Interactive

    Live

    Hash map: group anagrams

    Give every word a key, then one lookup per word puts anagrams in the same bucket.

    Open session →

  3. Interactive

    Live

    Two pointers: most water

    Start at both ends and always move the shorter line. One pass instead of every pair.

    Open session →

  4. Interactive

    Live

    Sliding window

    Slide a fixed window and watch each step add one cell and drop one.

    Open session →

  5. Interactive

    Live

    Prefix sums: range sums in O(1)

    Build running totals once, then any range is one subtraction.

    Open session →

  6. Interactive

    Live

    Monotonic stack: next warmer day

    Keep the waiting days on a stack and answer each one the moment a warmer day arrives.

    Open session →

  7. Interactive

    Live

    Binary search

    Halve the search space and see why it takes log n steps.

    Open session →

  8. Interactive

    Live

    Fast and slow pointers

    Two pointers at different speeds find a cycle, and where it starts, with no extra memory.

    Open session →

  9. Interactive

    Live

    LRU cache

    A hash map plus a doubly linked list gives O(1) get, put and eviction.

    Open session →

  10. Interactive

    Live

    Merge overlapping intervals

    Sort by start, then each interval only needs comparing with the last merged one.

    Open session →

  11. Interactive

    Live

    Heap: top k of a stream

    Keep the k largest in a min-heap and reject most numbers with one comparison.

    Open session →

  12. Interactive

    Live

    Trees: let the children answer first

    Find a tree's depth one call at a time and watch the call stack grow and shrink with it.

    Open session →

  13. Interactive

    Live

    Trie: prefix lookups

    Walk one node per letter, then collect every word below.

    Open session →

  14. Interactive

    Live

    BFS vs DFS

    Run both on the same graph and compare the order they visit nodes.

    Open session →

  15. Interactive

    Live

    Union-find: connected groups

    Merge groups as edges arrive and tell instantly whether two items are connected.

    Open session →

  16. Interactive

    Live

    Topological sort

    Count prerequisites, start with the zeros, unlock the rest, and detect cycles.

    Open session →

  17. Interactive

    Live

    Dijkstra: shortest paths

    Settle the closest node, relax its edges, repeat.

    Open session →

  18. Interactive

    Live

    Backtracking: choose, explore, undo

    Walk a decision tree of take-or-skip choices and prune branches that can't work.

    Open session →

  19. Interactive

    Live

    Dynamic programming: coin change

    Fill a table from 0 upward so every answer is worked out once, and see where greedy goes wrong.

    Open session →

In production

Tools you can use

52 technologies across 19 live sessions. Same names in any language — pick a session to see how the idea maps to the real world.

Services, platforms, protocols and standards — not one stack.

Roadmap

Coming soon

A step-by-step path through the track, with sessions and practice at each stage.

  1. Stage 1

    Arrays & hashing

  2. Stage 2

    Two pointers & sliding window

  3. Stage 3

    Stacks, queues & linked lists

  4. Stage 4

    Trees & graphs

  5. Stage 5

    Dynamic programming

Projects

Coming soon

Build something real to lock in the skill.

  • Build an LRU cache
  • Autocomplete with a trie
  • Route finder with Dijkstra