Enums and Pattern Matching interview questions

15 real Enums and Pattern Matching questions from the Swift 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 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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
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 Enums and Pattern Matching free