DevAcademy
PracticeNode.jsIntermediate

Node.js Intermediate Practice

30 questions covering 10 Node.js topics.

Quick Quiz

1. What does emitter.once() do differently from emitter.on()?

2. Do EventEmitter listeners run synchronously or asynchronously when emit() is called?

3. What happens if an EventEmitter emits an "error" event with no listener attached?

4. What advantage do streams have over reading an entire file into memory at once?

5. What does .pipe() do?

6. What is backpressure in the context of streams?

7. What does a Buffer represent?

8. Does Buffer.length measure bytes or characters?

9. What type of data do readable streams emit by default?

10. What is process.nextTick() relative to resolved Promise callbacks?

11. In the ordering example, why does synchronous code ("1" and "5") run before everything else?

12. What can happen if process.nextTick() is called recursively without bound?

13. What does setTimeout(fn, 0) actually guarantee?

14. What is a common cause of memory leaks involving timers?

15. How can setTimeout be used to build an awaitable delay?

16. Do you need to import process in Node.js scripts?

17. What does process.argv contain?

18. Why listen for the SIGTERM signal in a server?

19. Are frameworks like Express built on top of the core http module?

20. What does the raw http module lack that frameworks typically add?

21. What method sends the response headers and status code?

22. How does a raw http server determine which route to serve?

23. How does a raw http server body arrive?

24. What HTTP status code conventionally indicates a resource was successfully created?

25. What is Express built on top of?

26. What does res.json({ users: [] }) do?

27. What does "unopinionated" mean about Express?

28. How do you access a value from a dynamic route parameter like /users/:id?

29. What does express.Router() provide?

30. Which method registers a handler for HTTP DELETE requests?