Search
Lessons (30)
- Sorting Algorithms
From simple bubble sort to merge sort and quick sort. See how each one works, compare their speeds …
- Two Pointers & Sliding Window
… pair with target sum (sorted array) js function pairWithSum(sorted, target) { let left = 0; let right = sorted.length …
- Binary Search
Find anything in a sorted list of a billion items in about 30 steps. Learn the classic algorithm …
- DSA Interview Patterns Cheat Sheet
… decision flowchart mermaid flowchart TD S([Read the problem]) -- A{Input sorted,<br/ or 'find in sorted'?} A …
- Indexes, EXPLAIN & Query Plans
Design indexes from real filter, join and sort patterns, then prove improvements with query plans and production-like …
- Big-O Notation Made Simple
… the problem is cut in half every step function binarySearch(sorted, target) { let lo = 0, hi = sorted.length …
- Heaps & Priority Queues
… Top K ⭐ "Find the k largest numbers in a stream of a million numbers." Sorting is O(n …
- Arrays & Strings
… Iterate backwards or use filter . - sort() sorts as strings by default: [10, 9, 1].sort() → [1, 10, 9 …
- Database Indexing & Transactions
… Because the keys are sorted , B-trees also make ORDER BY , BETWEEN and / < fast. Creating and checking indexes …
- Trees & Binary Search Trees
… Root → Right 4, 2, 5, 1, 3 BST → sorted order Post-order Left → Right → Root 4, 5, 2 …
- Graphs: BFS & DFS
… path, nearest X, levels Cycles, connected components, topological sort, mazes, backtracking Both run in O(V + E) : every …
- SQL Interview Query Drills
… Ask whether the interviewer instead wants one row or the third row after sorting; the query differs.
- Consumers & Consumer Groups
… A team can split the pile so each person takes a few mail bags, and nobody sorts the …
- SQL Language, Identifiers & Data Types
… UNION vs UNION ALL UNION removes duplicates, usually with sort/hash work. UNION ALL returns every row and …
- N+1 Queries, Loading & Pagination
… it with an index matching the filter and sort, such as orders(customer id, created at DESC, id …
- Behavioral Patterns I: Observer, Strategy, Command, State
… You use it every time you write: js users.sort((a, b) = a.age - b.age); // sorting strategy …
- REST API Design
… Paginate, filter and sort lists Never return an unbounded list; one day it will be a million rows …
- Caching & Redis
… recent activity Set SADD , SISMEMBER Unique visitors, tags Sorted set ZADD , ZRANGE , ZREVRANK Leaderboards , priority queues, time windows …
- What Are Design Patterns?
… use(middleware) in Express Chain of Responsibility array.sort((a, b) = a - b) Strategy for (const x of …
- Comments & Formatting
… help Type Example --- --- Why (a decision) // Use insertion sort: lists here are always < 10 items and it's …
- Meaningful Names
… a short loop or (a, b) in a sort comparator. Rule 4: One word per concept Pick one …
- Hash Maps & Sets
… for (const word of words) { const key = [...word].sort().join(""); // "eat" → "aet" if (!groups.has(key)) groups.set …
- Linked Lists
… front removes that special case. js // Merge two sorted lists: 1→3→5 + 2→4 → 1→2→3 …
- Pods
… sh shell inside the container kubectl get events --sort-by=.lastTimestamp mermaid flowchart TD P{Pod not healthy …
- SQL vs NoSQL Databases
… ISODate("2026-09-28T10:00:00Z") } db.orders.find({ "customer.email": "ana@mail.com" }).sort({ createdAt: -1 }); 💡 Model …
- Kafka Producers
… A postal worker doesn't drive to the sorting office for every single letter. They collect letters in …
- CQRS & Event Sourcing
… req.user.id }).sort({ placedAt: -1 })); }); The catch: eventual consistency The read model updates a moment after the …
- Helm, kubectl Cheat Sheet & Best Practices
… kubectl top nodes Recent events kubectl get events --sort-by=.lastTimestamp Dry run + diff kubectl diff -f app …
- React Hooks in Practice
… remember expensive things jsx // Remember an expensive calculation until its inputs change const sortedProducts = useMemo( () = products.toSorted((a …
- Behavioral Patterns II: Chain, Template, Iterator, Mediator, Memento, Visitor
… songs) yield song; } shuffled() { const copy = [...this.songs].sort(() = Math.random() - 0.5); yield copy; } } const playlist = new …