Node.js · Junior · Question 3 of 75
What model does Node.js use to handle many connections at once?
- 1A new process for every incoming request
- 2A new operating-system thread for every incoming request
- ✓Correct answer: A single-threaded event loop with non-blocking I/O
Explanation
JavaScript runs on one main thread. I/O such as reading files or network calls is handed off to the system and libuv, and the callback runs later, so one process can serve thousands of connections.