Performance
performance
System Design
Database Indexing & Query Optimization
Indexes turn O(N) full-table scans into O(log N) lookups, but every index costs storage and slows writes. This lesson teaches how B-tree and hash indexes work, when to use composite or covering indexes, how to read an EXPLAIN plan, and the common indexing mistakes that cause production outages. By the end you can defend any indexing decision in an interview and diagnose a slow query in production.
Caching Fundamentals (Write-Through, Write-Back, Write-Around)
A cache is a small, fast store that holds copies of data so the next request does not pay the cost of fetching it from the source of truth. This lesson covers what a cache is, where it lives in a stack, the four read and write patterns you will be asked about (cache-aside, read-through, write-through, write-back, write-around), eviction policies, and the failure modes (stampedes, hot keys, stale data) that bite real systems. By the end you can pick a caching strategy and defend it in an interview.
Community
bisect Instead of sort() on Every Insert (Python)
I had a leaderboard insert loop running list.append + list.sort. Swapping to bisect.insort cut the loop from 4.2s to 0.14s on 50k inserts. The 5-line rewrite plus the keyed variant is here.
Streaming Aggregations With a Single Pass (JS)
Welford's online algorithm for mean and variance, plus a 30-line streaming p99 estimator. The version I use when the data does not fit in memory or arrives over WebSocket.
Server Components vs Client Components: When Each Wins
Server Components are the new default; Client Components are for interactivity and state. The boundary between them is where most beginner Next.js bugs live.
Generators, yield, and Lazy Pipelines
Generators turn a 4GB log-processing job into a 50MB one without changing the consumer code. Here is the mental model, the pipeline pattern I reuse, and the four traps that make hand-rolled generators leak.
Data Engineer Loop: The SQL Test That Wasn't Just SQL
A data engineering loop at a Series C analytics company. The SQL round looked like a standard SQL test. It was grading something else entirely.
N+1 Queries: Detection and Prevention
What an N+1 query is, why ORMs hide them, the four ways to fix them, and the simple logging change that has caught every N+1 I have shipped since I added it.
IntersectionObserver Batched With rootMargin
On a feed with 200 cards, creating one IntersectionObserver per card pushed our scroll frame to 14ms. This is the single shared observer with `rootMargin` prefetch and a batched callback that brought it back to 4ms.
Image Optimization on the Modern Web
Pick the right format, ship the right size, reserve the right space, and lazy-load below the fold. Most image perf wins live in the basics, not in fancy libraries.
Batch and Coalesce Fetch Calls in React
Twenty cards on a page each ask for /api/users/:id and you cut server load 20x with this 30-line dataloader. The batch fires on the next microtask; same id never goes over the wire twice.
asyncio Explained Without the Jargon
asyncio is a cooperative scheduler for I/O-bound code. async def marks a pause-able function, await is the pause point, and the event loop runs whichever coroutine is ready.
Core Web Vitals Without the Buzzwords
LCP, CLS, INP measure three real user-felt experiences: load, stability, responsiveness. Treat them as field truth, not Lighthouse scores to game.
The GIL: What It Actually Blocks
The GIL blocks parallel Python bytecode and nothing else. I/O, well-behaved C extensions, and multiprocessing all sidestep it. Here is how I tell GIL-bound code from code that just feels slow.
Garbage Collection in V8 Without the Mystique
The working engineer's tour of V8 GC: generational hypothesis, Scavenger for young space, Mark-Sweep-Compact for old, incremental marking, Orinoco's concurrent collector, and what application code can actually do.
Series C Hyper-Growth Loop: Speed Over Polish
A Series C hyper-growth loop where the rubric was 'can you ship next week, not in three months'. The shape, the pushback, and the offer that came in 36 hours.
SSR, CSR, SSG, ISR: Pick the Right One
Four rendering strategies, four cost profiles. Pick by data freshness and personalization needs, not by which acronym sounds most modern.
When I Stop Reaching for List Comprehensions
I love comprehensions, but I have learned the three cases where they cost more than they save: nested filtering, side effects, and big intermediate lists. Here is the pattern I switch to in each.
Frontend Engineer Loop at a Design-Centric Company
A 5 round frontend loop at a design-centric Series C SaaS. The CSS round, the rendering round, the design-system round, and what each one was actually grading.
MongoDB Aggregation Pipelines, by Example
Match, group, lookup, project, the four stages I use 90% of the time. Real pipelines for funnel analysis, leaderboard, and a one-stage join, with the gotchas that surprise SQL refugees.
CI/CD Pipelines: Stop Letting Them Rot
The maintenance habits that have kept my pipelines fast and trusted for years, the seven categories of rot I have actually seen, and the budget I run so the pipeline is treated as production code.
Connection Pooling, PgBouncer, and the Prisma Trap
What a connection pool actually does, why your Postgres falls over at 200 connections, where PgBouncer sits, and the prepared-statement bug that bites every Prisma team that adds it the wrong way.
LLM Fundamentals: Tokens, Context, and Cost
Tokens are not characters or words. Context is not free. Cost is per-token in both directions. The three fundamentals that determine 80% of how an LLM-backed feature performs and bills.
AWS Lambda Cold Starts: What Actually Helps
Where the cold-start time really comes from, the four levers that have moved my p99 down by hundreds of milliseconds, and the optimizations I have tried and abandoned because they did not pay back.
Debounce With Leading + Trailing Edges and a cancel() Method
The trailing-only debounce in every tutorial works for search inputs and breaks on click handlers. Here is the lodash-style version with leading edge, cancel(), and flush(), in 30 lines.
The Browser Rendering Pipeline in Five Stages
Parse, style, layout, paint, composite. Knowing which stage your code blocks is what turns DevTools performance traces from noise into action.
Database Indexes Explained with Real EXPLAIN Output
What an index actually is, how the planner picks one, and the EXPLAIN output I read every day. Postgres examples, real numbers, and the three indexing mistakes I keep finding in code review.
