Programming Hard

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)
Answer all 13 questions on Cletica →

What This Quiz Covers

Cletica

Want to create your own quiz?

Build surveys and quizzes, share with anyone, collect responses — free to start.

Try Cletica for free →