Interview Q&A / Node.js

INTERVIEW Q&A · 68 QUESTIONS

Node.js interview questions

The event loop on the server, streams, modules and building APIs with Express.

  1. What does util.promisify do and when is it useful?

    It converts a function that takes an error-first callback as its last argument into one that returns a promise, so older callback APIs can be used with async/await.

    BeginnerQuick answer1 min read
  2. What is the difference between Promise.all and Promise.allSettled?

    Promise.all rejects as soon as any promise rejects and gives you results only if all succeed. Promise.allSettled always waits for every promise and reports each outcome as fulfilled or rejected.

    BeginnerQuick answer1 min read