Generics interview questions

15 real Generics questions from the Java 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 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
Reveal the answer + AI explanation — free account

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<?>
Reveal the answer + AI explanation — free account

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<?>
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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<?>
Reveal the answer + AI explanation — free account

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<?>
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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