The Rust programming language, sponsored by Mozilla, is closing in on the end of its first decade and it is picking up developers as it goes. Rust creator Graydon Hoare, reflecting (via Twitter) earlier this year on the publication of Programming Rust: Fast, Safe Systems Development by O’Reilly Media, described the birth of Rust as follows:
“I made a prototype, then my employer threw millions of dollars at it and hired dozens of researchers and programmers (and tireless interns, hi!) and a giant community of thousands of volunteers showed up and _then_ the book arrived.” (Mozilla is the employer referred to in Hoare’s tweet.)
Rust, a systems language similar in syntax to C, is currently in release 1.29 as I write this. If you are involved in web development, then the odds are good you’ve worked with Rust — and the real question becomes, “How well do you know it?”
The following 25 questions are intended to test your knowledge of various aspects of Rust from history to syntax and everything in between. The answers appear at the end of the questions. In all cases, pick the one best answer(s) to each question. Good luck!
1. Which of the following tools is used to install and manage Rust?
A. rustic
B. rust_e
C. rustc
D. rustup
2. Which keyword is used to link an external crate, function, or variable?
A. confirm
B. drop
C. create
D. extern
3. Which trait is required with the use of the assert_eq! macro?
A. PartialEq
B. Eq
C. derive
D. Debug
4. Which of the following specifies an explicitly absolute path?
A. self::path
B. ::path
C. super::path
D. path::self
5. Which keyword is used for the parent module of the current module?
A. mother
B. parent
C. super
D. kin
6. Which construct should be used to define a macro?
A. macro_rules!
B. <macro_rules!>
C. [macro_rules!]
D. {macro_rules!}
7. Which of the following is a Rust keyword and can NOT be used as the name of a variable?
A. what
B. when
C. where
D. who
8. Per lexical convention, which of the following are used to signify the start of comments in Rust code?
A. //
B. <comment
C. [ /
D. <!note:
9. Which keyword is used to denote unsafe code, functions, traits, or implementations?
A. chance
B. peril
C. unsafe
D. avoid
10. Built around Unicode, what does U+000A mean in Rust?
A. vertical tab
B. horizontal tab
C. line feed
D. space
11. What is the range of the 128-bit unsigned integer primitive u128?
A. [1, 2^128 – 1]
B. [(0^127), 2^128 – 1]
C. [0, 2^128 – 1]
D. [-(2^127), 2^127 – 1]
12. Which type of Rust macros allow creating syntax extensions as execution of a function?
A. secure
B. procedural
C. external
D. stable
E. declarative
13. Which keyword is used to make a closure take ownership of all its captures?
A. close
B. capt
C. move
D. arrest
14. Items are organized within what by a nested set of modules?
A. sandbox
B. crate
C. whole
D. container
15. Using unsafe, which of the following will Rust allow you to do that you normally can not do?
A. Dereference a raw pointer
B. Read from uninitialized memory
C. Index outside the bounds of an object
D. Implement noframes
Please visit GoCertify to attempt the remaining 10 questions of this quiz.
ANSWERS
1. D
2. D
3. A
4. B
5. C
6. A
7. C
8. A
9. C
10. C
11. C
12. B
13. C
14. B
15. A
Important Update: We have updated our Privacy Policy to comply with the California Consumer Privacy Act (CCPA)