The IWTLP blog
- Build your own diff, the algorithm you stare at every day, Every code review, every git commit, every merge conflict is built on one algorithm: diff. Underneath the red and green lines is a classic dynamic-programming problem, the longest common subsequence. Build it in about 20 lines and the green-and-red will never look the same.
- The data race Rust refuses to compile, and the one line that fixes it, A data race is two threads touching the same memory at once, one of them writing. In most languages it compiles fine and corrupts your data at 3am. In Rust it is a compile error you cannot ship past. Write the race, watch the compiler stop you, and see exactly what it is protecting.
- How GPS finds you from four satellites, and why three is not enough, Your phone locates itself to a few meters using signals from space, and it needs exactly four satellites to do it, not three. The fourth is not for accuracy. It is there to fix a clock error that would otherwise put you a hundred kilometers off. Build the solver and watch the fourth satellite earn its place.
- Query API versus storage engine, the split that reshaped data infrastructure, The biggest shift in data engineering is not a faster database. It is prying the query layer apart from the storage layer so any engine can read the same files. Build a columnar store and a query API as two separate pieces and you will understand why open table formats took over 2026.
- Deadlocks, built on purpose and prevented four ways, A deadlock is two threads each holding what the other needs, frozen forever. It is one of the easiest concurrency bugs to create by accident and one of the hardest to reproduce. Build one on purpose in Java, watch it freeze, then fix it four different ways.
- How speculative decoding makes LLMs faster without changing a single output, A big model generating text one token at a time is slow because each token needs a full forward pass. Speculative decoding lets a tiny model guess several tokens ahead and the big model check them all at once, running two to three times faster while producing the exact same distribution. Build the acceptance rule and see why it is free.
- Newton's method, the root finder that doubles its accuracy every step, until it explodes, Newton's method finds the root of an equation so fast that the number of correct digits roughly doubles each iteration. It is inside your square-root function and your optimizer. It also fails spectacularly on innocent-looking inputs, and knowing when is the difference between a solver that works and one that returns infinity.
- How stealing one cookie bypasses multi-factor authentication, You turned on MFA, so an attacker with your password still cannot get in. Except they often do, without your password or your second factor, by stealing the session cookie you got after logging in. Build the flaw and the fix, and you will see why "pass the cookie" is the attack of the decade.
- The planetary energy budget, or how to compute Earth's temperature with one equation, You can estimate the average temperature of a planet from three numbers: how much sunlight it gets, how much it reflects, and one law of physics. Do it for Earth and you get a temperature 33 degrees too cold, and that gap is the entire greenhouse effect, measured.
- How LLM function calling actually works, and why the model never runs your code, Every AI agent in 2026 calls tools: it checks the weather, queries a database, books a flight. It feels like the model is running code. It is not. The model only ever emits text. Build the loop around it and the whole "agent" mystique collapses into about 20 lines.
- Sequence alignment from scratch, the algorithm behind every DNA comparison, When a biologist says two genes are 92 percent similar, some algorithm lined the sequences up first, and gaps and all, scored the match. That algorithm is Needleman-Wunsch, and it is a dynamic-programming table you can build in 20 lines. Build it and alignment stops being a black box.
- What a webshell is, and how to catch one in your own code, When attackers break into a web server, the first thing they leave behind is usually a webshell, a tiny file that turns an innocent URL into a command line. The concept is small enough to understand in one sitting, and once you understand it you can write a scanner that finds one.
- The haversine formula, or why you cannot just use Pythagoras on a map, Subtracting two GPS coordinates and running Pythagoras gives you a distance that can be hundreds of kilometers wrong. The Earth is round, and the fix is one classic formula. Build it, and see exactly how big the error you were making was.
- How a mixture of experts routes tokens, and why trillion-parameter models are cheap to run, The biggest models in 2026 have trillions of parameters but only touch a fraction of them per token. The trick is a router that sends each token to a few specialist sub-networks. You can build the routing in about 30 lines of numpy and see the economics for yourself.
- Build your own memory allocator, and watch fragmentation happen, malloc and free feel like a service the operating system provides. They are not. They are a data structure a library maintains over a slab of memory, and you can build a working one in about 60 lines of C. Do it and you will see fragmentation form in front of you.
- async/await, explained by building the executor underneath it, Rust's async finally feels ordinary in 2026, clean syntax, fast compiles, mandated for new systems code. But async has no magic runtime built in. You bring one. Build a tiny executor and a future by hand and the whole model stops being mysterious.
- Build your own regex engine, and see why some regexes hang forever, A regular expression is a machine, not a spell. Build one that compiles a pattern to a state machine and matches without ever backtracking, in about 40 lines of Python, and you will understand both how grep is fast and why some regexes can freeze a server.
- How a deserialization bug becomes remote code execution, in about 20 lines, In July 2026 attackers were remotely running code on unpatched Adobe ColdFusion servers through a deserialization flaw. The bug class is old and it is everywhere. You can reproduce the whole thing in Python in a few lines, and once you see it you never write it again.
- A synth from a sine wave, and the aliasing nobody warns you about, A sawtooth is just sine waves stacked at one over n. You can build one in three lines of numpy. Then you play a high note and it sounds like broken glass, because of a sampling-theorem trap that every naive oscillator falls into.
- The decision boundary is the weight vector, A single neuron is logistic regression, and there is geometry hiding in it. The weights are not just numbers, they are the boundary: their direction is its tilt and their length is its confidence. And the gradient that trains them is one of the cleanest results in machine learning.
- DNA to protein, by coding the central dogma, The most important process in biology is a lookup table and a sliding window. We transcribe DNA to RNA and translate it to a protein, in about thirty lines of Python.
- Window functions, the SQL most people skip, Running totals, rankings, and row-to-row differences without a self-join or a loop. Window functions are the SQL that turns three ugly queries into one clean one.
- How a map works, Mercator, tiles, and your GPS pin, Every slippy map turns a round planet into flat square tiles and drops your pin on the right pixel. We code the projection that makes it work, and see why Greenland looks huge.
- p-values, explained by simulation not tables, A p-value is not a lookup in the back of a textbook. It is a question you can answer by shuffling your data. We build the null distribution by hand and read the p-value straight off it.
- A web server from raw bytes, and the framing bugs nobody warns you about, Under every web framework is a function that turns a socket's bytes into a request and a request into bytes. Build it by hand and you meet the gotchas the framework was hiding: the blank-line frame, byte-vs-character length, and the difference between 404 and 405.
- How a scheduler decides who runs next, Your CPU runs one thing at a time but juggles hundreds. The scheduler picks the order, and the policy changes everything. We simulate FCFS and round-robin in C and measure the difference.
- The FFT, explained by building the slow one first, The Fast Fourier Transform is famous for its speed, but the idea is the slow version. We build the naive DFT, recover the frequencies in a signal, then see where the speed comes from.
- How a tokenizer works, by building byte-pair encoding, Before a language model sees your text, a tokenizer chops it into pieces. We build the BPE algorithm that GPT-style models use, and see why token count is your bill.
- Processes vs threads vs async, explained by running the same job three ways, Three ways to do many things at once, and they are not interchangeable. We run one workload as processes, threads, and async, and watch which one wins and why.
- What a convolution actually computes, The operation at the heart of image models is a tiny window sliding over data, multiplying and summing. We code it by hand and watch it find edges.
- What Rust lifetimes actually mean, The annotation everyone fears is just the compiler tracking how long a reference stays valid. We trigger the error, read it, and make the fix obvious.
- Auth bypass with one header, explained by building the bug, A July 2026 Gitea CVE let attackers log in as anyone with a single HTTP header. We rebuild the mistake in a tiny server, then fix it.
- Build your own programming language, A language is three passes, scan characters into tokens, parse tokens into a tree, walk the tree to run it. We build a tiny one with variables that actually executes.
- Build your own SQL database from scratch, A database is a parser, a storage layer, and an execution engine. We build all three in Python until real SELECT queries return rows.
- Prompt injection, explained by hijacking an AI agent's tools, AI agents that read untrusted text can be told what to do by that text. We build a tiny tool-using agent, make a web page steal its data, then fix it.
- Why your physics sim drifts, and when RK4 is the wrong fix, The naive way to step a simulation forward accumulates error until your orbit spirals into the sun. RK4 fixes the accuracy. But for long orbital runs RK4 is the wrong tool, and a lower-order method wins. Here is why.
- Expected goals (xG) from scratch, and why the scoreboard lies, Argentina lost their 2022 World Cup opener to Saudi Arabia, and everyone said Saudi were the better side. They weren't, not even close, and one number proves it. Here is expected goals built from scratch in about 150 lines of Python, honest about where it is brilliant and where it lies.
- k-means from scratch, and why it sometimes lies, k-means is the go-to clustering algorithm, two simple steps repeated until things settle. But the same data can give different clusters depending on where you start, and it will happily find groups that are not there. Here it is in R, honest about both.
- The KV cache, why LLM inference is memory-bound, not compute-bound, Everyone optimizes models for FLOPs, but when an LLM generates text, the bottleneck is usually memory, not math. The reason is a structure called the KV cache. Understanding it explains your token costs, your context limits, and why 2026's big wins are memory tricks.
- Build your own search engine, inverted index and TF-IDF, Full-text search feels like a problem only Google solves, but the core that powers every search box, including Elasticsearch, is two ideas, an inverted index and TF-IDF ranking. Both fit in about 30 lines of Python. Here they are.
- How SaaS data exfiltration works, the quiet breaches of 2026, The biggest data thefts of 2026 did not hit company servers. They drained SaaS platforms, Salesforce, Microsoft 365, CRMs, through legitimate access. Here is how attackers turn a granted permission into a mass export, and why it is so hard to spot.
- Simpson's paradox, and a detector for it in 20 lines, A trend can point one way in every subgroup and the opposite way once you pool the data. It nearly cost Berkeley a lawsuit. Here is the mechanism, a from-scratch detector, and why the detector is a smoke alarm and not a verdict.
- The bootstrap, confidence intervals without the formula, Statistics is full of formulas for confidence intervals, one per situation, each with assumptions you might be breaking. The bootstrap throws them all out and uses one idea instead, resample your data and watch. Here it is in a few lines of R.
- What WebAssembly actually is, and why it escaped the browser, WebAssembly started as a way to run fast code in the browser, but in 2026 it is running on servers, at the edge, and inside Kubernetes. The idea is a tiny, safe, portable stack machine. Here is what that means, and why it is suddenly everywhere.
- Rust's rewrite wave, why C is being replaced in the places that matter, Rust is now in the Linux kernel, in browsers, in databases, and in cloud infrastructure at Microsoft, Google, and Amazon. This is not hype, it is a deliberate migration with one motivation. Here is what is driving the rewrite, and what it is not.
- Virtual memory, the lie every program believes, Every program on your computer thinks it has the whole memory to itself, starting at address zero. That is a lie the operating system tells, and it is one of the most elegant tricks in computing. Here is how address translation actually works, in a few lines of C.
- Gradient descent, explained by rolling downhill, Every model you have heard of is trained by one algorithm, gradient descent. The idea is a ball rolling downhill to the lowest point, and it is about three lines of code. Here it is, from minimizing a parabola to fitting a line to data.
- They logged in, they didn't break in, how credential attacks really work, The biggest breaches of 2026 share a quiet pattern, the attackers didn't exploit a clever bug. They used a real login. Here is why credentials are the number-one way in, and the small set of defenses that actually close the door.
- Build your own shell, and learn how every program gets started, The terminal feels like deep magic, but a working shell is about 30 lines of C. Writing one teaches you the three system calls, fork, exec, and wait, that every operating system uses to run every program you have ever launched.
- Vectors are a data type now, and how nearest-neighbor search works, The 2026 shift is that you no longer need a separate vector database, Postgres, MongoDB, and the rest now treat vectors as a built-in type. Here is what "vector search" actually is, why brute force does not scale, and the idea behind the index that fixes it.
- Build your own bytecode VM, and see how languages really run, Python, Java, and C# do not run your source code directly, they compile it to bytecode and run that on a virtual machine. The VM sounds intimidating but its core is a loop over a stack. Here it is in about 30 lines, plus a tiny compiler to feed it.
- How AI agents talk to tools, and to each other, 2026 is the year agents went from demo to production, and the unglamorous reason is a protocol. Agents needed a standard way to plug into tools, the way USB-C standardized chargers. Here is what that protocol actually is, in plain JSON.
- How a map works, Mercator, tiles, and your GPS pin, Every slippy map you have ever dragged, Google Maps, OpenStreetMap, is built on two pieces of math, flattening a globe and chopping it into tiles. Both fit in a few lines of Python, and once you have them you will know exactly where your blue dot comes from.
- What durable execution is, and why it is moving into Postgres, Microsoft just open-sourced pg_durable, which runs durable workflows inside PostgreSQL. The phrase "durable execution" sounds like jargon, but the idea is one every backend eventually reinvents. Here it is, with a tiny checkpoint-and-replay engine you can read.
- Race conditions, explained by causing one, A race condition is the bug that passes every test and then corrupts data in production once a month. The fastest way to understand it is to write one on purpose, watch a counter lose count, and then fix it three ways.
- Why AI is getting smaller, not just bigger, The headlines chase ever-larger frontier models, but the quieter June 2026 trend is the opposite, tiny models that run on your laptop's CPU. Here is why small language models work, what quantization actually does, and the trade-off you are making.
- A Hopfield network from scratch, and why the textbook rule fails, Hand a Hopfield network a corrupted memory and it heals it back to perfect. The famous Hebbian rule is one line, but when I stored five real letters it recalled garbage. Here is the failure, why it happens, and the one-line fix.
- Anatomy of an npm supply-chain attack, and the OIDC trust that broke, In June 2026 attackers pushed malicious versions of 32 popular npm packages without stealing a single password. They stole a trust relationship instead. Here is exactly how the CI/CD pipeline was turned into a publishing key, step by step.
- Build your own JSON parser, and meet recursive descent, JSON looks too simple to have a parser, and that is exactly why it is the perfect first one to write. In about 60 lines of Python you will turn text into data structures using recursive descent, the same technique behind real language parsers.
- Defending your dependencies, and verifying a package hash yourself, After the June 2026 npm attack, "audit your dependencies" advice was everywhere. Most of it is vague. Here is the concrete version, including a ten-line Python script that verifies a package's integrity hash the same way your lockfile does.
- The borrow checker, explained by fighting it, Rust's borrow checker is the thing everyone bounces off first. But its rules come from one idea, and the errors it throws are teaching you a real bug that other languages would have let ship. Here it is, by deliberately writing the code that makes it complain.
- The three joins, explained by implementing them, Every database join you have ever run was one of three algorithms underneath: nested-loop, hash, or sort-merge. They are short enough to write in Python, and once you have written them you will know exactly why the query planner picks one over another.
- What an AI coding agent actually does, the loop behind the hype, Claude Code went from zero to the most-used AI coding tool in eight months. Underneath the demos is a loop simple enough to write on a napkin: act, observe, decide, repeat. Here is the actual loop, and why it, not the model, is what makes an agent.
- What attention really is, explained by coding it, Every model in the headlines, GPT, Gemini, Claude, is a transformer, and the heart of a transformer is one operation: attention. It is simpler than the diagrams suggest. Here it is in about fifteen lines of numpy, built up from the one idea.
- Why uv is so fast, and what a dependency resolver actually does, uv is one of the fastest-growing tools in Python, 80x faster than pip on a warm cache. The speed is real, but the interesting part is the problem it solves: dependency resolution is a search problem, and most people have no idea their installer is solving one.
- AI, ML, DL, GenAI, LLMs, RAG, and Agentic AI, explained, These terms get used interchangeably, but they are not the same. Here is the hierarchy, from the big umbrella of AI down to agentic systems, what each one means, and how they fit together.
- Quantum computing basics in Python, without the hype, Strip away the hype and quantum computing is linear algebra you can simulate in Python. Here are qubits, gates, superposition, measurement, and why it matters, with code.
- What Monte Carlo simulation is, across finance, physics, and engineering, Monte Carlo is one simple idea, use random sampling to answer hard questions, that shows up everywhere from option pricing to particle physics. Here is the idea, with code.
- Fortran is still alive in aerospace and HPC. Here is why., Fortran is often called dead, yet it still runs weather models, CFD solvers, and supercomputers. Here is why a language from 1957 refuses to retire, and why it is worth learning.
- Learn chemistry with Python, from stoichiometry to molecular simulation, Chemistry and code fit together better than most people expect. With Python you can balance reactions, compute pH, model equilibrium, and even run a small molecular simulation.
- Build your own Redis from scratch, and talk to it with the real redis-cli, I rebuilt Redis's core in about 80 lines of Python, the RESP protocol, GET and SET, expiry, INCR, and a real TCP server. The actual redis-cli connects to it and it just works. Here is the whole thing, plus how Redis survives a restart.
- PID control explained with a line-following robot, PID is the control algorithm behind thermostats, drones, and self-driving cars, and a line-following robot is the perfect way to understand it. Here is each term, intuitively, with code.
- The rocket equation explained by coding it, The Tsiolkovsky rocket equation explains why spaceflight is hard and why rockets have stages. It is one line of physics, and coding it makes the tyranny of the equation obvious.
- Build your own git from scratch, and watch its hashes match the real thing, I rebuilt git's core in about 150 lines of Python, blobs, trees, commits, branches, log, and diff. Then I checked it against real git and the hashes matched byte for byte. Here is the whole model, the proof it is really git, and how merge works on top of it.
- SQL injection explained safely with a toy login, SQL injection is the classic web vulnerability, and the safest way to understand it is to break a toy login you built yourself, then fix it the right way with parameterized queries.
- What embeddings are, explained by building one, Embeddings power search, recommendations, and modern AI, but the idea is simple: turn things into vectors so that similar things sit close together. Here is how, with code.
- Data science portfolio projects that are not toy notebooks, A Titanic notebook will not get you hired. Here is what a real data science project shows, handling messy data, avoiding leakage, honest validation, and a clear story.
- Orbital mechanics with Python, from circular orbits to Hohmann transfers, Orbital mechanics is more approachable than it looks. With a little Python you can compute orbital velocity, periods, and the classic Hohmann transfer between orbits.
- Cybersecurity with Python, what beginners should actually build, Forget memorizing tools. The way to learn security is to build the primitives yourself, encoding, hashing, HMAC, a log parser, and a tamper check, so you understand how attacks and defenses work.
- The Python projects that actually teach you to code, Most "beginner project" lists are filler. Here are the projects that build real foundations, control flow, collections, files, JSON, and objects, in an order that compounds.
- Backpropagation explained by coding it, Backprop sounds intimidating but it is just the chain rule applied backward through a computation. Build it once by hand and neural network training stops being magic.
- Learn robotics programming by simulating a robot first, You do not need to buy hardware to learn robotics. Simulate a robot and you can build pose, odometry, sensors, control, and path planning, the parts that actually transfer.
- "IWTLP is live: learn to code by building, graded for real", Most learn-to-code sites check your output against a hidden string, so you can pass without understanding. IWTLP runs your actual code on a real runtime and grades behavior, across 4,800+ build-from-scratch exercises in 19 disciplines. It is live on Product Hunt today.
- Machine learning from scratch, what to build before using scikit-learn, scikit-learn makes models one line of code, which is exactly why beginners stay confused. Build these few things by hand first and the whole field stops being a black box.
- SQL for data analysis, the 10 query patterns that matter, Most analytical SQL is a handful of repeating patterns. Master joins, group by, window functions, CTEs, cohorts, funnels, and retention, and you can answer almost any data question.
- Pandas vs SQL, when to use each, Pandas and SQL overlap a lot, so which should an analyst reach for? A practical comparison of where each one wins, with the same operations side by side.
- Why project-based learning beats watching tutorials, Tutorial videos feel productive but rarely make you able to code. Here is why building beats watching, what "tutorial hell" really is, and how to escape it.
- Encoding vs encryption vs hashing, explained simply, Three things beginners constantly mix up. Encoding is for format, encryption is for secrecy, hashing is for integrity. Here is the difference, when to use each, and the mistakes to avoid.
- How to learn Python in 2026 when AI can write code, AI can generate Python in seconds, so why learn it? Because you still have to read it, debug it, and know when it is wrong. Here is what actually matters to learn now, and what you can lean on AI for.
- The coding interview patterns, explained by building them, Most coding interview questions are variations on a small set of patterns. Here are the ones that matter, two pointers, sliding window, fast and slow pointers, binary search, heaps, backtracking, and dynamic programming, with the tell that signals each.
- How to actually learn data structures and algorithms, A practical, three-phase plan for learning DSA that sticks: build each structure from scratch, learn the patterns, and practice with instant feedback, instead of grinding random problems.
- Learn CUDA and GPU programming without owning a GPU, You do not need an NVIDIA card to understand GPU programming. Learn the CUDA model, threads, blocks, memory hierarchy, and parallel patterns by building them, all in your browser.
- Learn quantitative finance with Python from scratch, A grounded path into quant finance with Python, returns and risk, portfolios, options and the Greeks, Monte Carlo, and backtesting, learned by building each model yourself instead of importing a black box.