TypeScript Interview Questions
Ten to know.
TypeScript questions come up in almost every web developer interview. Here are ten, with short answers. Pause and answer each one first.

- Ten questions
- Short answers
- Answer first
Questions one to five
What is TypeScript? JavaScript with static types, compiled to JavaScript. Type or interface? Both describe objects, aliases also do unions. Any versus unknown? Unknown forces a check. What is narrowing? Checking a type to get a more specific one. What are generics? Type parameters for reusable code.
| Question | Short answer |
|---|---|
| What is TypeScript? | typed JavaScript, compiled to JS |
| type vs interface? | both for objects; type for unions |
| any vs unknown? | unknown forces a check |
| Narrowing? | checks give specific types |
| Generics? | reusable type parameters |
Questions six to ten
What's a discriminated union? Shapes sharing a literal kind field. What does keyof do? Gives property names as a union. Name some utility types? Partial, Pick, Omit, and Record. Do types exist at runtime? No, they're erased. And what does strict do? Turns on the safety checks.
| Question | Short answer |
|---|---|
| Discriminated union? | shapes with a kind field |
| keyof? | property names as a union |
| Utility types? | Partial, Pick, Omit, Record |
| Types at runtime? | no, they're erased |
| strict? | turns on safety checks |
Summary
Ten questions, ten short answers. Know these, and most TypeScript interviews feel easy. Next, the TypeScript ecosystem.
Key takeaways- unknown
- Narrowing
- Erased types