Rust Programming Language

399 questions in the bank
Are you ready to take quiz?
Explore more
Logo
About the Quiz

Quiz will ask 20 randomly selected questions with allotted time of . You can take the quiz more than once. Once you submit the quiz, you can review how you have done, the correct the answers for each questions and the explanation for the correct the answer.

Quiz Topics

10 Modules

Advanced Topics

4 topics
1.

Asynchronous Programming with async/await

10 questions
2.

FFI (Foreign Function Interface)

10 questions
3.

Macros and Procedural Macros

10 questions
4.

Unsafe Rust

10 questions

Testing and Debugging

4 topics

Smart Pointers

4 topics

Traits and Generics

4 topics

Concurrency

4 topics

Modules and Crates

4 topics

Error Handling

4 topics

Structs and Enums

4 topics

Ownership and Borrowing

4 topics

Basic Syntax and Data Types

4 topics
Sample questions

Which of the following statements correctly declares a mutable variable in Rust?

let x: i32 = 5;

let mut x: i32 = 5;

var x: i32 = 5;

let x = 5;

What is the default data type for a floating-point number in Rust?

f32

f64

i32

u32

Which of the following is a valid way to create a constant in Rust?

const PI: f64 = 3.14;

let PI: f64 = 3.14;

static PI: f64 = 3.14;

const PI = 3.14;

What will be the output of the following code snippet?

let x = 10; let y = &x; println!("{}", y);

10

&10

Error: cannot print reference

Error: mismatched types

Which of the following types can be used to represent a boolean value in Rust?

bool

boolean

b

bools

Quiz Topics

10 Modules

Advanced Topics

4 topics
1.

Asynchronous Programming with async/await

10 questions
2.

FFI (Foreign Function Interface)

10 questions
3.

Macros and Procedural Macros

10 questions
4.

Unsafe Rust

10 questions

Testing and Debugging

4 topics

Smart Pointers

4 topics

Traits and Generics

4 topics

Concurrency

4 topics

Modules and Crates

4 topics

Error Handling

4 topics

Structs and Enums

4 topics

Ownership and Borrowing

4 topics

Basic Syntax and Data Types

4 topics