15 Protocols and Generics 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 blueprint of methods and properties that conforming types must implement
B.a design style that favors composing behavior through abstractions and default extensions over class inheritance
C.a placeholder name inside a protocol that conforming types fill in with a concrete type
D.adding methods, computed properties, or conformances to an existing type without modifying its source
Answer + AI explanation with Pro
2. Which term means: "a blueprint of methods and properties that conforming types must implement"?
Junior
A.Protocol-oriented programming
B.Generics
C.Protocol
D.Extension
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Protocol — a blueprint of methods and properties that conforming types must implement
B.Protocol — a placeholder name inside a protocol that conforming types fill in with a concrete type
C.Protocol — writing functions and types parameterized over a type so they work with many kinds while staying type-safe
D.Protocol — a design style that favors composing behavior through abstractions and default extensions over class inheritance
Answer + AI explanation with Pro
4. What is Protocol-oriented programming?
Mid
A.a placeholder name inside a protocol that conforming types fill in with a concrete type
B.adding methods, computed properties, or conformances to an existing type without modifying its source
C.writing functions and types parameterized over a type so they work with many kinds while staying type-safe
D.a design style that favors composing behavior through abstractions and default extensions over class inheritance
Answer + AI explanation with Pro
5. Which term means: "a design style that favors composing behavior through abstractions and default extensions over class inheritance"?
Mid
A.Generics
B.Associated type
C.Extension
D.Protocol-oriented programming
Answer + AI explanation with Pro
6. Which statement is correct?
Mid
A.Protocol-oriented programming — writing functions and types parameterized over a type so they work with many kinds while staying type-safe
B.Protocol-oriented programming — a blueprint of methods and properties that conforming types must implement
C.Protocol-oriented programming — a design style that favors composing behavior through abstractions and default extensions over class inheritance
D.Protocol-oriented programming — adding methods, computed properties, or conformances to an existing type without modifying its source
Answer + AI explanation with Pro
7. What is Associated type?
Senior
A.adding methods, computed properties, or conformances to an existing type without modifying its source
B.a placeholder name inside a protocol that conforming types fill in with a concrete type
C.a design style that favors composing behavior through abstractions and default extensions over class inheritance
D.writing functions and types parameterized over a type so they work with many kinds while staying type-safe
Answer + AI explanation with Pro
8. Which term means: "a placeholder name inside a protocol that conforming types fill in with a concrete type"?
Senior
A.Protocol-oriented programming
B.Associated type
C.Protocol
D.Generics
Answer + AI explanation with Pro
9. Which statement is correct?
Senior
A.Associated type — adding methods, computed properties, or conformances to an existing type without modifying its source
B.Associated type — a placeholder name inside a protocol that conforming types fill in with a concrete type
C.Associated type — a design style that favors composing behavior through abstractions and default extensions over class inheritance
D.Associated type — a blueprint of methods and properties that conforming types must implement
Answer + AI explanation with Pro
10. What is Generics?
Mid
A.a design style that favors composing behavior through abstractions and default extensions over class inheritance
B.a placeholder name inside a protocol that conforming types fill in with a concrete type
C.a blueprint of methods and properties that conforming types must implement
D.writing functions and types parameterized over a type so they work with many kinds while staying type-safe
Answer + AI explanation with Pro
11. Which term means: "writing functions and types parameterized over a type so they work with many kinds while staying type-safe"?
Mid
A.Associated type
B.Extension
C.Protocol
D.Generics
Answer + AI explanation with Pro
12. Which statement is correct?
Mid
A.Generics — a blueprint of methods and properties that conforming types must implement
B.Generics — writing functions and types parameterized over a type so they work with many kinds while staying type-safe
C.Generics — adding methods, computed properties, or conformances to an existing type without modifying its source
D.Generics — a design style that favors composing behavior through abstractions and default extensions over class inheritance
Answer + AI explanation with Pro
13. What is Extension?
Mid
A.a design style that favors composing behavior through abstractions and default extensions over class inheritance
B.adding methods, computed properties, or conformances to an existing type without modifying its source
C.a placeholder name inside a protocol that conforming types fill in with a concrete type
D.writing functions and types parameterized over a type so they work with many kinds while staying type-safe
Answer + AI explanation with Pro
14. Which term means: "adding methods, computed properties, or conformances to an existing type without modifying its source"?
Mid
A.Protocol
B.Extension
C.Protocol-oriented programming
D.Generics
Answer + AI explanation with Pro
15. Which statement is correct?
Mid
A.Extension — a blueprint of methods and properties that conforming types must implement
B.Extension — adding methods, computed properties, or conformances to an existing type without modifying its source
C.Extension — writing functions and types parameterized over a type so they work with many kinds while staying type-safe
D.Extension — a design style that favors composing behavior through abstractions and default extensions over class inheritance
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 Protocols and Generics question come with Pro.