Pattern Matching interview questions

15 Pattern Matching 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 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

Answer + AI explanation with Pro

2. Which term means: "a control-flow construct that compares a value against a series of patterns and runs the arm of the first that fits"?

Junior
  1. A.match
  2. B.while let
  3. C.if let
  4. D.Exhaustiveness

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

5. Which term means: "a concise construct that runs a block only when a value matches one specific pattern, optionally with an else"?

Junior
  1. A.Destructuring
  2. B.if let
  3. C.while let
  4. D.match

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

8. Which term means: "a loop that continues executing as long as a value keeps matching the given pattern"?

Mid
  1. A.while let
  2. B.Destructuring
  3. C.Exhaustiveness
  4. D.match

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

11. Which term means: "the compiler requirement that the arms of a match cover every possible case of the scrutinized value"?

Mid
  1. A.if let
  2. B.Destructuring
  3. C.match
  4. D.Exhaustiveness

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

14. Which term means: "binding the individual fields or elements of a compound value to separate variables within a pattern"?

Mid
  1. A.Destructuring
  2. B.if let
  3. C.Exhaustiveness
  4. D.match

Answer + AI explanation with Pro

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

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 Pattern Matching 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