TypeScript
Types that catch bugs: generics, narrowing, utility types and typing React.
15 lessons 36 practice questions about 1 hours of reading
Chapter 1, beginner
Foundations
What it is and how it works, the questions every round starts with.
- 01interface vs type in TypeScript
Lesson, 4 min read, then 4 questions to practise
- 02TypeScript vs JavaScript: why use TypeScript?
Lesson, 4 min read, then 2 questions to practise
Chapter 2, intermediate
In depth
How it behaves under the hood, and the follow-ups that come next.
- 03any vs unknown vs never in TypeScript
Lesson, 4 min read
- 05How do you type React props, state and hooks in TypeScript?
Lesson, 4 min read, then 3 questions to practise
- 06keyof and typeof in TypeScript: how do they work?
Lesson, 6 min read, then 5 questions to practise
- Derive types from a config object with keyof, typeof, as const and indexed access
- Type pick and omit functions whose return types follow the keys passed in
- Type Object.keys, Object.entries and Object.fromEntries helpers that keep their key types
- Type an event emitter so on and emit only accept known events and their payloads
- Implement Get<T, Path> to read a nested property type by a dot path
- 07Union vs intersection types in TypeScript
Lesson, 4 min read, then 1 question to practise
- 08What are .d.ts declaration files and triple-slash directives in TypeScript?
Lesson, 5 min read, then 1 question to practise
- 09What are decorators in TypeScript?
Lesson, 6 min read, then 4 questions to practise
- 10What are generics in TypeScript?
Lesson, 4 min read
- 11What are utility types like Partial, Pick, Omit and Record?
Lesson, 4 min read
- 12What does as const do in TypeScript?
Lesson, 5 min read, then 3 questions to practise
- 13What is type narrowing in TypeScript?
Lesson, 4 min read
Chapter 3, advanced
Senior level
Trade-offs, edge cases and the questions senior rounds end on.
- 14What are mapped and conditional types in TypeScript?
Lesson, 7 min read, then 7 questions to practise
- Implement Partial, Required and Readonly as mapped types
- Implement Exclude, Extract and NonNullable with distributive conditional types
- Implement ReturnType and Parameters with infer
- Remap keys: prefix every key, build getters, and pick keys by value type
- Implement IsNever, IsAny and IsUnknown without being fooled by distribution
- Implement DeepReadonly and DeepPartial for nested objects, arrays and functions
- Implement Mutable and pick the optional and required keys of a type
- 15What are template literal types in TypeScript?
Lesson, 5 min read, then 4 questions to practise