JavaScript interview question

What is the difference between promises and async/await?

Short answer

They are the same mechanism with different syntax. A promise represents a value that will be available later and is consumed with then and catch. async/await is syntax built on promises: an async function always returns a promise, and await pauses that function until a promise settles, letting asynchronous code read like synchronous code with try/catch error handling.

Side by side

javascript// Promise chain
fetchUser(id)
  .then((user) => fetchOrders(user.id))
  .then(render)
  .catch(showError);

// async/await
async function load(id) {
  try {
    const user = await fetchUser(id);
    render(await fetchOrders(user.id));
  } catch (err) {
    showError(err);
  }
}

Running work in parallel

Awaiting inside a loop runs tasks one after another. When tasks are independent, start them together and await Promise.all, or Promise.allSettled if you need every result regardless of failures.

How to answer it in an interview

  • Point out that await only pauses the async function, not the whole thread.
  • Mention unhandled rejections and how to handle them.
  • Compare Promise.all, allSettled, race and any in a sentence each.

Walk into your next interview prepared

Start free, install the Windows app and run a practice session today.