TypeScript is now the default for serious JavaScript projects, and its interviews test how well you use the type system to catch bugs at compile time: types vs interfaces, generics, union and intersection types, and type narrowing. Here are the TypeScript interview questions that actually get asked, with answers. (See also our JavaScript guide.)
Types & interfaces
- Why TypeScript over JavaScript? What problems does it solve?
- type vs interface — when to use each.
- any vs unknown vs never.
- Optional, readonly, and union/intersection types.
- Enums and literal types.
Generics & advanced types
- What are generics and why use them?
- Utility types — Partial, Pick, Omit, Record, Readonly.
- Type narrowing and type guards.
- Mapped types and conditional types (advanced).
Practical TypeScript
- Structural typing — how TypeScript decides type compatibility.
- What does the compiler do; tsconfig basics.
- Declaration files (.d.ts).
- How does TypeScript work with existing JavaScript?
: any everywhere defeats the point, and interviewers can tell.How to prepare
TypeScript rounds probe the type system practically. Practise explaining generics and narrowing out loud. Greenroom runs spoken technical interviews that follow up on your reasoning. Pair it with our JavaScript and React guides.
Frequently asked questions
What are the most common TypeScript interview questions?
Common TypeScript questions cover why TypeScript over JavaScript, type vs interface, any vs unknown vs never, union and intersection types, optional and readonly properties, enums and literal types, generics, utility types (Partial, Pick, Omit, Record), type narrowing and type guards, structural typing, tsconfig basics, and declaration files.
What is the difference between type and interface in TypeScript?
Both define the shape of objects. Interfaces are extendable and can be merged through declaration merging, and are conventional for object and class contracts. Type aliases are more flexible — they can represent unions, intersections, primitives, tuples and mapped types — but can't be reopened. In practice, use interface for object shapes you may extend, and type for unions and more complex compositions.
What are generics in TypeScript?
Generics let you write reusable components and functions that work over a variety of types while preserving type safety, using a type parameter like
How should I prepare for a TypeScript interview?
Focus on using the type system to prevent bugs — generics, union and intersection types, narrowing and utility types — rather than just adding annotations, since overusing any defeats the purpose and interviewers notice. Practise explaining generics and type narrowing out loud with a voice-based mock interview that follows up, because TypeScript rounds probe practical type-system understanding.