Interview Prep Zoneby CuriouserLabs
🧬

Generics & the Type System

Type erasure, wildcards and PECS, variance, and designing APIs that are both flexible and safe.

  1. 1

    What is type erasure? What are its practical consequences, and why did Java choose it?

    senior
  2. 2

    Explain PECS (producer extends, consumer super). When do you use wildcards vs type parameters?

    senior
  3. 3

    Why are Java arrays covariant but generics invariant? What is heap pollution?

    staff
  4. 4

    Design question: how do you use bounded and recursive type parameters to build safe, fluent APIs?

    architect
  5. 5

    How does type inference work (diamond, var, generic methods)? Where does it bite back?

    senior