← Back to blog

TypeScript interview questions and answers

TypeScript interview questions and answers — cover from Greenroom, the AI mock interviewer

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

Generics & advanced types

TypeScript interview topics — types, interfaces, generics, unions, narrowing
TypeScript rounds test the type system: generics, unions, and narrowing.

Practical TypeScript

The core truth: TypeScript interviews reward using the type system to prevent bugs — generics for reusable type-safe code, narrowing for safety, the right utility type. Adding : 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 . For example, a function identity(value: T): T preserves the input type in its return, and a generic Array or a generic data store works for any element type without losing type information or resorting to any.

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.

TypeScript rounds reward using the type system well, explained out loud. Greenroom runs spoken technical interviews that follow up on your reasoning. Free to start.