Search

Lessons (20)

  • Arrays & Strings

    … See how arrays live in memory, why some operations are instant and others slow, and the essential string …

  • Two Pointers & Sliding Window

    Two techniques that turn many O(n²) array and string problems into O(n). Learn them with animated …

  • Big-O Notation Made Simple

    … The steepest curve explodes fastest. Big-O Name n = 1,000 → operations Example --- --- --- --- O(1) Constant 1 Array …

  • Heaps & Priority Queues

    … peek O(1), push/pop O(log n). - Stored in an array: children of i are 2i+1 …

  • Sorting Algorithms

    … 1. Divide: split the array in half until each piece has 1 item (a single item is already …

  • Stacks & Queues

    … Fine for small arrays; slow for big queues. An O(1) queue js class Queue { items = new Map …

  • Dynamic Programming

    … 5. Answer: dp[target] . js function coinChange(coins, amount) { const dp = new Array(amount + 1).fill(Infinity); dp …

  • Linked Lists

    … Learn how they differ from arrays, and master reversal, fast/slow pointers and cycle detection. The big idea …

  • Binary Search

    … tiny arrays: [] , [1] , [1, 2] , and a target smaller than, larger than, and missing from the array. Off …

  • Recursion & Backtracking

    … sum of nested arrays Recursion shines when the data itself is recursive (trees, nested lists, folders, JSON). js …

  • DSA Interview Patterns Cheat Sheet

    … If the problem says… Think… Typical complexity --- --- --- "sorted array", "find pair with sum" Two pointers O(n) "subarray …

  • React Fundamentals

    … Using the array index as the key causes bugs when items are reordered or removed. State: data that …

  • React Hooks in Practice

    … runs before the next effect and on unmount return () = window.removeEventListener("resize", onResize); }, []); // dependency array mermaid flowchart LR …

  • What Are Design Patterns?

    … app.use(middleware) in Express Chain of Responsibility array.sort((a, b) = a - b) Strategy for (const x …

  • L — Liskov Substitution Principle

    … outputs Don't loosen postconditions Parent returns an array → child can't return null Keep the parent's …

  • Hash Maps & Sets

    … right place](/img/dsa/hash-map.svg) Operation Array (unsorted) Hash map / Set --- --- --- Find by key/value O …

  • TypeScript Essentials

    … b; } longest("hello", "hi"); // ✅ strings have length longest([1, 2], [1, 2, 3]); // ✅ arrays have length longest(10 …

  • Database Indexing & Transactions

    … Hash Equality only GIN Full-text search, JSONB, arrays GiST Geospatial (PostGIS), ranges Partial WHERE status = 'active' only …

  • Behavioral Patterns II: Chain, Template, Iterator, Mediator, Memento, Visitor

    … ids.next().value; // 2 You've used it: arrays, Map , Set , for await (const chunk of stream) , paginated …

  • Structural Patterns: How to Connect Objects

    … loadMesh(name) }); // heavy return treeTypes.get(key); } // Light, unique data per object (extrinsic state) const forest = Array.from …