Python mastery exercises. Become your team's resident Python expert.
Put your Python skills to the test. Practice by building popular open-source tools from scratch.
A shell is the program that interprets what you type into the terminal. It reads your commands, runs programs, and prints their output. Popular examples are Bash and ZSH.
In this challenge, you'll build your own shell from scratch.
Your shell will run a REPL, parse commands, spawn processes, and more.
Discover concurrent programming in Python while also learning about TCP servers, network programming, and the Redis Protocol.
Learn about regular expressions and how they're evaluated. Implement your own version of grep in Python.
This challenge follows the book Crafting Interpreters by Robert Nystrom.
In this challenge you'll build an interpreter for Lox, a simple scripting language. Along the way, you'll learn about tokenization, ASTs, tree-walk interpreters and more.
Before starting this challenge, make sure you've read the "Welcome" part of the book that contains these chapters:
These chapters don't involve writing code, so they won't be covered in this challenge. This challenge will start from chapter 4, Scanning.
Learn about .torrent files and the famous BitTorrent protocol. Implement your own BitTorrent client in Python.
Apache Kafka is a distributed event streaming platform often used for high-performance data pipelines. In this challenge, you'll build your own Kafka broker that's capable of serving basic requests.
Along the way you'll learn about TCP servers, the Kafka wire protocol and more.
Dive into the internals of Git. Discover how Git stores and moves around data, its transfer protocols, and more. A unique exercise in making network requests with Python.
Learn about B-Trees, the foundation of every relational database. Explore Python's API for reading/writing files, and handling custom file formats.
DNS is a protocol used to resolve domain names to IP addresses. In this challenge, you'll build a DNS server that's capable of responding to basic DNS queries.
Along the way you'll learn about the DNS protocol, DNS packet format, DNS record types, UDP servers and more.
HTTP is the protocol that powers the web. In this challenge, you'll build a HTTP server from scratch using TCP primitives. Your server will be capable of handling simple GET/POST requests, serving files and handling multiple concurrent connections.
Along the way, we'll learn about TCP connections, HTTP headers, HTTP verbs, handling multiple connections and more.
Why does "The capital of France is" always continue with the same words?
GPT-2 gives every possible next token a score, picks the highest, and repeats. An inference engine is a program that loads a trained model's weights, the tables of numbers it learned, and does the arithmetic that turns a prompt into the next token. You'll build one for GPT-2, run its real 548 MB weight file, and continue a prompt with the same tokens. Your engine will also sample tokens by probability and cache past keys and values.
You'll practice slicing rows out of flat tensor lists, implementing attention and the transformer block, and sampling from a distribution.
Why do attacks still reach an application that runs behind a firewall?
A rule matches raw bytes. The application decodes them first, so an encoded payload such as %3Cscript%3E can still run as a script. You'll build a firewall that forwards HTTP traffic, removes connection-specific headers, matches attack rules against decoded request inputs, scores their signals, and weighs that score with a supplied detector's verdict under per-route thresholds. Later stages withhold leaky responses and patch an export endpoint that trusts its caller.
You'll practice proxying, normalization, threshold tuning, and failure handling.
Claude Code is a terminal-based AI coding assistant that uses Large Language Models (LLMs) to understand code and complete programming tasks. In this challenge, you'll build your own Claude Code that is capable of editing files, running commands, and iterating until the task is done.
Along the way, you'll learn about LLM APIs, tool calling, agent loops, and how to integrate multiple tools into an AI assistant.
Why does GPT-2 split strawberry into three tokens, but keep strawberry as one?
Its tokenizer converts text into token IDs, the numbers the model receives. Its learned vocabulary includes the space-prefixed word as one token, while the unspaced word uses smaller pieces. You'll build a tokenizer that learns merge rules from text, encodes and decodes text, and loads GPT-2's vocabulary to match its IDs.
You'll learn how UTF-8 represents text as bytes, how byte-pair encoding learns merges, and why token boundaries depend on whitespace.
Ananthalakshmi Sankar
Automation Engineer at Apple
“
I think the instant feedback right there in the git push is really cool.
Didn't even know that was possible!
Patrick Burris
Senior Software Developer, CenturyLink