Part I — TypeScript
TypeScript separates a senior candidate from a mid-level one faster than any other topic. The mid-level answer is "I add types". The senior answer is "I add the type that makes the wrong state unrepresentable, and I let inference do the rest." This section covers the type system as a design tool: what to model, what to derive, and where the cleverness stops paying for itself.
Chapters 01–03 are the everyday type system: annotate, model, reuse. Chapters 04–05 cover narrowing and derived types, which is where types start catching real bugs. Applying all of it to React (props, hooks, context, generic components) is React and TypeScript at Scale. That chapter sits with the rest of the React chapters in Part III.
Chapters
| # | Chapter | What it answers |
|---|---|---|
| 01 | TypeScript Basic Types, Literals and Enums | What do any, unknown and never cost, and why not enum? |
| 02 | Interfaces and Type Aliases | On what two grounds do they actually differ? |
| 03 | TypeScript Generics | How do you keep the caller's exact type all the way through? |
| 04 | TypeScript Type Guards | How do you get a compile error when you forget a case? |
| 05 | TypeScript Advanced and Utility Types | How do you derive a type instead of maintaining two, and when does it stop paying? |
| 06 | TypeScript at Scale | How do you get an old codebase onto strict, and when do types cost too much? |
What Interviewers Probe For
The part-level signal with a compile-time twist. What that looks like in practice:
- Do you know where types stop? TypeScript erases at runtime. A candidate who validates an API response with an
ascast and calls it type-safe has answered the question badly. The follow-up is always "what happens when the server sends something else?" - Can you narrow properly? Discriminated unions plus an exhaustive
switchwith aneverdefault is the pattern interviewers are listening for. It converts a future bug into a build failure. - Do you reach for generics for the right reason? A generic that appears once in the signature is usually an
anywith extra steps. A generic that links an argument to a return type is doing work. - Do you know when to stop? Conditional and mapped types can express almost anything. But a type nobody on the team can read is a liability. Naming the cost is the senior part of the answer.
Reading Order
Read straight through, but skim 02 if you already write TypeScript daily. Slow down on Chapter 04, because narrowing is what makes the rest useful.
Interview sprint: 03 → 04 → 05, then the React chapter in Part III. Together, generics, narrowing, derived types and typing a component cover almost every TypeScript question in a frontend-heavy interview loop.