Rust practice in Systems Programming
Browse the rooms before signing in. All rooms are free with an account. Practice does not issue certificates.
The Classic Chant
The interview warm-up that never dies. Return Fizz, Buzz, FizzBuzz, or the number, with match-free if/else.
control. Free with an account.
Your First Borrow
Borrow a slice, do not own it. Sum its elements and hand the answer back; the caller keeps the data.
borrow. Free with an account.
Leap of Faith
Calendars hide a tidy rule. Decide whether a year is a leap year: divisible by 4, not 100, unless also by 400.
logic. Free with an account.
Warm the Core
Every Rust program is a set of typed functions. Double a number and return it, the smallest possible expression.
bindings. Free with an account.
Count the Words
Split on whitespace, collapsing runs of spaces, and count the words.
strings. Free with an account.
Find the Peak
Scan a borrowed slice and report its largest value, reading through a shared reference.
borrow. Free with an account.
Tally the Letter
Walk the characters of a string and count how often one appears, all through a borrow.
strings. Free with an account.
Turn It Around
Reverse a string by characters, collecting them into a fresh owned String.
strings. Free with an account.
Are They Anagrams?
Two words are anagrams when their sorted characters match. Decide it.
sets. Free with an account.
Fail With a Reason
Return a Result with a clear error for a zero divisor or an unrepresentable signed quotient; otherwise return Ok of the integer quotient.
result. Free with an account.
Grade the Paper
Use range patterns in a match to turn a score into a letter grade.
match. Free with an account.
Never Divide by Zero
Represent a missing quotient with Option. Return None for a zero divisor or an unrepresentable signed quotient; otherwise return Some of the integer quotient.
option. Free with an account.
How Many Distinct?
Drop duplicates with a HashSet and count what is left.
sets. Free with an account.
Keep a Running Total
Use scan to carry state through an iterator and emit the cumulative sums.
advanced. Free with an account.
One Function, All Types
Write it once over a generic T with a bound, and return whichever argument is larger.
generics. Free with an account.
A One-Line Pipeline
Compose filter, map, and sum into a single expression: the sum of the squares of the even numbers.
adapters. Free with an account.
Share the Counter
Add each element to a shared Arc<Mutex> from its own thread, then join all and read the total.
shared. Free with an account.
Ship the Engine
Run a tiny program of SET/GET/INCR commands against a HashMap store and count the outputs.
engine. Free with an account.
Sum on a Thread
Move an owned vector onto a spawned thread, reduce it there, and join the result back.
threads. Free with an account.
The Pocket Calculator
Evaluate a reverse-Polish expression on a stack, returning Ok or an Err for bad input.
eval. Free with an account.