Rust Programming Basics Quiz

1. What is the official name of the Rust compiler?

2. Which command is used to create a new Rust project with Cargo?

3. What is the default entry point function for a Rust executable program?

4. How do you print a line to the console in Rust?

5. What is `Cargo` in the Rust ecosystem?

6. Which keyword is used to declare an immutable variable in Rust?

7. How do you make a variable mutable in Rust?

8. What is a "slice" in Rust?

9. Which of these is NOT a primitive integer type in Rust?

10. What is a "tuple" in Rust?

11. How do you declare a function in Rust?

12. What does `->` signify in a function signature?

13. Which concept is central to Rust's memory safety guarantees without a garbage collector?

14. What is the purpose of `if let` expressions in Rust?

15. How do you create an array in Rust?

16. What does the `&` symbol usually denote in Rust?

17. What is the type of a string literal, e.g., `"Hello, world!"`?

18. How do you convert a `&str` to a `String`?

19. What is a "struct" in Rust?

20. Which of these is the correct way to define an `enum`?

21. What is the primary purpose of the `match` control flow operator?

22. What is an "Option" enum in Rust?

23. How do you loop indefinitely in Rust?

24. What does the `.` operator do when accessing fields of a struct?

25. Which command compiles and runs a Rust project using Cargo?

Quiz Results

You scored 0 out of 25!