🦀

Rust MCQ

Test your Rust knowledge with 100 multiple choice questions covering fundamentals to advanced concepts, with instant feedback and explanations.

100 Questions 40 Beginner 40 Intermediate 20 Advanced
1

What is a trait object (dyn Trait)?

2

What is the difference between static dispatch (generics) and dynamic dispatch (dyn Trait)?

3

What is the Send trait?

4

What is the Sync trait?

5

What is the Mutex<T> in Rust?

6

What is async/await in Rust?

7

What is a Future in Rust?

8

What is unsafe Rust?

9

What is a raw pointer in Rust?

10

What is the From/Into trait?

11

What is the Display trait?

12

What is a macro in Rust?

13

What is the newtype pattern?

14

What is the purpose of PhantomData<T>?

15

What is Pin<T> used for?

16

What is the Deref coercion?

17

What is the difference between clone() and copy?

18

What is a type alias (type) in Rust?

19

What is the ? Sized bound?

20

What is Rust's impl Trait syntax in function arguments?

21

What is the purpose of Cow<'a, B> (Clone on Write)?

22

What is the BufReader and BufWriter purpose in Rust?

23

What is Rust's type inference limitations?

24

What is the turbofish operator ::<> in Rust?

25

What is Rust's RwLock<T>?

26

What are proc macros in Rust?

27

What is the thiserror crate used for?

28

What is the anyhow crate?

29

What is Rust's cfg! macro and #[cfg] attribute?

30

What is Rust's const generics?

31

What is the std::mem::discriminant function?

32

What is Rust's std::hint::black_box?

33

What is the From<&str> for String vs Into<String> pattern?

34

What is Rust's once_cell crate and how is it now in std?

35

What is std::sync::mpsc?

36

What is Rust's associated const in a trait?

37

What does the std::mem::forget function do?

38

What is the difference between String::new() and String::with_capacity(n)?

39

What is the Entry API for HashMap in Rust?

40

What is the difference between map() and and_then() on Option/Result?