Generics & Collections interview questions

24 Generics & Collections questions from the C# 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 Generic type?

Junior
  1. A.the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members
  2. B.a sequence contract extending iteration with a Count property and add/remove/contains mutation operations
  3. C.a type or method parameterized over one or more type arguments supplied at use, giving compile-time type safety without boxing or casts
  4. D.a variance relationship, marked with the out modifier on a type parameter, that lets a sequence of a derived type be used where a sequence of its base type is expected

Answer + AI explanation with Pro

2. Which term means: "a type or method parameterized over one or more type arguments supplied at use, giving compile-time type safety without boxing or casts"?

Junior
  1. A.IEnumerable interface
  2. B.Generic type
  3. C.Dictionary collection
  4. D.Covariance

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.Generic type — a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected
  2. B.Generic type — a type or method parameterized over one or more type arguments supplied at use, giving compile-time type safety without boxing or casts
  3. C.Generic type — a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind
  4. D.Generic type — a sequence contract extending iteration with a Count property and add/remove/contains mutation operations

Answer + AI explanation with Pro

4. What is List collection?

Junior
  1. A.a generic associative container mapping unique keys to values with average constant-time lookup via hashing
  2. B.a generic, resizable, index-addressable sequence backed by an internal array that grows automatically as elements are added
  3. C.a sequence contract extending iteration with a Count property and add/remove/contains mutation operations
  4. D.the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members

Answer + AI explanation with Pro

5. Which term means: "a generic, resizable, index-addressable sequence backed by an internal array that grows automatically as elements are added"?

Junior
  1. A.Covariance
  2. B.IEnumerable interface
  3. C.List collection
  4. D.Dictionary collection

Answer + AI explanation with Pro

6. Which statement is correct?

Junior
  1. A.List collection — a type or method parameterized over one or more type arguments supplied at use, giving compile-time type safety without boxing or casts
  2. B.List collection — a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected
  3. C.List collection — a generic associative container mapping unique keys to values with average constant-time lookup via hashing
  4. D.List collection — a generic, resizable, index-addressable sequence backed by an internal array that grows automatically as elements are added

Answer + AI explanation with Pro

7. What is Dictionary collection?

Junior
  1. A.a sequence contract extending iteration with a Count property and add/remove/contains mutation operations
  2. B.a generic associative container mapping unique keys to values with average constant-time lookup via hashing
  3. C.a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected
  4. D.a variance relationship, marked with the out modifier on a type parameter, that lets a sequence of a derived type be used where a sequence of its base type is expected

Answer + AI explanation with Pro

8. Which term means: "a generic associative container mapping unique keys to values with average constant-time lookup via hashing"?

Junior
  1. A.List collection
  2. B.Dictionary collection
  3. C.Covariance
  4. D.Generic constraint

Answer + AI explanation with Pro

9. Which statement is correct?

Junior
  1. A.Dictionary collection — a type or method parameterized over one or more type arguments supplied at use, giving compile-time type safety without boxing or casts
  2. B.Dictionary collection — a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind
  3. C.Dictionary collection — a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected
  4. D.Dictionary collection — a generic associative container mapping unique keys to values with average constant-time lookup via hashing

Answer + AI explanation with Pro

10. What is Generic constraint?

Mid
  1. A.a sequence contract extending iteration with a Count property and add/remove/contains mutation operations
  2. B.a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind
  3. C.a type or method parameterized over one or more type arguments supplied at use, giving compile-time type safety without boxing or casts
  4. D.the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members

Answer + AI explanation with Pro

11. Which term means: "a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind"?

Mid
  1. A.Generic constraint
  2. B.Covariance
  3. C.IEnumerable interface
  4. D.Generic type

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.Generic constraint — the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members
  2. B.Generic constraint — a sequence contract extending iteration with a Count property and add/remove/contains mutation operations
  3. C.Generic constraint — a generic associative container mapping unique keys to values with average constant-time lookup via hashing
  4. D.Generic constraint — a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind

Answer + AI explanation with Pro

13. What is IEnumerable interface?

