Projects · 21 ready

Pick a project to build.

Each one is a real tool, built step by step in your own editor and language. Each step comes with the concepts it teaches and the best places to learn them.

From Coding Challenges by John Crickett

21 projects

Text and streams

6 projects

Shared ideas: text encoding · streaming in constant memory · the command-line contract

Challenge #1Not yet checked
stdin · any sizechunkchunkrestbuffer · 8 KBmemoryflat

wc

A command-line program that counts the bytes, lines, words and characters in a file, or in whatever is piped into it, and matches the Unix wc tool. It is small to write, but getting every count right forces you to understand how text is really stored and how a program reads input it can't hold all at once.

You'll learn text encoding, streaming in constant memory, counting words with a state machine

Challenge #4Not yet checked
one line at a time, split on tabsidnamecity1AdaLeeds2LinPunenameAdaLinfield 2 only

cut

A command-line program that prints chosen fields from each line of a file, or of whatever is piped into it, and matches the Unix cut tool. Building it teaches how plain text holds a table as records and fields, why splitting on a delimiter stops working once real CSV quoting shows up, and how small tools that handle one line at a time join into pipelines.

You'll learn records, fields and delimiters, why splitting on the delimiter breaks real CSV, line-at-a-time streaming in constant memory

Challenge #6Not yet checked
lines inin ordercompare

Sort Tool

A command-line program that sorts the lines of a file like the Unix sort tool, drops repeated lines with -u, lets you choose the sorting algorithm, and can put lines in a random order while keeping identical ones together. Building several algorithms behind one interface teaches what sorting really costs, why stability and the choice between byte order and a language's alphabetical order change the output, and how a real sort copes with files bigger than memory.

You'll learn comparison sorting and what it costs, merge sort, quicksort and heapsort, radix sort

Challenge #9Not yet checked
500patternGET /home 200POST /login 500GET /about 200GET /api 500printed

grep

A command-line program that prints the lines of a file, a folder tree or piped input that match a pattern, and says through its exit code whether anything matched, like the Unix grep tool. You can lean on a regular-expression library or write the matching engine yourself, and either way you learn what a pattern really is: a small language that is parsed into a structure and run as a machine over every line.

You'll learn regular expressions as machines, the pattern is a language, character classes and anchors

Challenge #13Not yet checked
old filenew filea−bcdacd+ekeep what matches, mark the rest

diff

A command-line tool, like the Unix diff, that compares two text files and prints the lines removed from the first and the lines added in the second. Building it teaches the longest common subsequence and the dynamic programming table behind it, how a diff is derived from it, and why real tools switch to faster algorithms when files get large.

You'll learn longest common subsequence, dynamic programming, edit scripts

Challenge #87Not yet checked
stringcodecomment/**/""

Code Comment Remover

A command-line program that reads a source file and prints it again with the comments removed and everything else exactly as it was, for five languages with three styles of comment, while keeping the comments that tools rely on. Building it teaches how a scanner keeps track of where it is in the text, why searching for comment markers breaks as soon as one sits inside a string, and how the same stream of tokens sits under compilers, minifiers and formatters.

You'll learn A scanner is a state machine, each language has its own lexical rules, removing only the comments

Parsing and interpreters

3 projects

Shared ideas: grammars · lexing · recursive descent

Challenge #2Not yet checked
{"ok": [1, 2]}{"ok":[1,2]}text in, tokens out

JSON Parser

A program that reads a file and says whether it is valid JSON, exiting with 0 if it is and 1 if it isn't, with a message that helps fix the problem. Building it step by step teaches the two stages every parser and compiler has, breaking text into tokens and then checking them against a grammar, and how a precise specification settles every edge case.

You'll learn grammar and parsing, strings, numbers

Challenge #7Not yet checked
(1 + 2) × 3(1+2)×3numbers, operators, brackets

Calculator

