Understand how types describe a program, how JavaScript executes it, and how Node connects that execution to real requests and I/O.
These four chapters form a connected explanation. The first two develop the static model: what the compiler can infer, what evidence narrows a value, and how reusable types preserve relationships. The next two develop the runtime model: when JavaScript runs, where it suspends, and how the operating system and Node bring an external result back to the right continuation.
Keeping those models separate helps answer two different questions. “Does this value satisfy the type?” is a compiler question. “Has the write finished, and what can run while it waits?” is an execution and application-contract question. A useful design needs both: a precise type cannot validate unknown bytes by itself, and an async function cannot make a synchronous computation stop blocking.
Read the chapters
1. How TypeScript reasons about your code
How TypeScript Reasons About Your Code follows an incoming value from uncertainty to safe use. It connects inference and any/unknown to object compatibility, fresh-literal checks, control-flow narrowing and discriminated unions. Exhaustiveness then shows how the checker can expose missing cases when a model changes.
Read this first if you can remember individual rules but are unsure why an assignment works in one place and fails in another.
2. Designing reusable TypeScript types
Designing Reusable TypeScript Types starts from the relationships a function should preserve. Generics, constraints, keyof and indexed access express those relationships; literal types and readonly views make their limits explicit. Partial, Pick and Omit then derive useful shapes without pretending to perform runtime transformations.
This chapter builds on the first: knowing how structural compatibility works explains what a generic constraint promises and what it leaves open.
3. How asynchronous JavaScript executes
How Asynchronous JavaScript Executes develops one execution model from the call stack through promises and await to queue ordering. Worked traces explain chained and nested microtasks, timers, Node phases, nextTick, and setImmediate. Blocking and starvation become consequences of that model rather than unrelated exceptions to memorize.
Try predicting each output before opening the answer. The explanation matters more than memorizing the letters.
4. How Node handles concurrent requests
How Node Handles Concurrent Requests follows a request through the listening socket, connected socket, HTTP parser, handler, database operation and response. It explains how many outstanding operations share a JavaScript thread, how kernel readiness differs from worker-pool work, and why an acknowledgement needs a defined completion and durability contract.
Read this after the execution chapter to connect “the function is suspended” with what is actually waiting outside JavaScript.
Use the notebook
Read a whole chapter when rebuilding your understanding. Revisit its sections and revealable questions when practising. Examples with marked compiler errors are intentional comparisons; examples marked “reason only” demonstrate infinite blocking or starvation and should not be run.
The topic directory mirrors these conceptual groups: Type reasoning and Reusable types under TypeScript; Async execution and Concurrent I/O under Node.js; Connections and request lifecycle under Networking. The request chapter belongs to both Node.js and Networking because it explains their boundary.
Source and assumptions
The sole conversation source is TypeScript-Inference-Practice.pdf, reviewed across all 61 pages. Supporting explanations use official references linked in each chapter. TypeScript examples assume strict checking; Node examples identify CommonJS/ESM or version differences when ordering depends on them.
| Chapter | Source pages |
|---|---|
| Type reasoning | 1–11, 16–19 |
| Reusable types | 12–16, 19–25 |
| Async execution | 27–33, 40–61 |
| Concurrent requests and I/O | 33–54, 61 |
Repeated conversation explanations are merged. Unanswered source questions have verified answers labeled in their disclosures. Pages 25–27's future-curriculum requests are outside these chapters, and the second PDF is not included.