Search
Lessons (33)
- 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 …
- JavaScript Language Fundamentals
… values vs references, equality and coercion, let/const scope, functions, objects and prototypes, classes, modules, array methods and …
- 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 …
- Go Fundamentals
… modules and packages, variables and zero values, strings and runes, arrays, slices and maps, functions, structs, pointers, methods …
- 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 …
- Inheritance
… use composition Stack → Array A stack is not an array (you shouldn't insert in the middle) ❌ No …
- 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 …
- Async JavaScript: Promises, async/await and Node's Event Loop
… array.forEach(async …) forEach doesn't wait; errors are lost for…of with await , or Promise.all(array …
- TypeScript in Practice
… placeholders filled in when the function is used. ts // T is "whatever the array holds" function first<T …
- 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 …
- Month 1: Data, Math Intuition and Classic ML (Weeks 1-4)
… create arrays, reshape, slice, vector math and broadcasting. Rewrite a Python loop as a vectorized operation and time …
- Encapsulation
… of every internal detail. Common mistakes - Returning internal arrays or objects directly. Callers can then change them. Return …
- Object Relationships: Association, Aggregation and Composition
… composed parts. If House returns its internal rooms array, callers can change the house's insides. Return copies …
- TypeScript Essentials
… b; } longest("hello", "hi"); // ✅ strings have length longest([1, 2], [1, 2, 3]); // ✅ arrays have length longest(10 …
- Choosing a Programming Language
… i64] ) instead of taking it, and TypeScript chains array methods. Languages vs frameworks A framework is a tool …
- 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 …
- Rust: Ownership, Borrowing and Lifetimes
… fn average(xs: &[f64]) - f64 { // works for Vec, arrays, and slices of them xs.iter().sum::<f64 () / xs …
- Month 2: Deep Learning, PyTorch and Transformers (Weeks 5-8)
… PyTorch fluency Learn - A tensor is a NumPy-like array that can live on a GPU and track …
- A WhatsApp OTP Is Only Single Use If You Make It So
… code } = await issueOtp(); const results = await Promise.all( Array.from({ length: 50 }, () = verifyOtp(userId, code)), ); expect(results.filter …
- Practical Lab: S3 File Upload and CloudFront Delivery with NestJS
… string string[]) { const fullKey = Array.isArray(key) ? key.join('/') : key; if (!fullKey.startsWith('uploads/')) { throw new BadRequestException('Invalid …