W3
Teacher
Explore
Browse by field
Artificial Intelligence
Accounting & Finance
Information Technology
Show all fields
Interview Q&A
All Interview Questions
Beginner
Intermediate
Advanced
Practice
MCQs
Quizzes
Mock Interviews
About
Light
Dark
Auto
Sign in
Get Started
Search interview questions
Search
113 questions for “Generics”
Found in 1 field. Select a question to see its full answer.
Matching topics
C#
Generics
17
Java
Generics
15
TypeScript
Generics
10
Flutter
Dart Collections &
Generics
7
Information Technology
113 questions in 4 technologies
#
Question
Technology
Topic
Level
1
What are
generics
in C#, and what specific problems do they solve compared to writing type-specific code?
C# › Generics
C#
Generics
Intermediate
2
What are
generics
and why use them?
C# › Generics
C#
Generics
Beginner
3
What problem do
generics
solve compared to using 'any' for a reusable function?
TypeScript › Generics
TypeScript
Generics
Beginner
4
What problem do
generics
solve compared to writing a method or class that accepts 'object'?
C# › Generics
C#
Generics
Beginner
5
What problem do
generics
solve compared to using raw types (like a pre-Java-5 List without a type parameter), and how do they improve compile-time type safety?
Java › Generics
Java
Generics
Beginner
6
What is covariance and contravariance in
generics
?
C# › Generics
C#
Generics
Intermediate
7
What is a raw type in Java, and why does the compiler still permit using them (with an unchecked warning) despite
generics
having been available since Java 5?
Java › Generics
Java
Generics
Intermediate
8
How are
generics
implemented for value types vs reference types in the CLR?
C# › Generics
C#
Generics
Advanced
9
How do
generics
interact with arrays, and why does the JDK itself sometimes use an unsafe cast (like in ArrayList's internal implementation) to work around the inability to create generic arrays directly?
Java › Generics
Java
Generics
Advanced
10
How does variance (covariance, contravariance, invariance) apply differently to Java arrays versus Java
generics
, and what practical safety trade-off does this design difference represent?
Java › Generics
Java
Generics
Advanced
Show all 113 questions in Information Technology