A BitTorrent client
Bencode, trackers and the peer-to-peer protocol. Download a real file by talking to real peers.
Go · Python · Java
Build and parse UDP packets bit by bit. Resolve names by walking the hierarchy from the root servers.
Build it in your language
The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.
Every time you type a URL, something translates a name into an IP address by walking a worldwide hierarchy of servers. That something fits in a few hundred lines.
Here you build DNS packets bit by bit, send them over UDP and parse the response, including the name compression that trips everyone up. You'll finish resolving real domains starting from the root servers, without leaning on the system resolver.
8 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.
Build a DNS query byte by byte and send it over UDP.
Parse the header and sections, and decompress pointer-based names.
Iterative walk from the root servers, CNAMEs and several record types.
Honour TTLs and avoid repeated lookups.
Bencode, trackers and the peer-to-peer protocol. Download a real file by talking to real peers.
Go · Python · Java
Build a Model Context Protocol server from scratch with JSON-RPC, tools, and resources.
TypeScript · Python · Go
From raw bytes to a 200 response. Parse requests, manage connections and serve concurrent traffic.
Go · Python · C · Rust