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.
A.a type defining a fixed group of related named cases
B.a control structure that must exhaustively match a value against patterns
C.extra data attached to a particular case, letting it carry context alongside its name
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
A.Switch statement
B.Enumeration
C.Associated values
D.where clause
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Enumeration — a control structure that must exhaustively match a value against patterns
B.Enumeration — a type defining a fixed group of related named cases
C.Enumeration — extra data attached to a particular case, letting it carry context alongside its name
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
A.a type defining a fixed group of related named cases
B.a control structure that must exhaustively match a value against patterns
C.a fixed underlying literal, such as an integer or string, prefilled for each case
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
A.Associated values
B.Switch statement
C.where clause
D.Enumeration
Answer + AI explanation with Pro
6. Which statement is correct?
Mid
A.Associated values — a type defining a fixed group of related named cases
B.Associated values — an extra boolean condition added to a case pattern to refine when it matches
C.Associated values — a control structure that must exhaustively match a value against patterns
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
A.an extra boolean condition added to a case pattern to refine when it matches
B.extra data attached to a particular case, letting it carry context alongside its name
C.a control structure that must exhaustively match a value against patterns
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
A.Switch statement
B.Associated values
C.Raw value
D.Enumeration
Answer + AI explanation with Pro
9. Which statement is correct?
Junior
A.Switch statement — extra data attached to a particular case, letting it carry context alongside its name
B.Switch statement — a control structure that must exhaustively match a value against patterns
C.Switch statement — a fixed underlying literal, such as an integer or string, prefilled for each case
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
A.a fixed underlying literal, such as an integer or string, prefilled for each case
B.an extra boolean condition added to a case pattern to refine when it matches
C.extra data attached to a particular case, letting it carry context alongside its name
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
A.Associated values
B.where clause
C.Switch statement
D.Raw value
Answer + AI explanation with Pro
12. Which statement is correct?
Mid
A.where clause — a control structure that must exhaustively match a value against patterns
B.where clause — an extra boolean condition added to a case pattern to refine when it matches
C.where clause — a type defining a fixed group of related named cases
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
A.a fixed underlying literal, such as an integer or string, prefilled for each case
B.an extra boolean condition added to a case pattern to refine when it matches
C.a type defining a fixed group of related named cases
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
A.Enumeration
B.where clause
C.Switch statement
D.Raw value
Answer + AI explanation with Pro
15. Which statement is correct?
Mid
A.Raw value — an extra boolean condition added to a case pattern to refine when it matches
B.Raw value — extra data attached to a particular case, letting it carry context alongside its name
C.Raw value — a control structure that must exhaustively match a value against patterns
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.