Collections & Iterators interview questions

18 real Collections & Iterators 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 Vec?

Junior
  1. A.a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  2. B.a growable, heap-allocated, contiguous sequence of values of a single type
  3. C.a collection storing key-value pairs with average constant-time lookup via hashing
  4. D.a lazy method such as map or filter that wraps one iterator to produce another without consuming it yet
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.Vec — a growable, heap-allocated, contiguous sequence of values of a single type
  2. B.Vec — a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  3. C.Vec — a collection storing key-value pairs with average constant-time lookup via hashing
  4. D.Vec — the property that an iterator chain does no work until a consuming operation drives it
Reveal the answer + AI explanation — free account

4. What is HashMap?

Junior
  1. A.the property that an iterator chain does no work until a consuming operation drives it
  2. B.a collection storing key-value pairs with average constant-time lookup via hashing
  3. C.a growable, heap-allocated, contiguous sequence of values of a single type
  4. D.the consuming method that drains an iterator and gathers its items into a target container such as a vector or map
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.HashMap — a lazy method such as map or filter that wraps one iterator to produce another without consuming it yet
  2. B.HashMap — the consuming method that drains an iterator and gathers its items into a target container such as a vector or map
  3. C.HashMap — a collection storing key-value pairs with average constant-time lookup via hashing
  4. D.HashMap — a growable, heap-allocated, contiguous sequence of values of a single type
Reveal the answer + AI explanation — free account

7. What is String slice?

Junior
  1. A.a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  2. B.a growable, heap-allocated, contiguous sequence of values of a single type
  3. C.a lazy method such as map or filter that wraps one iterator to produce another without consuming it yet
  4. D.a collection storing key-value pairs with average constant-time lookup via hashing
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.String slice — a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  2. B.String slice — a collection storing key-value pairs with average constant-time lookup via hashing
  3. C.String slice — the consuming method that drains an iterator and gathers its items into a target container such as a vector or map
  4. D.String slice — a lazy method such as map or filter that wraps one iterator to produce another without consuming it yet
Reveal the answer + AI explanation — free account

10. What is Iterator adaptor?

Mid
  1. A.a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  2. B.the property that an iterator chain does no work until a consuming operation drives it
  3. C.the consuming method that drains an iterator and gathers its items into a target container such as a vector or map
  4. D.a lazy method such as map or filter that wraps one iterator to produce another without consuming it yet
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.Iterator adaptor — a lazy method such as map or filter that wraps one iterator to produce another without consuming it yet
  2. B.Iterator adaptor — a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  3. C.Iterator adaptor — the consuming method that drains an iterator and gathers its items into a target container such as a vector or map
  4. D.Iterator adaptor — a collection storing key-value pairs with average constant-time lookup via hashing
Reveal the answer + AI explanation — free account

13. What is Lazy evaluation?

Mid
  1. A.a lazy method such as map or filter that wraps one iterator to produce another without consuming it yet
  2. B.a growable, heap-allocated, contiguous sequence of values of a single type
  3. C.a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  4. D.the property that an iterator chain does no work until a consuming operation drives it
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.Lazy evaluation — the property that an iterator chain does no work until a consuming operation drives it
  2. B.Lazy evaluation — a collection storing key-value pairs with average constant-time lookup via hashing
  3. C.Lazy evaluation — a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  4. D.Lazy evaluation — the consuming method that drains an iterator and gathers its items into a target container such as a vector or map
Reveal the answer + AI explanation — free account

16. What is collect?

Mid
  1. A.a growable, heap-allocated, contiguous sequence of values of a single type
  2. B.the property that an iterator chain does no work until a consuming operation drives it
  3. C.a collection storing key-value pairs with average constant-time lookup via hashing
  4. D.the consuming method that drains an iterator and gathers its items into a target container such as a vector or map
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.collect — a lazy method such as map or filter that wraps one iterator to produce another without consuming it yet
  2. B.collect — a borrowed, immutable, UTF-8 view into string data, written &str, that does not own its bytes
  3. C.collect — a growable, heap-allocated, contiguous sequence of values of a single type
  4. D.collect — the consuming method that drains an iterator and gathers its items into a target container such as a vector or map
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 Collections & Iterators free