Enums and Pattern Matching interview questions

15 Enums and Pattern Matching questions from the Swift 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 Enumeration?

Junior
  1. A.a type defining a fixed group of related named cases
  2. B.a control structure that must exhaustively match a value against patterns
  3. C.extra data attached to a particular case, letting it carry context alongside its name
  4. D.an extra boolean condition added to a case pattern to refine when it matches

Answer + AI explanation with Pro

2. Which term means: "a type defining a fixed group of related named cases"?

Junior
  1. A.Switch statement
  2. B.Enumeration
  3. C.Associated values
  4. D.where clause

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.Enumeration — a control structure that must exhaustively match a value against patterns
  2. B.Enumeration — a type defining a fixed group of related named cases
  3. C.Enumeration — extra data attached to a particular case, letting it carry context alongside its name
  4. D.Enumeration — a fixed underlying literal, such as an integer or string, prefilled for each case

Answer + AI explanation with Pro

4. What is Associated values?

Mid
  1. A.a type defining a fixed group of related named cases
  2. B.a control structure that must exhaustively match a value against patterns
  3. C.a fixed underlying literal, such as an integer or string, prefilled for each case
  4. D.extra data attached to a particular case, letting it carry context alongside its name

Answer + AI explanation with Pro

5. Which term means: "extra data attached to a particular case, letting it carry context alongside its name"?

Mid
  1. A.Associated values
  2. B.Switch statement
  3. C.where clause
  4. D.Enumeration

Answer + AI explanation with Pro

6. Which statement is correct?

Mid
  1. A.Associated values — a type defining a fixed group of related named cases
  2. B.Associated values — an extra boolean condition added to a case pattern to refine when it matches
  3. C.Associated values — a control structure that must exhaustively match a value against patterns
  4. D.Associated values — extra data attached to a particular case, letting it carry context alongside its name

Answer + AI explanation with Pro

7. What is Switch statement?

Junior
  1. A.an extra boolean condition added to a case pattern to refine when it matches
  2. B.extra data attached to a particular case, letting it carry context alongside its name
  3. C.a control structure that must exhaustively match a value against patterns
  4. D.a fixed underlying literal, such as an integer or string, prefilled for each case

Answer + AI explanation with Pro

8. Which term means: "a control structure that must exhaustively match a value against patterns"?

Junior
  1. A.Switch statement
  2. B.Associated values
  3. C.Raw value
  4. D.Enumeration

Answer + AI explanation with Pro

9. Which statement is correct?

Junior
  1. A.Switch statement — extra data attached to a particular case, letting it carry context alongside its name
  2. B.Switch statement — a control structure that must exhaustively match a value against patterns
  3. C.Switch statement — a fixed underlying literal, such as an integer or string, prefilled for each case
  4. D.Switch statement — an extra boolean condition added to a case pattern to refine when it matches

Answer + AI explanation with Pro

10. What is where clause?

Mid
  1. A.a fixed underlying literal, such as an integer or string, prefilled for each case
  2. B.an extra boolean condition added to a case pattern to refine when it matches
  3. C.extra data attached to a particular case, letting it carry context alongside its name
  4. D.a control structure that must exhaustively match a value against patterns

Answer + AI explanation with Pro

11. Which term means: "an extra boolean condition added to a case pattern to refine when it matches"?

Mid
  1. A.Associated values
  2. B.where clause
  3. C.Switch statement
  4. D.Raw value

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.where clause — a control structure that must exhaustively match a value against patterns
  2. B.where clause — an extra boolean condition added to a case pattern to refine when it matches
  3. C.where clause — a type defining a fixed group of related named cases
  4. D.where clause — a fixed underlying literal, such as an integer or string, prefilled for each case

Answer + AI explanation with Pro

13. What is Raw value?

Mid
  1. A.a fixed underlying literal, such as an integer or string, prefilled for each case
  2. B.an extra boolean condition added to a case pattern to refine when it matches
  3. C.a type defining a fixed group of related named cases
  4. D.extra data attached to a particular case, letting it carry context alongside its name

Answer + AI explanation with Pro

14. Which term means: "a fixed underlying literal, such as an integer or string, prefilled for each case"?

Mid
  1. A.Enumeration
  2. B.where clause
  3. C.Switch statement
  4. D.Raw value

Answer + AI explanation with Pro

15. Which statement is correct?

Mid
  1. A.Raw value — an extra boolean condition added to a case pattern to refine when it matches
  2. B.Raw value — extra data attached to a particular case, letting it carry context alongside its name
  3. C.Raw value — a control structure that must exhaustively match a value against patterns
  4. D.Raw value — a fixed underlying literal, such as an integer or string, prefilled for each case

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 Enums and 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