A program that takes an arithmetic expression as text, a mix of numbers, the four basic operators and parentheses, and prints its value. Getting every answer right teaches how any program reads a language with operators: breaking text into tokens, deciding which operator binds tighter, rewriting the expression into a form a stack can evaluate, and choosing how numbers and bad input are handled.

You'll learn tokenising an expression, operator precedence and associativity, infix, postfix and the shunting-yard algorithm

Challenge #81Not yet checked
program++>++[<+>-]00000000tape: every cell starts at 0pointer

Brainfuck Interpreter

An interpreter for Brainfuck, a tiny language of eight one-character commands, that grows into a compiler to bytecode and a virtual machine to run it, then gets many times faster through optimisation. Because the language is so small, nothing hides the machinery every interpreter shares: memory and a program counter, loops resolved before the program runs, and speed won by doing more work per instruction and measured with care.

You'll learn the read-eval-print loop, the machine, fetch, decode, execute

Bits and hashing

3 projects

Shared ideas: bits and bytes · hash functions · reading files in chunks

Challenge #3Not yet checked
0101efrequenttqrareshort codes for common letters

Compression Tool

A command-line tool that compresses a file with Huffman coding and decompresses it back to an exact copy. Building it teaches why data whose symbols appear unevenly fits in fewer bits, how a greedy algorithm builds the best prefix-free code for those counts, and how to design a binary file format that packs bits into bytes and carries everything needed to decode it.

You'll learn symbol frequencies and entropy, prefix-free codes and unambiguous decoding, building the tree greedily with a priority queue

Challenge #53Not yet checked
catthree hashes0010000100001000bit array

Spell Checker with a Bloom Filter

A command-line spell checker that builds a Bloom filter from a dictionary, saves it as a compact binary file, and loads it again to report the words that are probably misspelt. Building it teaches how a set can answer membership questions in a few bits per item by accepting rare false positives but never a false negative, how to size the filter for the error rate you can live with, and how to design a binary file format that another run of the program can trust.

You'll learn probabilistic membership, sizing the filter from the item count and the error rate, hash functions for a filter

Challenge #75Not yet checked
a.jpg9f2c…b.jpg41ab…c.jpg9f2c…samecontent

Duplicate File Finder

A command-line tool that walks a directory tree, finds files whose contents are identical, and offers to delete the extra copies. Building it teaches how to narrow a huge set of candidates with checks that grow from cheap to costly, what a content hash can and can't prove, how to walk a real file system full of links and errors, and how to delete files without ever losing the only copy.

You'll learn narrowing candidates from cheap checks to costly ones, content hashes and collisions, grouping records by a key with a hash map

Networking and the web

6 projects

Shared ideas: HTTP · sockets · status codes · idempotency

Challenge #12Not yet checked
long linkexample.com/blog/2026/how-dns-worksvisitor/x7Kqredirectshort code

URL Shortener

A small web service, like bit.ly, that turns a long URL into a short code, redirects anyone who opens the short link, and lets a link be deleted. It's an introduction to designing an HTTP API: choosing methods and status codes, generating short keys that don't clash, keeping data safe across restarts, and making requests safe to repeat.

You'll learn HTTP, the API contract, short keys

Challenge #11Not yet checked
browseryour serverGET /200 OKone request, one response

Web Server

A small HTTP/1.1 server written directly on sockets that serves files from a folder, answers many clients at once and refuses to hand out anything outside that folder. Building it shows what every web framework hides: how a request arrives as bytes on a connection, how the server knows where it ends, how a URL safely becomes a file, and how one program keeps many slow clients moving.

You'll learn sockets and the life of a connection, the HTTP/1.1 message, status codes and the headers a response needs

Challenge #100Not yet checked
clientecho serverhellohellobytes in, the same bytes back

Echo Server

A server that sends back every byte a client sends it, first over TCP and then over UDP, following the one-page Echo Protocol in RFC 862. Building it teaches what sits under every network service: how a connection is accepted and how its end shows up, why TCP delivers a stream of bytes rather than messages, how one program serves many clients at once, and how it stops without losing data.

