All quizzes
Free quiz · 50 questions in the bank

Rust quiz

Test your Rust knowledge with a free interactive quiz — 50 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What does the `mut` keyword in `let mut x` allow that plain `let` does not?

Questions in this quiz
  1. What does the `mut` keyword in `let mut x` allow that plain `let` does not?
  2. What is a `Box<T>`?
  3. What does this code do: `let s = String::from("hi"); let t = s; println!("{}", s);`?
  4. `#[derive(Debug, Clone, PartialEq)]` does what?
  5. What does `let mut x = 5; x = 6;` do?
  6. What does this iterate: `for x in 0..5 { … }`?
  7. How do you create a growable vector and push two elements?
  8. How do you add methods to a struct?
  9. What is "ownership" in Rust?
  10. A function `fn add(a: i32, b: i32) -> i32 { a + b }` — what makes `a + b` the return value?
  11. A `struct Point { x: i32, y: i32 }` is instantiated as:
  12. What does `&value` produce?
Gaps to close?
Read the curated Rust notes — core concepts, patterns, interview prep.
Rust notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web