Generics interview questions

15 Generics questions from the Java 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 guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard
  2. B.the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility
  3. C.a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments
  4. D.a class or interface parameterized over a type, like List<String>, that provides compile-time type safety

Answer + AI explanation with Pro

2. Which term means: "a class or interface parameterized over a type, like List<String>, that provides compile-time type safety"?

Junior
  1. A.Generic type
  2. B.Wildcard
  3. C.PECS principle
  4. D.Type erasure

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.Generic type — a class or interface parameterized over a type, like List<String>, that provides compile-time type safety
  2. B.Generic type — a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments
  3. C.Generic type — the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility
  4. D.Generic type — the ? token used in a parameterized type to represent an unknown type, as in List<?>

Answer + AI explanation with Pro

4. What is Type erasure?

Mid
  1. A.the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility
  2. B.a class or interface parameterized over a type, like List<String>, that provides compile-time type safety
  3. C.a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments
  4. D.the ? token used in a parameterized type to represent an unknown type, as in List<?>

Answer + AI explanation with Pro

5. Which term means: "the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility"?

Mid
  1. A.Bounded type parameter
  2. B.Generic type
  3. C.Type erasure
  4. D.Wildcard

Answer + AI explanation with Pro

6. Which statement is correct?

Mid
  1. A.Type erasure — the guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard
  2. B.Type erasure — the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility
  3. C.Type erasure — a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments
  4. D.Type erasure — a class or interface parameterized over a type, like List<String>, that provides compile-time type safety

Answer + AI explanation with Pro

7. What is Bounded type parameter?

Mid
  1. A.a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments
  2. B.the ? token used in a parameterized type to represent an unknown type, as in List<?>
  3. C.the guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard
  4. D.a class or interface parameterized over a type, like List<String>, that provides compile-time type safety

Answer + AI explanation with Pro

8. Which term means: "a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments"?

Mid
  1. A.Generic type
  2. B.Wildcard
  3. C.PECS principle
  4. D.Bounded type parameter

Answer + AI explanation with Pro

9. Which statement is correct?

Mid
  1. A.Bounded type parameter — a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments
  2. B.Bounded type parameter — the guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard
  3. C.Bounded type parameter — the ? token used in a parameterized type to represent an unknown type, as in List<?>
  4. D.Bounded type parameter — a class or interface parameterized over a type, like List<String>, that provides compile-time type safety

Answer + AI explanation with Pro

10. What is Wildcard?

Senior
  1. A.a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments
  2. B.the guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard
  3. C.the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility
  4. D.the ? token used in a parameterized type to represent an unknown type, as in List<?>

Answer + AI explanation with Pro

11. Which term means: "the ? token used in a parameterized type to represent an unknown type, as in List<?>"?

Senior
  1. A.Type erasure
  2. B.Wildcard
  3. C.Generic type
  4. D.Bounded type parameter

Answer + AI explanation with Pro

12. Which statement is correct?

Senior
  1. A.Wildcard — the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility
  2. B.Wildcard — the guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard
  3. C.Wildcard — a class or interface parameterized over a type, like List<String>, that provides compile-time type safety
  4. D.Wildcard — the ? token used in a parameterized type to represent an unknown type, as in List<?>

Answer + AI explanation with Pro

13. What is PECS principle?

Senior
  1. A.a type parameter restricted with extends to a supertype, such as <T extends Number>, limiting the allowed arguments
  2. B.the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility
  3. C.the ? token used in a parameterized type to represent an unknown type, as in List<?>
  4. D.the guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard

Answer + AI explanation with Pro

14. Which term means: "the guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard"?

Senior
  1. A.Wildcard
  2. B.PECS principle
  3. C.Generic type
  4. D.Bounded type parameter

Answer + AI explanation with Pro

15. Which statement is correct?

Senior
  1. A.PECS principle — the guideline producer-extends-consumer-super for choosing between an upper-bounded and a lower-bounded wildcard
  2. B.PECS principle — the process by which the compiler removes generic type information at runtime, leaving raw types for backward compatibility
  3. C.PECS principle — the ? token used in a parameterized type to represent an unknown type, as in List<?>
  4. D.PECS principle — a class or interface parameterized over a type, like List<String>, that provides compile-time type safety

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 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