04 · Core
TypeScript
Types that scale — generics, narrowing, and the tricky inference questions.
Type-level thinking. Senior+ interviews increasingly ask you to design APIs with types and reason about generics.
Basics
| Topic | Difficulty | Time | Tags | Best Resources |
|---|---|---|---|---|
| Type basics & inference | 🟢 | 45m | #basics |
TS Handbook: everyday types ⭐ |
| Interfaces vs type aliases | 🟢 | 30m | #basics |
TS Handbook ⭐ |
| Union & intersection types | 🟢 | 30m | #basics |
TS Handbook: unions ⭐ |
| Literal & enum types | 🟢 | 30m | #basics |
TS Handbook: enums ⭐ |
| Functions & overloads | 🟡 | 45m | #basics |
TS Handbook: functions ⭐ |
| Narrowing & type guards | 🟡 | 45m | #guards |
TS Handbook: narrowing ⭐ |
| Discriminated unions | 🟡 | 45m | #patterns #state |
TS Handbook ⭐ |
unknown vs any vs never |
🟡 | 30m | #basics |
TS Handbook ⭐ |
Advanced types
| Topic | Difficulty | Time | Tags | Best Resources |
|---|---|---|---|---|
| Generics | 🟡 | 1h | #generics |
TS Handbook: generics ⭐ |
| Generic constraints & defaults | 🟡 | 45m | #generics |
TS Handbook ⭐ |
| Utility types (Partial/Pick/Omit/Record…) | 🟡 | 45m | #utility-types |
TS Handbook: utility types ⭐ |
keyof & typeof |
🟡 | 30m | #type-ops |
TS Handbook: keyof ⭐ |
| Indexed access types | 🟡 | 30m | #type-ops |
TS Handbook ⭐ |
| Mapped types | 🔴 | 1h | #type-ops |
TS Handbook: mapped types ⭐ |
Conditional types & infer |
🔴 | 1.5h | #type-ops #advanced |
TS Handbook: conditional types ⭐ |
| Template literal types | 🔴 | 1h | #type-ops #advanced |
TS Handbook ⭐ |
| Variance & assignability | 🔴 | 1h | #advanced |
TS Handbook ⭐ |
| Type-level programming | 🔴 | 2h | #advanced |
Type Challenges ⭐ |
Tooling & practice
| Topic | Difficulty | Time | Tags | Best Resources |
|---|---|---|---|---|
Declaration files (.d.ts) |
🟡 | 45m | #config |
TS Handbook ⭐ |
| Decorators | 🟡 | 45m | #advanced |
TS Handbook: decorators ⭐ |
tsconfig deep dive |
🟡 | 45m | #config |
TSConfig reference ⭐ |
strict mode & flags |
🟡 | 30m | #config |
TS Handbook ⭐ |
| Project references & monorepos | 🔴 | 1h | #monorepo #config |
TS Handbook ⭐ |
| Typing React components & hooks | 🟡 | 1h | #react |
React TS cheatsheet ⭐ |
| Typing async & generics in APIs | 🟡 | 45m | #patterns |
TS Handbook ⭐ |
❓ Rapid-fire TypeScript interview questions
Real TypeScript interview questions. Answer out loud, then verify above.
interfacevstype— when to use each?unknownvsanyvsnever— what's the difference?- What are generics and why use them?
- Explain union vs intersection types.
- What are type guards and narrowing?
- What are discriminated unions?
- Name the common utility types (
Partial,Pick,Omit,Record…). - What do
keyofandtypeofdo at the type level? - What are mapped types?
- What are conditional types and
infer? - What are template literal types?
- What is a declaration file (
.d.ts)? - What does
strictmode turn on? - What is the difference between
enumand a union of literals? - How do you type a React component and its props/hooks?
- What is structural typing (duck typing)?
- What is type assertion and when is it dangerous?
- How do generic constraints (
extends) work? - What's the difference between
readonlyandconst? - How does type inference work and when does it fail?
Related: 03-javascript · 06-react · 08-architecture
Missing something? Add a row.