JavaScript: TypeScript Interfaces & Generics
Interfaces and generics are where TypeScript really starts paying off — letting you write reusable, type-safe code instead of duplicating logic for every type. This quiz tests the concepts that separate basic TypeScript from confident TypeScript.
Questions cover defining interfaces, optional properties, generic functions and classes, type constraints with extends, and the practical differences between type and interface.
Comfortable writing function process<T>(item: T): T without thinking twice? This one's for you.
Start quiz →
Opens in a new tab on Cletica
Sample questions3 of 13 shown
Q1
What is the primary purpose of interfaces in TypeScript?
Q2
Which keyword is used to declare an interface in TypeScript?
Q3
Which of the following are valid ways to use generics in TypeScript? (Select all that apply)
What This Quiz Covers
- Declaring and using interfaces
- Optional properties in interfaces
- Generic functions, classes, and interfaces
- Constraining generics with extends
- type vs. interface — when to use each
- Utility types like Required<T>
Cletica
Want to create your own quiz?
Build surveys and quizzes, share with anyone, collect responses — free to start.
Try Cletica for free →