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.

INR100.00
INR1000.00
Unlimited Attempts   (lifetime access)

Try your first attempt for free.

Quiz Topics

10 Modules

Basic Syntax and Data Types

4 topics
1.

Control Flow (if, loop, while, for)

10 questions
2.

Data Types (Scalar and Compound)

10 questions
3.

Functions and Closures

10 questions
4.

Variables and Mutability

10 questions

Ownership and Borrowing

4 topics

Structs and Enums

4 topics

Error Handling

4 topics

Modules and Crates

4 topics

Concurrency

4 topics

Traits and Generics

4 topics

Smart Pointers

4 topics

Testing and Debugging

4 topics

Advanced Topics

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

INR100.00
INR1000.00
Unlimited Attempts   (lifetime access)

Try your first attempt for free

Signup to add this to cart.

Quiz Topics

10 Modules

Basic Syntax and Data Types

4 topics
1.

Control Flow (if, loop, while, for)

10 questions
2.

Data Types (Scalar and Compound)

10 questions
3.

Functions and Closures

10 questions
4.

Variables and Mutability

10 questions

Ownership and Borrowing

4 topics

Structs and Enums

4 topics

Error Handling

4 topics

Modules and Crates

4 topics

Concurrency

4 topics

Traits and Generics

4 topics

Smart Pointers

4 topics

Testing and Debugging

4 topics

Advanced Topics

4 topics