Rust Programming Language MCQ Test: Rust Programming Language MCQs - Practice Questions
1. In Rust, what is the purpose of the 'borrow checker'?
2. What is the file extension for Rust source code files?
3. What is the main purpose of a Cargo.toml file in Rust projects?
4. What are Rust's unsafe blocks, and in what scenarios are they used?
5. Which Rust data type is used for boolean values?
6. What are Rust macros, and how do they differ from functions?
7. Discuss Rust's philosophy of 'Fearless Concurrency' and how its language features contribute to achieving this.
8. Which attribute is used to mark a function as an asynchronous task in Rust?
9. What is the primary purpose of the 'enum' keyword in Rust?
10. What is the purpose of the 'Cow' type in Rust?
11. What is the ownership system designed to achieve in Rust?
12. Which Rust keyword is used to declare a variable binding?
13. What is the purpose of the 'mut' keyword in Rust?
14. What is the purpose of the 'Box' type in Rust?
15. What is the purpose of the 'async' keyword in Rust, and how does it relate to asynchronous programming?
16. Which Rust data type is used to represent floating-point numbers?
17. In Rust, what does the 'match' keyword do?
18. Explain the concept of lifetimes in Rust and their role in the borrow checker.
19. Discuss Rust's ownership model and how it handles resource cleanup and prevents memory leaks.
20. How does Rust handle panics, and what mechanisms are in place for recovering from them?