Skip to content

Rust practice problems

Difficulty:
Category & tags
Category:
Tag:

Showing 50 of 342

Title Difficulty
Accept string-like values with AsRef Medium
Accessing an owned value while it is borrowed Medium
Accumulate enum variants in a recursive macro Hard
Adding context without anyhow Hard
A logical-time reactor: timers without a clock Hard
A macro-generated FFI binding layer Hard
A mini DSL: compile-time expression evaluation Hard
any, all, find, position: audit a list of records Easy
Arc: shared ownership across threads Easy
Arrays: the length is part of the type Easy
ASCII search without lowercase copies Easy
A single-producer single-consumer ring buffer Hard
Associated type or generic parameter? Hard
A store-buffer memory-model interpreter Hard
Async recursion, async closures, and streams Hard
Atomics: counters, flags and fetch_* Medium
Balanced ranges: the arithmetic before the threads Easy
Barrier: keeping workers in lock step Medium
BinaryHeap is a max-heap, and Reverse is the fix Medium
Binding values with @ and or-patterns Medium
Blanket implementations: shared behavior and overlap Hard
block_on: poll a future to completion Easy
bool and char Easy
Borrowing through Option Medium
Borrow it or own it: your first lifetime decision Easy
Bounds checks: five safe ways to express access Hard
Box<dyn Trait>: trait objects, DSTs and dynamic dispatch Medium
Boxed errors and downcasting Medium
BTreeMap range queries Medium
Build a byte index with one allocation Easy
Build a configuration from defaults and overrides Easy
Build a CSV record with one output buffer Easy
Build a generic stack with conditional methods Medium
Build a module tree and inspect its paths Easy
Build a report with a reusable string buffer Medium
Build a ring buffer with MaybeUninit Hard
Build a safe mutable-slice split Medium
Build a spinlock from AtomicBool and UnsafeCell Hard
Build a test runner that catches panics Hard
Build a vector with allocation, push and pop Hard
Build Cell<T> and RefCell<T> from scratch Hard
Build FizzBuzz strings with an if expression Easy
Build Rc<T> and RefCell<T> from scratch Hard
Build tree paths with an arena and Rc Hard
Build vector, pattern-matching and map macros Medium
Calling C functions through safe Rust wrappers Medium
Cancelling a future by dropping it Medium
Cancel safety, blocking, and locks across .await Hard
Capstone: an async executor with a logical-time reactor Hard
Capstone: an ownership-only job scheduler Hard