Rust MCQ
Test your Rust knowledge with 100 multiple choice questions covering fundamentals to advanced concepts, with instant feedback and explanations.
Which organization develops the Rust programming language?
2What is Rust's primary memory safety guarantee?
3What is ownership in Rust?
4What is a move in Rust?
5What is the Copy trait?
6What is a reference in Rust?
7What is borrowing in Rust?
8What are Rust's borrowing rules?
9What is a slice in Rust?
10What is the difference between &str and String?
11What is an enum in Rust?
12What is Option<T> used for?
13What is Result<T, E>?
14What does the ? operator do in Rust?
15What is a struct in Rust?
16What is a trait in Rust?
17What is a lifetime in Rust?
18What is the borrow checker?
19What is pattern matching in Rust?
20What does panic! do?
21What is Box<T>?
22What is Rc<T>?
23What is Arc<T>?
24What is Cell<T> and RefCell<T>?
25What is the use keyword in Rust?
26What is cargo in Rust?
27What is a crate in Rust?
28What does the derive attribute do?
29What is the println! macro?
30What is a vector Vec<T> in Rust?
31What is an iterator in Rust?
32What is the difference between iter(), iter_mut(), and into_iter()?
33What is the Drop trait?
34What is an impl block?
35What is a closure in Rust?
36What is the Fn, FnMut, FnOnce trait hierarchy?
37What does the move keyword do in a closure?
38What are generics in Rust?
39What is monomorphization?
40What is a Rust lifetime elision rule?
What is a trait object (dyn Trait)?
2What is the difference between static dispatch (generics) and dynamic dispatch (dyn Trait)?
3What is the Send trait?
4What is the Sync trait?
5What is the Mutex<T> in Rust?
6What is async/await in Rust?
7What is a Future in Rust?
8What is unsafe Rust?
9What is a raw pointer in Rust?
10What is the From/Into trait?
11What is the Display trait?
12What is a macro in Rust?
13What is the newtype pattern?
14What is the purpose of PhantomData<T>?
15What is Pin<T> used for?
16What is the Deref coercion?
17What is the difference between clone() and copy?
18What is a type alias (type) in Rust?
19What is the ? Sized bound?
20What is Rust's impl Trait syntax in function arguments?
21What is the purpose of Cow<'a, B> (Clone on Write)?
22What is the BufReader and BufWriter purpose in Rust?
23What is Rust's type inference limitations?
24What is the turbofish operator ::<> in Rust?
25What is Rust's RwLock<T>?
26What are proc macros in Rust?
27What is the thiserror crate used for?
28What is the anyhow crate?
29What is Rust's cfg! macro and #[cfg] attribute?
30What is Rust's const generics?
31What is the std::mem::discriminant function?
32What is Rust's std::hint::black_box?
33What is the From<&str> for String vs Into<String> pattern?
34What is Rust's once_cell crate and how is it now in std?
35What is std::sync::mpsc?
36What is Rust's associated const in a trait?
37What does the std::mem::forget function do?
38What is the difference between String::new() and String::with_capacity(n)?
39What is the Entry API for HashMap in Rust?
40What is the difference between map() and and_then() on Option/Result?
What is the Non-Lexical Lifetimes (NLL) improvement?
2What is variance in Rust lifetimes?
3What is the difference between associated types and generic type parameters in traits?
4What is the Higher-Ranked Trait Bound (HRTB) for<'a>?
5What is the Polonius borrow checker?
6What is unsafe trait and unsafe impl?
7What is the global allocator in Rust?
8What is specialization in Rust?
9What is the impact of Rust's zero-cost abstractions?
10What is async cancellation in Rust and why is it unique?
11What is Rust's async runtime and why isn't one built-in?
12What is the difference between tokio::spawn and std::thread::spawn in Rust?
13What is the Miri interpreter for Rust?
14What is Rust's MIR (Mid-level Intermediate Representation)?
15What is soundness in Rust's type system?
16What is the Stacked Borrows memory model for Rust unsafe code?
17What is the Rust portability lint and unsafe guidelines?
18What is the difference between Arc<Mutex<T>> and Arc<RwLock<T>>?
19What is the pinning contract and self-referential structs?
20What is Rust's strict provenance model for raw pointers?