Loading...

Master Dart.

Dart

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

205 exercises
Dart Challenges

Put your Dart 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 July 2026!
Build your own Shell

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.

Print a prompt
Login via GitHub to view this stage
Handle invalid commands
Login via GitHub to view this stage
Implement a REPL
Login via GitHub to view this stage
Implement exit
Login via GitHub to view this stage
Implement echo
Login via GitHub to view this stage
Implement type
Login via GitHub to view this stage
Locate 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

Command Completion

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

Filename Completion

File completion
Login via GitHub to view this stage
Nested file completion
Login via GitHub to view this stage
Directory completion
Login via GitHub to view this stage
Missing completions
Login via GitHub to view this stage
Multiple matches
Login via GitHub to view this stage
Partial completions
Login via GitHub to view this stage
Multi-argument completions
Login via GitHub to view this stage

Programmable Completion

Register complete builtin
Login via GitHub to view this stage
Printing missing specifications
Login via GitHub to view this stage
Displaying registered specifications
Login via GitHub to view this stage
Single completion
Login via GitHub to view this stage
Handling no completions
Login via GitHub to view this stage
Passing command-line arguments
Login via GitHub to view this stage
Passing environment variables
Login via GitHub to view this stage
Multiple completer candidates
Login via GitHub to view this stage
Longest common prefix
Login via GitHub to view this stage
Unregister a completion
Login via GitHub to view this stage

Background Jobs

The jobs builtin
Login via GitHub to view this stage
Starting background jobs
Login via GitHub to view this stage
Printing background job output
Login via GitHub to view this stage
List a single job
Login via GitHub to view this stage
List multiple jobs
Login via GitHub to view this stage
Reap one job
Login via GitHub to view this stage
Reap multiple jobs
Login via GitHub to view this stage
Reap before the next prompt
Login via GitHub to view this stage
Recycle job numbers
Login via GitHub to view this stage

Pipelines

Dual-command pipeline
Login via GitHub to view this stage
Pipelines with built-ins
Login via GitHub to view this stage
Multi-command pipelines
Login via GitHub to view this stage

History

The history builtin
Login via GitHub to view this stage
Listing history
Login via GitHub to view this stage
Limiting history entries
Login via GitHub to view this stage
Up-arrow navigation
Login via GitHub to view this stage
Down-arrow navigation
Login via GitHub to view this stage
Executing commands from history
Login via GitHub to view this stage

History Persistence

Read history from file
Login via GitHub to view this stage
Write history to file
Login via GitHub to view this stage
Append history to file
Login via GitHub to view this stage
Read history on startup
Login via GitHub to view this stage
Write history on exit
Login via GitHub to view this stage
Append history on exit
Login via GitHub to view this stage

Parameter Expansion

The declare builtin
Login via GitHub to view this stage
Printing missing variables
Login via GitHub to view this stage
Storing shell variables
Login via GitHub to view this stage
Validating variable names
Login via GitHub to view this stage
Expanding variables
Login via GitHub to view this stage
Expansion with braces
Login via GitHub to view this stage
Expanding empty variables
Login via GitHub to view this stage
Build your own Redis
Build your own Redis

Discover concurrent programming in Dart 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

Lists

Create a list
Login via GitHub to view this stage
Append an element
Login via GitHub to view this stage
Append multiple elements
Login via GitHub to view this stage
List elements (positive indexes)
Login via GitHub to view this stage
List elements (negative indexes)
Login via GitHub to view this stage
Prepend elements
Login via GitHub to view this stage
Query list length
Login via GitHub to view this stage
Remove an element
Login via GitHub to view this stage
Remove multiple elements
Login via GitHub to view this stage
Blocking retrieval
Login via GitHub to view this stage
Blocking retrieval with timeout
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

Optimistic Locking

The WATCH command
Login via GitHub to view this stage
WATCH inside transaction
Login via GitHub to view this stage
Tracking key modifications
Login via GitHub to view this stage
Watching multiple keys
Login via GitHub to view this stage
Watching missing keys
Login via GitHub to view this stage
The UNWATCH command
Login via GitHub to view this stage
Unwatch on EXEC
Login via GitHub to view this stage
Unwatch on DISCARD
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 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

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

AOF Persistence

Default AOF options
Login via GitHub to view this stage
AOF options from flags
Login via GitHub to view this stage
Create append-only directory
Login via GitHub to view this stage
Create append-only file
Login via GitHub to view this stage
Create manifest file
Login via GitHub to view this stage
Write a single command
Login via GitHub to view this stage
Write multiple commands
Login via GitHub to view this stage
Filter write commands
Login via GitHub to view this stage
Replay a single command
Login via GitHub to view this stage
Replay multiple commands
Login via GitHub to view this stage

Pub/Sub

Subscribe to a channel
Login via GitHub to view this stage
Subscribe to multiple channels
Login via GitHub to view this stage
Enter subscribed mode
Login via GitHub to view this stage
PING in subscribed mode
Login via GitHub to view this stage
Publish a message
Login via GitHub to view this stage
Deliver messages
Login via GitHub to view this stage
Unsubscribe
Login via GitHub to view this stage

Sorted Sets

Create a sorted set
Login via GitHub to view this stage
Add members
Login via GitHub to view this stage
Retrieve member rank
Login via GitHub to view this stage
List sorted set members
Login via GitHub to view this stage
ZRANGE with negative indexes
Login via GitHub to view this stage
Count sorted set members
Login via GitHub to view this stage
Retrieve member score
Login via GitHub to view this stage
Remove a member
Login via GitHub to view this stage

Geospatial Commands

Respond to GEOADD
Login via GitHub to view this stage
Validate coordinates
Login via GitHub to view this stage
Store a location
Login via GitHub to view this stage
Calculate location score
Login via GitHub to view this stage
Respond to GEOPOS
Login via GitHub to view this stage
Decode coordinates
Login via GitHub to view this stage
Calculate distance
Login via GitHub to view this stage
Search within radius
Login via GitHub to view this stage

Authentication

Respond to ACL WHOAMI
Login via GitHub to view this stage
Respond to ACL GETUSER
Login via GitHub to view this stage
The nopass flag
Login via GitHub to view this stage
The passwords property
Login via GitHub to view this stage
Setting default user password
Login via GitHub to view this stage
The AUTH command
Login via GitHub to view this stage
Enforce authentication
Login via GitHub to view this stage
Authenticate using AUTH
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 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.

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

Persistent Connections

Persistent connections
Login via GitHub to view this stage
Concurrent persistent connections
Login via GitHub to view this stage
Connection closure
Login via GitHub to view this stage