Protocols and Generics interview questions

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.

Take the free IT readiness check

or take a mock interview set up for this area

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

Answer + AI explanation with Pro

2. Which term means: "a blueprint of methods and properties that conforming types must implement"?

Junior
  1. A.Protocol-oriented programming
  2. B.Generics
  3. C.Protocol
  4. D.Extension

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

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
  1. A.Generics
  2. B.Associated type
  3. C.Extension
  4. D.Protocol-oriented programming

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

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
  1. A.Protocol-oriented programming
  2. B.Associated type
  3. C.Protocol
  4. D.Generics

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

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
  1. A.Associated type
  2. B.Extension
  3. C.Protocol
  4. D.Generics

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

14. Which term means: "adding methods, computed properties, or conformances to an existing type without modifying its source"?

Mid
  1. A.Protocol
  2. B.Extension
  3. C.Protocol-oriented programming
  4. D.Generics

Answer + AI explanation with Pro

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

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.

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