InterviewBuddy
All interview questions

Does awaiting I/O block the Node.js event loop?

Intermediate

Answer

Awaiting a pending I/O promise suspends that async function, allowing other work to run. CPU-heavy JavaScript before or after the await still blocks its thread.

Explanation

Promises do not automatically move computation to another thread.

Example

await readFile(path) yields; a long synchronous loop does not.