Pattern Matching interview questions

15 real Pattern Matching 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 match?

Junior
  1. A.a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits
  2. B.the compiler requirement that the arms of a match cover every possible case of the scrutinized value
  3. C.binding the individual fields or elements of a compound value to separate variables within a pattern
  4. D.a concise construct that runs a block only when a value matches one specific pattern, optionally with an else
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.match — a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits
  2. B.match — a concise construct that runs a block only when a value matches one specific pattern, optionally with an else
  3. C.match — a loop that continues executing as long as a value keeps matching the given pattern
  4. D.match — the compiler requirement that the arms of a match cover every possible case of the scrutinized value
Reveal the answer + AI explanation — free account

4. What is if let?

Junior
  1. A.a loop that continues executing as long as a value keeps matching the given pattern
  2. B.a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits
  3. C.a concise construct that runs a block only when a value matches one specific pattern, optionally with an else
  4. D.the compiler requirement that the arms of a match cover every possible case of the scrutinized value
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.if let — a concise construct that runs a block only when a value matches one specific pattern, optionally with an else
  2. B.if let — the compiler requirement that the arms of a match cover every possible case of the scrutinized value
  3. C.if let — binding the individual fields or elements of a compound value to separate variables within a pattern
  4. D.if let — a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits
Reveal the answer + AI explanation — free account

7. What is while let?

Mid
  1. A.a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits
  2. B.the compiler requirement that the arms of a match cover every possible case of the scrutinized value
  3. C.binding the individual fields or elements of a compound value to separate variables within a pattern
  4. D.a loop that continues executing as long as a value keeps matching the given pattern
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.while let — the compiler requirement that the arms of a match cover every possible case of the scrutinized value
  2. B.while let — binding the individual fields or elements of a compound value to separate variables within a pattern
  3. C.while let — a concise construct that runs a block only when a value matches one specific pattern, optionally with an else
  4. D.while let — a loop that continues executing as long as a value keeps matching the given pattern
Reveal the answer + AI explanation — free account

10. What is Exhaustiveness?

Mid
  1. A.a concise construct that runs a block only when a value matches one specific pattern, optionally with an else
  2. B.the compiler requirement that the arms of a match cover every possible case of the scrutinized value
  3. C.a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits
  4. D.a loop that continues executing as long as a value keeps matching the given pattern
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.Exhaustiveness — a loop that continues executing as long as a value keeps matching the given pattern
  2. B.Exhaustiveness — a concise construct that runs a block only when a value matches one specific pattern, optionally with an else
  3. C.Exhaustiveness — binding the individual fields or elements of a compound value to separate variables within a pattern
  4. D.Exhaustiveness — the compiler requirement that the arms of a match cover every possible case of the scrutinized value
Reveal the answer + AI explanation — free account

13. What is Destructuring?

Mid
  1. A.the compiler requirement that the arms of a match cover every possible case of the scrutinized value
  2. B.binding the individual fields or elements of a compound value to separate variables within a pattern
  3. C.a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits
  4. D.a loop that continues executing as long as a value keeps matching the given pattern
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.Destructuring — binding the individual fields or elements of a compound value to separate variables within a pattern
  2. B.Destructuring — the compiler requirement that the arms of a match cover every possible case of the scrutinized value
  3. C.Destructuring — a loop that continues executing as long as a value keeps matching the given pattern
  4. D.Destructuring — a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits
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 Pattern Matching free