πŸ§ͺ Rust (programming language) MCQ Quiz Hub

Rust Programming Language Mcq

Choose a topic to test your knowledge and improve your Rust (programming language) skills

The ioctl() function is used to interact with which of the following?





βœ… Correct Answer: 3

Which of the following best describes the purpose of the unlink() call?





βœ… Correct Answer: 1

Which of the following is the result of a process calling UNIX exec()?





βœ… Correct Answer: 3

CORBA's DII allows a client to do which one of the following?





βœ… Correct Answer: 4

The result of calling kill(6003, 0) is which of the following?





βœ… Correct Answer: 4

Which of the following techniques can help keep system programs secure?





βœ… Correct Answer: 4

Which of the following could the fork() command return to the child process?





βœ… Correct Answer: 4

Which of the following is correct for the standard file descriptors that are automatically opened in UNIX?





βœ… Correct Answer: 2

When a new process is created using fork(), which of the following describes the state of open file descriptors?The child inherits the parent’s





βœ… Correct Answer: 2

An orphan process occurs as a result of which of the following conditions?





βœ… Correct Answer: 3

Race conditions are caused by which of the following conditions in a multi threaded system?





βœ… Correct Answer: 3

You want to listen on a port for some user-defined data stream. Would you use port 80?





βœ… Correct Answer: 2

The purpose of the poll() and select() system calls is to perform which of the following functions?





βœ… Correct Answer: 1

Which of the following provides the most random seed source for a pseudo random number generator?





βœ… Correct Answer: 2

Which type cast preserves the mathematical value in all cases?





βœ… Correct Answer: 3

Which choice is not a scalar data type?





βœ… Correct Answer: 4

_ cannot be destructured.





βœ… Correct Answer: 1

Which cargo command checks a program for error without creating a binary executable?





βœ… Correct Answer: 4

The term box and related phrases such as boxing a value are often used when relating to memory layout. What does box refer to?





βœ… Correct Answer: 2

Using the ? operator at the end of an expression is equivalent to





βœ… Correct Answer: 1

Which is valid syntax for defining an array of i32 values?





βœ… Correct Answer: 3

The smart pointers Rc and Arc provide reference counting. What is the API for incrementing a reference count?





βœ… Correct Answer: 3

What happens when an error occurs that is being handled by the question mark (?) operator?





βœ… Correct Answer: 4

Which comment syntax is not legal?





βœ… Correct Answer: 2

In matching patterns, values are ignored with _.





βœ… Correct Answer: 3

Defining a _ requires a lifetime parameter.





βœ… Correct Answer: 2

Which statement about lifetimes is false?





βœ… Correct Answer: 4

When used as a return type, which Rust type plays a similar role to Python's None, JavaScript's null, or the void type in C/C++?





βœ… Correct Answer: 4

Which statement about the Clone and Copy traits is false?





βœ… Correct Answer: 1

What smart pointer is used to allow multiple ownership of a value in various threads?





βœ… Correct Answer: 1

Which types are not allowed within an enum variant's body?





βœ… Correct Answer: 3

Your application requires a single copy of some data type T to be held in memory that can be accessed by multiple threads. What is the thread-safe wrapper type?





βœ… Correct Answer: 3

Which choice is not valid loop syntax?





βœ… Correct Answer: 4

Which statement about enums is false?





βœ… Correct Answer: 4

What does an underscore (_) indicate when used as pattern?





βœ… Correct Answer: 1

What is a safe operation on a std::cell:UnsafeCell?





βœ… Correct Answer: 3

Generics are useful when you _.





βœ… Correct Answer: 2

How do you create a Rust project on the command-line?





βœ… Correct Answer: 1