Generics & Closures interview questions

18 real Generics & Closures questions from the Rust bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Generic function?

Junior
  1. A.an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
  2. B.a function parameterized over one or more type placeholders so it works for many concrete types
  3. C.the closure trait for callables that consume captured values and can therefore be invoked at most one time
  4. D.the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.Generic function — the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
  2. B.Generic function — the closure trait for callables that consume captured values and can therefore be invoked at most one time
  3. C.Generic function — an anonymous function that can capture variables from the surrounding scope
  4. D.Generic function — a function parameterized over one or more type placeholders so it works for many concrete types
Reveal the answer + AI explanation — free account

4. What is Monomorphization?

Senior
  1. A.an anonymous function that can capture variables from the surrounding scope
  2. B.the closure trait for callables that consume captured values and can therefore be invoked at most one time
  3. C.the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
  4. D.the compile-time process of generating a specialized copy of generic code for each concrete type used, yielding zero-cost abstraction
Reveal the answer + AI explanation — free account

5. Which term means: "the compile-time process of generating a specialized copy of generic code for each concrete type used, yielding zero-cost abstraction"?

Senior
  1. A.Closure
  2. B.FnOnce
  3. C.Monomorphization
  4. D.move closure
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Senior
  1. A.Monomorphization — the compile-time process of generating a specialized copy of generic code for each concrete type used, yielding zero-cost abstraction
  2. B.Monomorphization — the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
  3. C.Monomorphization — an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
  4. D.Monomorphization — the closure trait for callables that consume captured values and can therefore be invoked at most one time
Reveal the answer + AI explanation — free account

7. What is Closure?

Junior
  1. A.an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
  2. B.the closure trait for callables that consume captured values and can therefore be invoked at most one time
  3. C.an anonymous function that can capture variables from the surrounding scope
  4. D.the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.Closure — a function parameterized over one or more type placeholders so it works for many concrete types
  2. B.Closure — an anonymous function that can capture variables from the surrounding scope
  3. C.Closure — the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
  4. D.Closure — an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
Reveal the answer + AI explanation — free account

10. What is FnOnce?

Mid
  1. A.the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
  2. B.the closure trait for callables that consume captured values and can therefore be invoked at most one time
  3. C.an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
  4. D.an anonymous function that can capture variables from the surrounding scope
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.FnOnce — a function parameterized over one or more type placeholders so it works for many concrete types
  2. B.FnOnce — the closure trait for callables that consume captured values and can therefore be invoked at most one time
  3. C.FnOnce — the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
  4. D.FnOnce — an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
Reveal the answer + AI explanation — free account

13. What is FnMut?

Mid
  1. A.the compile-time process of generating a specialized copy of generic code for each concrete type used, yielding zero-cost abstraction
  2. B.an anonymous function that can capture variables from the surrounding scope
  3. C.the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
  4. D.the closure trait for callables that consume captured values and can therefore be invoked at most one time
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.FnMut — the closure trait for callables that consume captured values and can therefore be invoked at most one time
  2. B.FnMut — the compile-time process of generating a specialized copy of generic code for each concrete type used, yielding zero-cost abstraction
  3. C.FnMut — the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
  4. D.FnMut — an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
Reveal the answer + AI explanation — free account

16. What is move closure?

Mid
  1. A.an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
  2. B.the closure trait for callables that consume captured values and can therefore be invoked at most one time
  3. C.a function parameterized over one or more type placeholders so it works for many concrete types
  4. D.the compile-time process of generating a specialized copy of generic code for each concrete type used, yielding zero-cost abstraction
Reveal the answer + AI explanation — free account

17. Which term means: "an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread"?

Mid
  1. A.FnMut
  2. B.Generic function
  3. C.move closure
  4. D.FnOnce
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.move closure — the compile-time process of generating a specialized copy of generic code for each concrete type used, yielding zero-cost abstraction
  2. B.move closure — an anonymous function forced by a keyword to take ownership of its captured variables, commonly required when passing work to a thread
  3. C.move closure — an anonymous function that can capture variables from the surrounding scope
  4. D.move closure — the closure trait for callables that mutably borrow their captures and may be invoked repeatedly
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Generics & Closures free