What are Promises in Node.js?
Why Interviewers Ask This
This question tests conceptual clarity. Interviewers want to hear a precise, confident definition before moving to more complex Node.js topics. It also reveals how well you can explain technical ideas to non-experts.
Answer
A Promise is an object representing the eventual completion or failure of an asynchronous operation. A Promise is in one of three states: pending (initial state, not yet settled), fulfilled (operation completed successfully, has a value), or rejected (operation failed, has a reason/error). Promises are created with new Promise((resolve, reject) => { ... }). Chain them with .then(onFulfilled, onRejected) and .catch(onRejected). Key static methods: Promise.all([p1, p2]) — waits for all promises (fails fast on any rejection); Promise.allSettled([...]) — waits for all, regardless of rejection; Promise.race([...]) — resolves/rejects as soon as any promise settles; Promise.any([...]) — resolves when any fulfills. Promises solve callback hell by enabling flat .then() chains instead of nested callbacks.
Pro Tip
Back up your answer with a specific project or situation. Saying 'In my last Node.js project, I used this when...' immediately makes your answer more credible and memorable.