Loading...

Master TypeScript.

TypeScript

TypeScript mastery exercises. Become your team's resident TypeScript expert.

20,228 learners
152 exercises
TypeScript Challenges

Put your TypeScript skills to the test. Practice by building popular open-source tools from scratch.

Build your own Shell
FREE THIS MONTH
This challenge is free until 1 April 2025!
Build your own Shell

A shell is a command-line interface that executes commands and manages processes. In this challenge, you'll build your own POSIX compliant shell that's capable of interpreting shell commands, running external programs and builtin commands like cd, pwd, echo and more.

Along the way, you'll learn about shell command parsing, REPLs, builtin commands, and more.

Print a prompt
Login via GitHub to view this stage
Handle invalid commands
Login via GitHub to view this stage
REPL
Login via GitHub to view this stage
The exit builtin
Login via GitHub to view this stage
The echo builtin
Login via GitHub to view this stage
The type builtin: builtins
Login via GitHub to view this stage
The type builtin: executable files
Login via GitHub to view this stage
Run a program
Login via GitHub to view this stage

Navigation

The pwd builtin
Login via GitHub to view this stage
The cd builtin: Absolute paths
Login via GitHub to view this stage
The cd builtin: Relative paths
Login via GitHub to view this stage
The cd builtin: Home directory
Login via GitHub to view this stage

Quoting

Single quotes
Login via GitHub to view this stage
Double quotes
Login via GitHub to view this stage
Backslash outside quotes
Login via GitHub to view this stage
Backslash within single quotes
Login via GitHub to view this stage
Backslash within double quotes
Login via GitHub to view this stage
Executing a quoted executable
Login via GitHub to view this stage

Redirection

Redirect stdout
Login via GitHub to view this stage
Redirect stderr
Login via GitHub to view this stage
Append stdout
Login via GitHub to view this stage
Append stderr
Login via GitHub to view this stage

Autocompletion

Builtin completion
Login via GitHub to view this stage
Completion with arguments
Login via GitHub to view this stage
Missing completions
Login via GitHub to view this stage
Executable completion
Login via GitHub to view this stage
Multiple completions
Login via GitHub to view this stage
Partial completions
Login via GitHub to view this stage
Build your own grep
Build your own grep

Learn about regular expressions and how they're evaluated. Implement your own version of grep in TypeScript.

Match a literal character
Login via GitHub to view this stage
Match digits
Login via GitHub to view this stage
Match alphanumeric characters
Login via GitHub to view this stage
Positive Character Groups
Login via GitHub to view this stage
Negative Character Groups
Login via GitHub to view this stage
Combining Character Classes
Login via GitHub to view this stage
Start of string anchor
Login via GitHub to view this stage
End of string anchor
Login via GitHub to view this stage
Match one or more times
Login via GitHub to view this stage
Match zero or one times
Login via GitHub to view this stage
Wildcard
Login via GitHub to view this stage
Alternation
Login via GitHub to view this stage

Backreferences

Single Backreference
Login via GitHub to view this stage
Multiple Backreferences
Login via GitHub to view this stage
Nested Backreferences
Login via GitHub to view this stage
Build your own HTTP server
Build your own HTTP server

HTTP is the protocol that powers the web. In this challenge, you'll build a HTTP server that's 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.

Bind to a port
Login via GitHub to view this stage
Respond with 200
Login via GitHub to view this stage
Extract URL path
Login via GitHub to view this stage
Respond with body
Login via GitHub to view this stage
Read header
Login via GitHub to view this stage
Concurrent connections
Login via GitHub to view this stage
Return a file
Login via GitHub to view this stage
Read request body
Login via GitHub to view this stage

HTTP Compression

Compression headers
Login via GitHub to view this stage
Multiple compression schemes
Login via GitHub to view this stage
Gzip compression
Login via GitHub to view this stage
Build your own Redis
Build your own Redis

Discover concurrent programming in TypeScript while also learning about TCP servers, network programming, and the Redis Protocol.

Bind to a port
Login via GitHub to view this stage
Respond to PING
Login via GitHub to view this stage
Respond to multiple PINGs
Login via GitHub to view this stage
Handle concurrent clients
Login via GitHub to view this stage
Implement the ECHO command
Login via GitHub to view this stage
Implement the SET & GET commands
Login via GitHub to view this stage
Expiry
Login via GitHub to view this stage

