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/12Score 0

What does `match` require?

In this round
  1. What does `match` require?
  2. What does the `mut` keyword in `let mut x` allow that plain `let` does not?
  3. What is `Option<T>`?
  4. What is the difference between `String` and `&str`?
  5. A function `fn add(a: i32, b: i32) -> i32 { a + b }` — what makes `a + b` the return value?
  6. How do you create a growable vector and push two elements?
  7. What is a `Box<T>`?
  8. What does this iterate: `for x in 0..5 { … }`?
  9. A `struct Point { x: i32, y: i32 }` is instantiated as:
  10. `#[derive(Debug, Clone, PartialEq)]` does what?
  11. What does `enum Color { Red, Green, Blue }` create?
  12. What does the `?` operator do at the end of an expression?
Gaps to close?
Read the curated Rust notes — core concepts, patterns, interview prep.
Rust notes

More quizzes

AccessibilityAlgorithmsAngularApache KafkaAWSBootstrap