Roadmaps / TypeScript / Interview topics
Reference
Interview topics
Use these for TypeScript, frontend and full-stack roles. Each follow-up is the question a good interviewer asks next. The Staff line is what lifts the answer.
Phase 1
| Question | Follow-up | A Staff answer adds |
|---|---|---|
type or interface? | What does declaration merging allow? | One rule per codebase, written down, with the cases where it is broken |
What do unknown, any and never mean? | Where would you use each? | A policy for counting any and a lint rule that enforces it |
| How do discriminated unions make a switch exhaustive? | What happens when you add a member? | Using the compile error as a migration tool across many call sites |
| Why are mutable arrays unsound in TypeScript? | How does readonly help? | Method bivariance, strictFunctionTypes and where the compiler still lets you down |
| What is a branded type, and what does it cost? | When would you not use one? | Brands only at real boundaries, because each one adds conversion code |
System design prompt (20 minutes): model a payment flow so invalid states cannot compile. Outline: states and events (4 min), the union and transitions (5), what stays at runtime (4), tests that prove it (4), how it changes over time (3).
Phase 2
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| Types are erased. How do you validate input? | Where do you place the validation? | One schema as the source of truth, parsed at every boundary |
Exceptions or Result values? | How do you type an API's errors? | An error contract in the type, and exceptions kept for bugs |
When is as acceptable? | How does satisfies differ? | A lint rule, a counted budget and a reviewed list of exceptions |
What breaks when you send a Date through JSON? | How do you fix it at scale? | Codecs at the boundary and a test of every awkward value |
| How do you evolve an API without breaking clients? | What is safe to add? | A compatibility check in CI, and a deprecation window with dates |
System design prompt (20 minutes): share types between one server and three clients. Outline: contract format and owner (4 min), how clients get updates (5), validation and errors (4), versioning and compatibility checks (4), rollout (3).
Phase 3
| Question | Follow-up | A Staff answer adds |
|---|---|---|
nodenext or bundler resolution? | How do you publish for ES modules and CommonJS? | Checking the published package with attw before release |
| Project references or path aliases? | What does each do to editor speed? | Boundaries enforced by the build, not by convention |
| How do you plan the move from TypeScript 6 to 7? | Which tools might block you? | A side-by-side install, a tool compatibility table and a rollback |
| A type check takes six minutes. What do you do? | How do you find the slow type? | Measure with a trace, set a budget, and decide what to give up |
| Type stripping, transpiling or compiling: when each? | What syntax does stripping not support? | Where type checking runs in CI so nothing ships unchecked |
System design prompt (20 minutes): cut a six-minute type check for a monorepo. Outline: baseline and budget (3 min), measurement with traces (5), structural fixes (5), compiler upgrade (4), keeping it fast (3).
Phase 4
| Question | Follow-up | A Staff answer adds |
|---|---|---|
How do you roll out strict to a large codebase? | What do you do about teams that resist? | A ratchet, a published weekly count and a path that keeps features moving |
| How do you design the types of a public library? | What counts as a breaking change? | An API report in CI and a stated policy for compiler upgrades |
| What do you look for in a type-heavy pull request? | When is a type too clever? | A rule: a type that needs a comment to understand costs more than it saves |
| How would you migrate 500 call sites safely? | Why must a codemod be safe to run twice? | Small reviewed batches and a measured result |
| How do you govern types across many repositories? | How do you handle exceptions? | Shared config and lint packages, an any budget and named owners |
System design prompt (20 minutes): a type-safety strategy for 300 repositories. Outline: current state and measures (4 min), shared config and rules (5), rollout order (4), exceptions and ownership (4), measuring the outcome (3).