Mid
  1. A.the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members
  2. B.a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind
  3. C.a generic associative container mapping unique keys to values with average constant-time lookup via hashing
  4. D.a generic, resizable, index-addressable sequence backed by an internal array that grows automatically as elements are added

Answer + AI explanation with Pro

14. Which term means: "the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members"?

Mid
  1. A.IEnumerable interface
  2. B.Covariance
  3. C.Generic constraint
  4. D.Dictionary collection

Answer + AI explanation with Pro

15. Which statement is correct?

Mid
  1. A.IEnumerable interface — a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind
  2. B.IEnumerable interface — a generic associative container mapping unique keys to values with average constant-time lookup via hashing
  3. C.IEnumerable interface — the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members
  4. D.IEnumerable interface — a sequence contract extending iteration with a Count property and add/remove/contains mutation operations

Answer + AI explanation with Pro

16. What is ICollection interface?

Mid
  1. A.a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected
  2. B.a type or method parameterized over one or more type arguments supplied at use, giving compile-time type safety without boxing or casts
  3. C.a sequence contract extending iteration with a Count property and add/remove/contains mutation operations
  4. D.a generic associative container mapping unique keys to values with average constant-time lookup via hashing

Answer + AI explanation with Pro

17. Which term means: "a sequence contract extending iteration with a Count property and add/remove/contains mutation operations"?

Mid
  1. A.Dictionary collection
  2. B.Contravariance
  3. C.ICollection interface
  4. D.Covariance

Answer + AI explanation with Pro

18. Which statement is correct?

Mid
  1. A.ICollection interface — a sequence contract extending iteration with a Count property and add/remove/contains mutation operations
  2. B.ICollection interface — a generic, resizable, index-addressable sequence backed by an internal array that grows automatically as elements are added
  3. C.ICollection interface — a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected
  4. D.ICollection interface — the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members

Answer + AI explanation with Pro

19. What is Covariance?

Senior
  1. A.the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members
  2. B.a variance relationship, marked with the out modifier on a type parameter, that lets a sequence of a derived type be used where a sequence of its base type is expected
  3. C.a generic associative container mapping unique keys to values with average constant-time lookup via hashing
  4. D.a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind

Answer + AI explanation with Pro

20. Which term means: "a variance relationship, marked with the out modifier on a type parameter, that lets a sequence of a derived type be used where a sequence of its base type is expected"?

Senior
  1. A.Covariance
  2. B.Dictionary collection
  3. C.ICollection interface
  4. D.List collection

Answer + AI explanation with Pro

21. Which statement is correct?

Senior
  1. A.Covariance — a generic, resizable, index-addressable sequence backed by an internal array that grows automatically as elements are added
  2. B.Covariance — a generic associative container mapping unique keys to values with average constant-time lookup via hashing
  3. C.Covariance — a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected
  4. D.Covariance — a variance relationship, marked with the out modifier on a type parameter, that lets a sequence of a derived type be used where a sequence of its base type is expected

Answer + AI explanation with Pro

22. What is Contravariance?

Senior
  1. A.a sequence contract extending iteration with a Count property and add/remove/contains mutation operations
  2. B.a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected
  3. C.the minimal sequence contract that exposes only forward iteration via an enumerator, with no Count, indexer, or mutation members
  4. D.a generic, resizable, index-addressable sequence backed by an internal array that grows automatically as elements are added

Answer + AI explanation with Pro

23. Which term means: "a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected"?

Senior
  1. A.ICollection interface
  2. B.Dictionary collection
  3. C.Generic constraint
  4. D.Contravariance

Answer + AI explanation with Pro

24. Which statement is correct?

Senior
  1. A.Contravariance — a where-clause restriction on a type parameter, such as requiring a base class, an interface, a parameterless constructor, or a reference or value kind
  2. B.Contravariance — a type or method parameterized over one or more type arguments supplied at use, giving compile-time type safety without boxing or casts
  3. C.Contravariance — a variance relationship, marked with the out modifier on a type parameter, that lets a sequence of a derived type be used where a sequence of its base type is expected
  4. D.Contravariance — a variance relationship, marked with the in modifier on a type parameter, that lets a consumer of a base type be used where a consumer of a derived type is expected

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 Generics & Collections 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