TypeScript interview questions
The type system interviewers probe: unknown vs any vs never, generics, utility and conditional types, narrowing, and typing React. 59 free questions in 4 topics, each with its answer and an explanation once you have tried it.
0 of 59 solved
Topics
- Type system fundamentals · Guess the output (3), Quizzes (7), Flashcards (3)
- Generics & utility types · Quizzes (5), Coding drills (9)
- Narrowing & type guards · Quizzes (2), Coding drills (1)
- React with TypeScript · Quizzes (19), Coding drills (4), Flashcards (6)
Type system fundamentals
0 / 13- Not attemptedunknown vs any
- Not attemptedWhere never appears
- Not attemptedinterface vs type
- Not attemptedStructural typing surprise
- Not attemptedEnums vs unions
- Not attemptedNumeric enums have a reverse mapping
- Not attemptedType assertions do nothing at runtime
- Not attemptedOptional vs default parameters
- Not attemptedany vs unknown vs never
- Not attemptedAssertions vs guards
- Not attemptedWhy generics
- Not attemptedConflicting intersectionsDifficulty: hard
- Not attemptedWhat T extends {} allowsDifficulty: medium
Generics & utility types
0 / 14- Not attemptedDistributive conditional types
- Not attemptedsatisfies
- Not attemptedUtility types
- Not attemptedGeneric constraints
- Not attemptedTyped getProperty, update and pairDifficulty: easy
- Not attemptedGeneric Stack classDifficulty: easy
- Not attemptedTyped fetch wrapperDifficulty: easy
- Not attemptedType challenge: MyPickDifficulty: easy
- Not attemptedType challenge: MyOmitDifficulty: medium
- Not attemptedType challenge: Readonly and DeepReadonlyDifficulty: medium
- Not attemptedType challenge: Partial, Required, Exclude, ExtractDifficulty: medium
- Not attemptedType challenge: inferDifficulty: hard
- Not attemptedType challenge: tuplesDifficulty: medium
- Not attemptedLiteral inference through an identity genericDifficulty: medium
Narrowing & type guards
0 / 3React with TypeScript
0 / 29- Not attemptedTyping an input change handler
- Not attemptedExtending native button props
- Not attemptedGeneric components in .tsx
- Not attemptedPassing setState down
- Not attemptedAsync work in useEffect
- Not attemptedTyping useState that starts empty
- Not attemptedTyped reducers
- Not attemptedDecorators
- Not attemptedReact.FC and childrenDifficulty: easy
- Not attemptedReactNode vs JSX.Element for childrenDifficulty: easy
- Not attempteduseRef for a DOM node (React 19 types)Difficulty: medium
- Not attemptedA ref that stores a timer idDifficulty: medium
- Not attemptedTyped context with a guard hookDifficulty: medium
- Not attemptedOverriding a native propDifficulty: medium
- Not attemptedPolymorphic 'as' propDifficulty: hard
- Not attemptedMutually exclusive props need neverDifficulty: hard
- Not attemptedGeneric List infers T from itemsDifficulty: easy
- Not attemptedTemplate literal toast positionsDifficulty: medium
- Not attemptedClass component state fieldDifficulty: hard
- Not attemptedcurrentTarget vs targetDifficulty: medium
- Not attemptedPassing a component as a propDifficulty: medium
- Not attemptedforwardRef swallows genericsDifficulty: hard
- Not attemptedThe typed context recipeDifficulty: medium
- Not attemptedReactNode vs ReactElement vs JSX.ElementDifficulty: easy
- Not attemptedPolymorphic component recipeDifficulty: hard
- Not attemptedType challenge: toast positionsDifficulty: easy
- Not attemptedType challenge: exactly one flag propDifficulty: hard
- Not attemptedType challenge: polymorphic 'as' propsDifficulty: hard
- Not attemptedType challenge: on* handler propsDifficulty: medium
TypeScript interview questions: FAQ
- How many TypeScript interview questions are there?
- 59 questions in 4 topics: Guess the output (3), Quizzes (33), Coding drills (14), Flashcards (9). All of them are free and need no login.
- What do the TypeScript questions cover?
- Type system fundamentals, Generics & utility types, Narrowing & type guards and React with TypeScript.
- How should I practise TypeScript for a frontend interview?
- Go topic by topic and answer each question before you open its answer and explanation. Progress stays in your browser, so Review brings back the questions you missed, and a mock round mixes questions under a timer.