Protocols and Generics interview questions

15 real Protocols and Generics 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 Protocol?

Junior
  1. A.a blueprint of methods and properties that conforming types must implement
  2. B.a design style that favors composing behavior through abstractions and default extensions over class inheritance
  3. C.a placeholder name inside a protocol that conforming types fill in with a concrete type
  4. D.adding methods, computed properties, or conformances to an existing type without modifying its source
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.Protocol — a blueprint of methods and properties that conforming types must implement
  2. B.Protocol — a placeholder name inside a protocol that conforming types fill in with a concrete type
  3. C.Protocol — writing functions and types parameterized over a type so they work with many kinds while staying type-safe
  4. D.Protocol — a design style that favors composing behavior through abstractions and default extensions over class inheritance
Reveal the answer + AI explanation — free account

4. What is Protocol-oriented programming?

Mid
  1. A.a placeholder name inside a protocol that conforming types fill in with a concrete type
  2. B.adding methods, computed properties, or conformances to an existing type without modifying its source
  3. C.writing functions and types parameterized over a type so they work with many kinds while staying type-safe
  4. D.a design style that favors composing behavior through abstractions and default extensions over class inheritance
Reveal the answer + AI explanation — free account

5. Which term means: "a design style that favors composing behavior through abstractions and default extensions over class inheritance"?

Mid
  1. A.Generics
  2. B.Associated type
  3. C.Extension
  4. D.Protocol-oriented programming
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.Protocol-oriented programming — writing functions and types parameterized over a type so they work with many kinds while staying type-safe
  2. B.Protocol-oriented programming — a blueprint of methods and properties that conforming types must implement
  3. C.Protocol-oriented programming — a design style that favors composing behavior through abstractions and default extensions over class inheritance
  4. D.Protocol-oriented programming — adding methods, computed properties, or conformances to an existing type without modifying its source
Reveal the answer + AI explanation — free account

7. What is Associated type?

Senior
  1. A.adding methods, computed properties, or conformances to an existing type without modifying its source
  2. B.a placeholder name inside a protocol that conforming types fill in with a concrete type
  3. C.a design style that favors composing behavior through abstractions and default extensions over class inheritance
  4. D.writing functions and types parameterized over a type so they work with many kinds while staying type-safe
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Senior
  1. A.Associated type — adding methods, computed properties, or conformances to an existing type without modifying its source
  2. B.Associated type — a placeholder name inside a protocol that conforming types fill in with a concrete type
  3. C.Associated type — a design style that favors composing behavior through abstractions and default extensions over class inheritance
  4. D.Associated type — a blueprint of methods and properties that conforming types must implement
Reveal the answer + AI explanation — free account

10. What is Generics?

Mid
  1. A.a design style that favors composing behavior through abstractions and default extensions over class inheritance
  2. B.a placeholder name inside a protocol that conforming types fill in with a concrete type
  3. C.a blueprint of methods and properties that conforming types must implement
  4. D.writing functions and types parameterized over a type so they work with many kinds while staying type-safe
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.Generics — a blueprint of methods and properties that conforming types must implement
  2. B.Generics — writing functions and types parameterized over a type so they work with many kinds while staying type-safe
  3. C.Generics — adding methods, computed properties, or conformances to an existing type without modifying its source
  4. D.Generics — a design style that favors composing behavior through abstractions and default extensions over class inheritance
Reveal the answer + AI explanation — free account

13. What is Extension?

Mid
  1. A.a design style that favors composing behavior through abstractions and default extensions over class inheritance
  2. B.adding methods, computed properties, or conformances to an existing type without modifying its source
  3. C.a placeholder name inside a protocol that conforming types fill in with a concrete type
  4. D.writing functions and types parameterized over a type so they work with many kinds while staying type-safe
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.Extension — a blueprint of methods and properties that conforming types must implement
  2. B.Extension — adding methods, computed properties, or conformances to an existing type without modifying its source
  3. C.Extension — writing functions and types parameterized over a type so they work with many kinds while staying type-safe
  4. D.Extension — a design style that favors composing behavior through abstractions and default extensions over class inheritance
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 Protocols and Generics free