Practice Rust

Beta

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

Filters

Difficulty

Tracks

Hello, World

Write a simple function that returns the string 'Hello, World!' in Rust.

Beginner

Printing Hello World

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

Beginner

Declaring Variables

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

Beginner

Mutable Variables

Define and modify mutable variables in Rust.

Beginner

Constants

Learn how to define and use constants in Rust.

Beginner

Primitive Data Types

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

Beginner

Converting Numerical Types

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

Beginner

Mathematical operations

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

Beginner

Sum of Array

Calculate the sum of all elements in an array.

Beginner

Tuples

Create a function that returns a tuple of values.

Beginner

The Unit Type

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

Beginner

Functions

Implement and work with functions in Rust.

Beginner

Closures

Learn how to define and use closures in Rust.

Beginner

Control Flow

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

Beginner

Basic If-Else Statements

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

Easy

Sum of Even Numbers

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

Easy

Countdown

Implement a countdown timer using a while loop in Rust.

Easy

Weekday from Number

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

Easy

Ownership

Understand and implement Rust's ownership model.

Easy

Mutable References

Implement Rust's ownership model with mutable references.

Beginner

Ownership Rules

Identify and fix ownership rule violations in Rust code.

Easy

Character counting string

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

Beginner

Fizz Buzz

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

Easy

Fibonacci

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

Easy

The From trait

Implement the From trait for a custom type.

Medium

Animal sanctuary registry

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

Medium

Median and mode

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

Medium

Graceful error handling

Implement graceful error handling in Rust using the Result type.

Easy

Is Prime

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

Medium

Determine Number Characteristics

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

Easy

Factorial Calculator

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

Easy

Temperature Converter

Implement a temperature converter that handles various units and errors.

Medium

Validate User Input

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

Easy

Find the First Palindrome

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

Hard

Finite State Automaton

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

Hard

Maze Solver

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

Advanced

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!

Rustfinity.com

Links

  1. Home
  2. Learn Rust
  3. Get Started
  4. Practice Rust
  5. Challenges
  6. Tutorials
  7. Blog
  8. Open source

Socials

  1. GitHub
  2. X

Legal

  1. Privacy Policy
  2. Terms of Service