RDB Persistence

RDB file config
Login via GitHub to view this stage
Read a key
Login via GitHub to view this stage
Read a string value
Login via GitHub to view this stage
Read multiple keys
Login via GitHub to view this stage
Read multiple string values
Login via GitHub to view this stage
Read value with expiry
Login via GitHub to view this stage

Replication

Configure listening port
Login via GitHub to view this stage
The INFO command
Login via GitHub to view this stage
The INFO command on a replica
Login via GitHub to view this stage
Initial Replication ID and Offset
Login via GitHub to view this stage
Send handshake (1/3)
Login via GitHub to view this stage
Send handshake (2/3)
Login via GitHub to view this stage
Send handshake (3/3)
Login via GitHub to view this stage
Receive handshake (1/2)
Login via GitHub to view this stage
Receive handshake (2/2)
Login via GitHub to view this stage
Empty RDB Transfer
Login via GitHub to view this stage
Single-replica propagation
Login via GitHub to view this stage
Multi Replica Command Propagation
Login via GitHub to view this stage
Command Processing
Login via GitHub to view this stage
ACKs with no commands
Login via GitHub to view this stage
ACKs with commands
Login via GitHub to view this stage
WAIT with no replicas
Login via GitHub to view this stage
WAIT with no commands
Login via GitHub to view this stage
WAIT with multiple commands
Login via GitHub to view this stage

Streams

The TYPE command
Login via GitHub to view this stage
Create a stream
Login via GitHub to view this stage
Validating entry IDs
Login via GitHub to view this stage
Partially auto-generated IDs
Login via GitHub to view this stage
Fully auto-generated IDs
Login via GitHub to view this stage
Query entries from stream
Login via GitHub to view this stage
Query with -
Login via GitHub to view this stage
Query with +
Login via GitHub to view this stage
Query single stream using XREAD
Login via GitHub to view this stage
Query multiple streams using XREAD
Login via GitHub to view this stage
Blocking reads
Login via GitHub to view this stage
Blocking reads without timeout
Login via GitHub to view this stage
Blocking reads using $
Login via GitHub to view this stage

Transactions

The INCR command (1/3)
Login via GitHub to view this stage
The INCR command (2/3)
Login via GitHub to view this stage
The INCR command (3/3)
Login via GitHub to view this stage
The MULTI command
Login via GitHub to view this stage
The EXEC command
Login via GitHub to view this stage
Empty transaction
Login via GitHub to view this stage
Queueing commands
Login via GitHub to view this stage
Executing a transaction
Login via GitHub to view this stage
The DISCARD command
Login via GitHub to view this stage
Failures within transactions
Login via GitHub to view this stage
Multiple transactions
Login via GitHub to view this stage
Build your own BitTorrent
Build your own BitTorrent

Learn about .torrent files and the famous BitTorrent protocol. Implement your own BitTorrent client in TypeScript.

Decode bencoded strings
Login via GitHub to view this stage
Decode bencoded integers
Login via GitHub to view this stage
Decode bencoded lists
Login via GitHub to view this stage
Decode bencoded dictionaries
Login via GitHub to view this stage
Parse torrent file
Login via GitHub to view this stage
Calculate info hash
Login via GitHub to view this stage
Piece hashes
Login via GitHub to view this stage
Discover peers
Login via GitHub to view this stage
Peer handshake
Login via GitHub to view this stage
Download a piece
Login via GitHub to view this stage
Download the whole file
Login via GitHub to view this stage

Magnet Links

Parse magnet link
Login via GitHub to view this stage
Announce extension support
Login via GitHub to view this stage
Send extension handshake
Login via GitHub to view this stage
Receive extension handshake
Login via GitHub to view this stage
Request metadata
Login via GitHub to view this stage
Receive metadata
Login via GitHub to view this stage
Download a piece
Login via GitHub to view this stage
Download the whole file
Login via GitHub to view this stage
Build your own SQLite
Build your own SQLite

Learn about B-Trees, the foundation of every relational database. Explore TypeScript's API for reading/writing files, and handling custom file formats.

Build your own DNS server
Build your own DNS server

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.

Many more to come...
coming soon
We release new challenges based on user votes. Let us know what you'd like to see next!
challenge voting
Vote on upcoming challenges