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 do the caret (^) and tilde (~) mean in package.json versions?

    Caret allows updates that do not change the leftmost non-zero version number, so ^1.4.2 accepts 1.x.x at or above 1.4.2. Tilde allows only patch updates, so ~1.4.2 accepts 1.4.x at or above 1.4.2.

    BeginnerQuick answer1 min read
  2. What is semantic versioning and why does it matter for npm packages?

    Semantic versioning uses MAJOR.MINOR.PATCH. Increase PATCH for bug fixes, MINOR for backward-compatible features, MAJOR for breaking changes, so users can judge upgrade risk from the number alone.

    BeginnerQuick answer1 min read