Generics & Closures interview questions

18 Generics & Closures questions from the Rust bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

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

Answer + AI explanation with Pro

2. Which term means: "a function parameterized over one or more type placeholders so it works for many concrete types"?

Junior
  1. A.Monomorphization
  2. B.Generic function
  3. C.move closure
  4. D.Closure

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

8. Which term means: "an anonymous function that can capture variables from the surrounding scope"?

Junior
  1. A.Closure
  2. B.Generic function
  3. C.FnOnce
  4. D.FnMut

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

11. Which term means: "the closure trait for callables that consume captured values and can therefore be invoked at most one time"?

Mid
  1. A.Closure
  2. B.FnOnce
  3. C.move closure
  4. D.Generic function

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

14. Which term means: "the closure trait for callables that mutably borrow their captures and may be invoked repeatedly"?

Mid
  1. A.Closure
  2. B.Monomorphization
  3. C.FnMut
  4. D.Generic function

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Generics & Closures question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers