Rust practice
Every Rust exercise, built from a topic you can open beside it.
75 exercises runs offline
All tracks Python 139 JavaScript 184 TypeScript 76 Go 106 Rust 75 Java 81 Kotlin 66 C++ 92 C# 88 Swift 68 PHP 69 Frontend 82 Backend 139 Architecture and system design 25 DevOps and cloud 15 Data and databases 5 Data science 31 AI and LLM engineering 75 Security 26 Game development 26 Coding in the AI era 101 CS foundations 164
level
rs Quiz new What does a lifetime annotation on a returned reference do? How shared and mutable references access values without taking ownership, why borrows conflict, and how to resolve borrow-checker errors. rs Predict the output new What does this program print? How shared and mutable references access values without taking ownership, why borrows conflict, and how to resolve borrow-checker errors. rs Review AI code new Review generated stock transfer How shared and mutable references access values without taking ownership, why borrows conflict, and how to resolve borrow-checker errors. rs Quiz new Which reference set may safely access the same ordinary value at one point? How shared and mutable references access values without taking ownership, why borrows conflict, and how to resolve borrow-checker errors. rs Spot the bug new Spot the bug in vector growth How shared and mutable references access values without taking ownership, why borrows conflict, and how to resolve borrow-checker errors. rs Quiz new A parent owns child nodes on one thread, while each child needs an optional parent link. … How Rust's Box, Rc, Arc, and Weak model heap ownership, shared ownership, thread-safe sharing, mutation, and non-owning links. rs Predict the output new What does this program print? How Rust's Box, Rc, Arc, and Weak model heap ownership, shared ownership, thread-safe sharing, mutation, and non-owning links. rs Predict the output new Which pair of lines does this program print? How Rust's Box, Rc, Arc, and Weak model heap ownership, shared ownership, thread-safe sharing, mutation, and non-owning links. rs Review AI code new Review generated listener hub How Rust's Box, Rc, Arc, and Weak model heap ownership, shared ownership, thread-safe sharing, mutation, and non-owning links. rs Spot the bug new Spot the bug in the Rc tree How Rust's Box, Rc, Arc, and Weak model heap ownership, shared ownership, thread-safe sharing, mutation, and non-owning links. rs Quiz new A function chooses at runtime between two capturing closure expressions and returns the c… Learn how Rust closures capture their environment, acquire Fn traits, and express ownership in generics, return values, threads, and dynamic dispatch. rs Quiz new Which statement about move || println!("{label}") is correct when label is a String? Learn how Rust closures capture their environment, acquire Fn traits, and express ownership in generics, return values, threads, and dynamic dispatch. rs Predict the output new What does this program print? Learn how Rust closures capture their environment, acquire Fn traits, and express ownership in generics, return values, threads, and dynamic dispatch. rs Review AI code new Review generated audit handler Learn how Rust closures capture their environment, acquire Fn traits, and express ownership in generics, return values, threads, and dynamic dispatch. rs Spot the bug new Spot the bug in the Fn bound Learn how Rust closures capture their environment, acquire Fn traits, and express ownership in generics, return values, threads, and dynamic dispatch. rs Quiz new Which standard collection most directly expresses a key-value map that must iterate by ke… Choose Rust's standard collections by ordering, uniqueness, lookup, and range semantics, then handle ownership, Entry, and iteration correctly. rs Quiz new Which expression calls build_profile only when user_id is absent? Choose Rust's standard collections by ordering, uniqueness, lookup, and range semantics, then handle ownership, Entry, and iteration correctly. rs Predict the output new What does this program print? Choose Rust's standard collections by ordering, uniqueness, lookup, and range semantics, then handle ownership, Entry, and iteration correctly. rs Review AI code new Review generated product summary Choose Rust's standard collections by ordering, uniqueness, lookup, and range semantics, then handle ownership, Entry, and iteration correctly. rs Spot the bug new Spot the bug in the HashMap report Choose Rust's standard collections by ordering, uniqueness, lookup, and range semantics, then handle ownership, Entry, and iteration correctly. rs Quiz new What happens when code constructs values.iter().map(transform) but never uses the returne… Understand Rust iterator ownership, lazy adapters, short-circuiting, error propagation, and the contract of a custom Iterator. rs Predict the output new What does this program print? Understand Rust iterator ownership, lazy adapters, short-circuiting, error propagation, and the contract of a custom Iterator. rs Quiz new Which expression returns the first integer parse error instead of silently dropping inval… Understand Rust iterator ownership, lazy adapters, short-circuiting, error propagation, and the contract of a custom Iterator. rs Review AI code new Review generated weight conversion Understand Rust iterator ownership, lazy adapters, short-circuiting, error propagation, and the contract of a custom Iterator. rs Spot the bug new Spot the bug in the lazy map Understand Rust iterator ownership, lazy adapters, short-circuiting, error propagation, and the contract of a custom Iterator. rs Predict the output new What does this program print? Express relationships among references precisely with lifetime parameters, elision, borrowed structs, 'static, and higher-ranked bounds. rs Review AI code new Review generated borrowed key view Express relationships among references precisely with lifetime parameters, elision, borrowed structs, 'static, and higher-ranked bounds. rs Quiz new What does one lifetime name shared by two parameters and a return value guarantee? Express relationships among references precisely with lifetime parameters, elision, borrowed structs, 'static, and higher-ranked bounds. rs Spot the bug new Spot the bug in the local reference Express relationships among references precisely with lifetime parameters, elision, borrowed structs, 'static, and higher-ranked bounds. rs Quiz new Which statement correctly distinguishes String: static from a static reference? Express relationships among references precisely with lifetime parameters, elision, borrowed structs, 'static, and higher-ranked bounds. rs Quiz new What does fn choose<'a>(x: &'a str, y: &'a str) -> &'a str mean? Lifetimes describe where references remain valid; understand inference, annotations, elision, 'static, and higher-ranked bounds to design precise borrowed APIs. rs Quiz new When is a for-lifetime higher-ranked bound appropriate? Lifetimes describe where references remain valid; understand inference, annotations, elision, 'static, and higher-ranked bounds to design precise borrowed APIs. rs Predict the output new What does this program print? Lifetimes describe where references remain valid; understand inference, annotations, elision, 'static, and higher-ranked bounds to design precise borrowed APIs. rs Review AI code new Review generated record view Lifetimes describe where references remain valid; understand inference, annotations, elision, 'static, and higher-ranked bounds to design precise borrowed APIs. rs Spot the bug new Spot the bug in the local reference Lifetimes describe where references remain valid; understand inference, annotations, elision, 'static, and higher-ranked bounds to design precise borrowed APIs. rs Quiz new A package named store-domain has src/lib.rs and src/main.rs. From main.rs, how should the… Distinguish Cargo packages, crates, and modules, then use paths, visibility, and re-exports to design a stable Rust API. rs Quiz new Which statement correctly distinguishes a Cargo package, a crate, and a module? Distinguish Cargo packages, crates, and modules, then use paths, visibility, and re-exports to design a stable Rust API. rs Predict the output new What does this program print? Distinguish Cargo packages, crates, and modules, then use paths, visibility, and re-exports to design a stable Rust API. rs Review AI code new Review generated catalog API Distinguish Cargo packages, crates, and modules, then use paths, visibility, and re-exports to design a stable Rust API. rs Spot the bug new Spot the bug in the module path Distinguish Cargo packages, crates, and modules, then use paths, visibility, and re-exports to design a stable Rust API. rs Quiz new A function only reads a Shipment during the call and never stores it. Which parameter bes… Rust uses ownership, moves, copies, and deterministic destruction to govern resources; learn when values transfer, borrow, and drop. rs Predict the output new Which pair of lengths does this program print? Rust uses ownership, moves, copies, and deterministic destruction to govern resources; learn when values transfer, borrow, and drop. rs Predict the output new What does this program print? Rust uses ownership, moves, copies, and deterministic destruction to govern resources; learn when values transfer, borrow, and drop. rs Review AI code new Review generated job removal Rust uses ownership, moves, copies, and deterministic destruction to govern resources; learn when values transfer, borrow, and drop. rs Spot the bug new Spot the bug in the moved label Rust uses ownership, moves, copies, and deterministic destruction to govern resources; learn when values transfer, borrow, and drop. rs Quiz new Which statement about Copy and Clone is correct? Track moves, copies, borrows, partial moves, and drops so each Rust value has one clear owner at every program point. rs Predict the output new In which order are these lines printed? Track moves, copies, borrows, partial moves, and drops so each Rust value has one clear owner at every program point. rs Predict the output new What does this program print? Track moves, copies, borrows, partial moves, and drops so each Rust value has one clear owner at every program point. rs Review AI code new Review a generated dispatch helper Track moves, copies, borrows, partial moves, and drops so each Rust value has one clear owner at every program point. rs Spot the bug new Spot the bug in the moved label Track moves, copies, borrows, partial moves, and drops so each Rust value has one clear owner at every program point. rs Quiz new In match &job { Job { owner, .. } => ... }, where owner is a String field, what is the us… Use exhaustive matches, destructuring, guards, and binding patterns while avoiding hidden wildcard cases and accidental moves. rs Quiz new Which slice pattern accepts exactly a command name followed by one argument? Use exhaustive matches, destructuring, guards, and binding patterns while avoiding hidden wildcard cases and accidental moves. rs Predict the output new What does this program print? Use exhaustive matches, destructuring, guards, and binding patterns while avoiding hidden wildcard cases and accidental moves. rs Review AI code new Review an event classifier Use exhaustive matches, destructuring, guards, and binding patterns while avoiding hidden wildcard cases and accidental moves. rs Spot the bug new Spot the bug in the match pattern Use exhaustive matches, destructuring, guards, and binding patterns while avoiding hidden wildcard cases and accidental moves. rs Quiz new Why does Future::poll receive self as Pin<&mut Self>? Pin establishes a no-move contract for address-sensitive values; Unpin determines when that restriction can be safely removed. rs Quiz new What happens when a Pin<Box<T>> binding is moved to another variable? Pin establishes a no-move contract for address-sensitive values; Unpin determines when that restriction can be safely removed. rs Predict the output new Which three lines does this program print, in order? Pin establishes a no-move contract for address-sensitive values; Unpin determines when that restriction can be safely removed. rs Review AI code new Review a generated pinned job Pin establishes a no-move contract for address-sensitive values; Unpin determines when that restriction can be safely removed. rs Spot the bug new Spot the bug in the Ticket self-reference Pin establishes a no-move contract for address-sensitive values; Unpin determines when that restriction can be safely removed. rs Quiz new Which statement about Cell<String> is correct? Use Cell value replacement and RefCell runtime borrowing to model interior mutability without hiding borrow conflicts or thread boundaries. rs Predict the output new What does this program print? Use Cell value replacement and RefCell runtime borrowing to model interior mutability without hiding borrow conflicts or thread boundaries. rs Predict the output new Does this program compile, and what does it print? Use Cell value replacement and RefCell runtime borrowing to model interior mutability without hiding borrow conflicts or thread boundaries. rs Review AI code new Review a generated event bus Use Cell value replacement and RefCell runtime borrowing to model interior mutability without hiding borrow conflicts or thread boundaries. rs Spot the bug new Spot the bug in the callback registry Use Cell value replacement and RefCell runtime borrowing to model interior mutability without hiding borrow conflicts or thread boundaries. rs Quiz new A function accepts &str and receives &Box<String> through deref coercion. What happens to… Rust smart pointers combine indirection with ownership, sharing, and destruction; understand the real boundaries of Deref, Drop, and wrappers. rs Predict the output new What does this program print? Rust smart pointers combine indirection with ownership, sharing, and destruction; understand the real boundaries of Deref, Drop, and wrappers. rs Predict the output new Which pair of values does this program print? Rust smart pointers combine indirection with ownership, sharing, and destruction; understand the real boundaries of Deref, Drop, and wrappers. rs Review AI code new Review a generated secret wrapper Rust smart pointers combine indirection with ownership, sharing, and destruction; understand the real boundaries of Deref, Drop, and wrappers. rs Spot the bug new Spot the bug in the Rc node graph Rust smart pointers combine indirection with ownership, sharing, and destruction; understand the real boundaries of Deref, Drop, and wrappers. rs Quiz new A function only searches text during the call and stores nothing. Which ordinary paramete… Understand String and str ownership, UTF-8 byte boundaries, Unicode text units, and when a string API should borrow or allocate. rs Quiz new Which statement about Rust string units is correct? Understand String and str ownership, UTF-8 byte boundaries, Unicode text units, and when a string API should borrow or allocate. rs Predict the output new What does this program print? Understand String and str ownership, UTF-8 byte boundaries, Unicode text units, and when a string API should borrow or allocate. rs Review AI code new Review generated name summary Understand String and str ownership, UTF-8 byte boundaries, Unicode text units, and when a string API should borrow or allocate. rs Spot the bug new Spot the bug in the UTF-8 prefix Understand String and str ownership, UTF-8 byte boundaries, Unicode text units, and when a string API should borrow or allocate.
No practice items match these filters.