You'll learn sockets and the life of a connection, TCP is a byte stream, not a series of messages, serving many clients

Challenge #40Not yet checked
your curla serverrequestheadersthis time you are the client

curl

A command-line HTTP client like curl, written directly on a TCP connection: it takes a URL, writes an HTTP/1.1 request by hand, reads the response off the connection and supports GET, DELETE, POST and PUT. Building it shows what every HTTP library hides: how a URL becomes an address and a request line, how a client knows where a response ends, what each method promises, and why a tool keeps its data and its diagnostics apart.

You'll learn URLs, writing an HTTP/1.1 request, reading a response from a stream

Challenge #22Not yet checked
resolverDNS serverqueryanswerone small UDP packet each way

DNS Resolver

A command-line tool that turns a host name into an IP address by building DNS messages byte by byte, sending them over UDP and decoding the binary replies, and that ends by walking the name tree itself, from a root server down to the server that owns the answer. Building it teaches how a binary protocol is laid out, how a request and its reply find each other with no connection between them, and how the internet's naming system is split across many servers that each know only who to ask next.

You'll learn the DNS message, byte order and bit fields, domain names on the wire

Challenge #77Not yet checked
about.mdthemebuildabout.htmlpublic/

Static Site Generator

A command-line tool in the style of Hugo that sets up a site project, keeps each page as Markdown and the look in a theme, builds them into plain HTML files ready for any web host, and runs a development server that refreshes the browser on every save. Building it teaches why content, presentation and output are kept apart, why a template must escape the text it inserts, what a Markdown converter does underneath, and how a build decides what to redo when one file changes.

You'll learn generating a folder tree you can safely run twice, separating content, presentation and output, from page names to files, URLs and links

Storage and traffic

3 projects

Shared ideas: append-only writes · in-memory indexes · many clients at once

Challenge #27Not yet checked
refillrequestsallowed429

Rate Limiter

A small HTTP service with one open endpoint and one protected endpoint that limits how often each client may call it, built with four algorithms in turn and then shared across several servers. Building it teaches what each algorithm trades between bursts, accuracy and memory, how a service tells a client to slow down, why measuring time is harder than it looks, and why counters shared between servers need atomic updates.

You'll learn why services limit rates, and who counts as one client, the token bucket, fixed windows and the burst at the boundary

Challenge #8Not yet checked
clientin memoryname adahits 41GET nameadacommands in, replies out

Redis Server

A small server that speaks the Redis wire protocol, so the real redis-cli and redis-benchmark can talk to it, and stores strings, counters and lists with optional expiry and a snapshot on disk. Building it teaches how a protocol marks where each message ends on a TCP stream, how one process serves many clients without corrupting shared data, how keys expire cheaply, and how a snapshot survives a restart.

You'll learn RESP, framing messages on a TCP byte stream, command dispatch and error replies

Challenge #96Not yet checked
index in memorynameagecitynameagenamenewlog on disk · only appended to

Bitcask

A key-value store, driven from the command line, that keeps its data in a folder of append-only log files and finds each value through an in-memory index of positions, following the design of Bitcask, the storage engine from the Riak database. Building it teaches what it takes for data to be truly saved, how to lay out records on disk so that a crash can't fool the reader, and how updates, deletes, file rotation and compaction work when nothing is ever overwritten.

You'll learn durability and what the operating system buffers, the append-only log and sequential writes, record framing on disk

Beyond these 21

88 more challenges are waiting on Coding Challenges.

John Crickett has published 109 challenges, from a shell to a BitTorrent client. These 21 are the first with ThinkAloud maps, and more are being written. The rest are on the original site to build on your own.

  • Rate Limiter
  • Web Server
  • Redis Server
  • Shell
  • Git
  • Docker
Browse all 109 challenges ↗