Practice Rust

Learn Rust by practicing, choose from a variety of coding exercises and challenges to help you improve your Rust programming skills

Printing Hello World

Create a function that prints 'Hello, world!' to the console using Rust.

BEGINNER
RUST BASICS

Declaring Variables

Learn to declare immutable variables in Rust and understand their usage.

BEGINNER
RUST BASICS

Mutable Variables

Define and modify mutable variables in Rust.

BEGINNER
RUST BASICS

Constants

Learn how to define and use constants in Rust.

BEGINNER
RUST BASICS

Primitive Data Types

Get familiar with primitive data types in Rust by defining and annotating variables.

BEGINNER
RUST BASICS

Converting Numerical Types

Implement a function to convert numerical types using the `as` keyword in Rust.

BEGINNER
RUST BASICS

Mathematical operations

Practice mathematical operations in Rust, including addition, subtraction, multiplication, and division.

BEGINNER
RUST BASICS

Sum of Array

Calculate the sum of all elements in an array.

BEGINNER
RUST BASICS

Tuples

Create a function that returns a tuple of values.

BEGINNER
RUST BASICS

The Unit Type

Understand and use the unit type `()` in Rust.

BEGINNER
RUST BASICS

Functions

Implement and work with functions in Rust.

BEGINNER
RUST BASICS

Closures

Learn how to define and use closures in Rust.

BEGINNER
RUST BASICS

Control Flow

Implement basic control flow in Rust using if-else statements.

BEGINNER
RUST BASICS

Basic If-Else Statements

Learn how to use if-else statements in Rust to control the flow of your program.

EASY
CONTROL FLOW

Sum of Even Numbers

Implement a function to sum even numbers in a given range using a for loop.

EASY
CONTROL FLOW

Countdown

Implement a countdown timer using a while loop in Rust.

EASY
CONTROL FLOW

Weekday from Number

Use Rust's pattern matching to determine the weekday given its number.

EASY
CONTROL FLOW

Ownership

Understand and implement Rust's ownership model.

EASY
RUST BASICS

Mutable References

Implement Rust's ownership model with mutable references.

BEGINNER
RUST BASICS

Ownership Rules

Identify and fix ownership rule violations in Rust code.

EASY
RUST BASICS

Character counting string

Write a program that takes a string as input and counts the number of characters in the string.

BEGINNER
RUST BASICS

Fizz Buzz

Write a program that prints 'Fizz' for multiples of three, 'Buzz' for multiples of five, and 'FizzBuzz' for multiples of both.

EASY
RUST BASICS

Fibonacci

Write a function that returns the nth number in the Fibonacci sequence.

EASY
RUST BASICS

The From trait

Implement the From trait for a custom type.

MEDIUM
RUST BASICS

Graceful error handling

Implement graceful error handling in Rust using the Result type.

EASY
RUST BASICS

Is Prime

Implement a function to check if a number is prime using logical operators and conditional statements.

MEDIUM
CONTROL FLOW

Determine Number Characteristics

Implement a function to describe if a number is positive, negative, or zero, and if it is even or odd.

EASY
CONTROL FLOW

Factorial Calculator

Implement a function to calculate the factorial of a non-negative integer using early returns and loops.

EASY
CONTROL FLOW

Temperature Converter

Implement a temperature converter that handles various units and errors.

MEDIUM
CONTROL FLOW

Validate User Input

Implement early returns in Rust to validate user input for age and email.

EASY
CONTROL FLOW

Median and mode

Write a program that calculates the median and mode of a list of numbers.

MEDIUM
RUST BASICS

Animal sanctuary registry

Create a program that manages a registry of animals in a sanctuary.

MEDIUM
RUST BASICS

Find the First Palindrome

Implement a function to find the first palindrome number in a range using any control flow construct.

HARD
CONTROL FLOW

Finite State Automaton

Implement a finite state automaton (FSA) to recognize a specific pattern in a sequence of characters.

HARD
CONTROL FLOW

Maze Solver

Implement a maze solver using control flow in Rust to navigate through a maze represented as a grid.

ADVANCED
CONTROL FLOW

New Challenges Coming Soon! Sign up for our newsletter to get updates.

Get updated on the latest courses, features, tools, resources about Rust, and more!