Rust practice in Systems Programming
Browse the rooms before signing in. Opening a room requires an account and follows your existing access. 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 room.
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 room.
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 room.
Warm the Core
Every Rust program is a set of typed functions. Double a number and return it, the smallest possible expression.
bindings. Free room.
Count the Words
Split on whitespace, collapsing runs of spaces, and count the words.
strings. Account access required.
Find the Peak
Scan a borrowed slice and report its largest value, reading through a shared reference.
borrow. Account access required.
Tally the Letter
Walk the characters of a string and count how often one appears, all through a borrow.
strings. Account access required.
Turn It Around
Reverse a string by characters, collecting them into a fresh owned String.
strings. Account access required.
Are They Anagrams?
Two words are anagrams when their sorted characters match. Decide it.
sets. Account access required.
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. Account access required.
Grade the Paper
Use range patterns in a match to turn a score into a letter grade.
match. Account access required.
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. Account access required.
How Many Distinct?
Drop duplicates with a HashSet and count what is left.
sets. Account access required.
Keep a Running Total
Use scan to carry state through an iterator and emit the cumulative sums.
advanced. Account access required.
One Function, All Types
Write it once over a generic T with a bound, and return whichever argument is larger.
generics. Account access required.
A One-Line Pipeline
Compose filter, map, and sum into a single expression: the sum of the squares of the even numbers.
adapters. Account access required.
Share the Counter
Add each element to a shared Arc<Mutex> from its own thread, then join all and read the total.
shared. Account access required.
Ship the Engine
Run a tiny program of SET/GET/INCR commands against a HashMap store and count the outputs.
engine. Account access required.
Sum on a Thread
Move an owned vector onto a spawned thread, reduce it there, and join the result back.
threads. Account access required.
The Pocket Calculator
Evaluate a reverse-Polish expression on a stack, returning Ok or an Err for bad input.
eval. Account access required.