Master Kotlin.

Kotlin

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

3,963 learners
254 exercises
Kotlin Challenges

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

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.

Build your own Shell
FREE THIS MONTH
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.

Build your own Interpreter
Build your own Interpreter

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.

Scanning: Empty file
Scanning: Parentheses
Scanning: Braces
Scanning: Other single-character tokens
Scanning: Lexical errors
Scanning: Assignment & equality Operators
Scanning: Negation & inequality operators
Scanning: Relational operators
Scanning: Division operator & comments
Scanning: Whitespace
Scanning: Multi-line errors
Scanning: String literals
Scanning: Number literals
Scanning: Identifiers
Scanning: Reserved words

Parsing Expressions

Booleans & Nil
Number literals
String literals
Parentheses
Unary Operators
Arithmetic operators (1/2)
Arithmetic operators (2/2)
Comparison operators
Equality operators
Syntactic errors

Evaluating Expressions

Literals: Booleans & Nil
Literals: Strings & Numbers
Parentheses
Unary Operators: Negation & Not
Arithmetic Operators (1/2)
Arithmetic Operators (2/2)
String Concatenation
Relational Operators
Equality Operators
Runtime Errors: Unary Operators
Runtime Errors: Binary Operators (1/2)
Runtime Errors: Binary Operators (2/2)
Runtime Errors: Relational Operators

Statements & State

Print: Generate output
Print: Multiple statements
Expression statements
Variables: Declare variables
Variables: Runtime Errors
Variables: Initialize variables
Variables: Redeclare variables
Assignment operation
Block syntax
Scopes

Control Flow

If statements
Else statements
Else-if statements
Nested if statements
Logical OR operator
Logical AND operator
While statements
For statements
Syntactic errors

Functions

Native functions
Functions without arguments
Functions with arguments
Syntax errors
Return statements
Higher order functions
Runtime errors
Function scope
Closures

Resolving & Binding

Identifier Resolution
Self Initialization
Variable Redeclaration
Invalid Return

Classes

Class Declarations
Class Instances
Getters & Setters
Instance Methods
The 'this' keyword
Invalid usages of 'this'
Constructor calls
Return within constructors

Inheritance

Class Hierarchy
Inheriting Methods
Overriding Methods
Inheritance errrors
The super keyword
Invalid Usages of the super Keyword
Build your own Redis
Build your own Redis

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

Bind to a port
Respond to PING
Respond to multiple PINGs
Handle concurrent clients
Implement the ECHO command
Implement the SET & GET commands
Expiry

RDB Persistence

RDB file config
Read a key
Read a string value
Read multiple keys
Read multiple string values
Read value with expiry

Replication

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

Streams

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

Transactions

The INCR command (1/3)
The INCR command (2/3)
The INCR command (3/3)
The MULTI command
The EXEC command
Empty transaction
Queueing commands
Executing a transaction
The DISCARD command
Failures within transactions
Multiple transactions
Build your own Git
Build your own Git

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 Kotlin.

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