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. Why should you hash passwords with bcrypt instead of SHA-256 or storing them in plain text?

    Plain text leaks everything in a breach. SHA-256 is designed to be fast, so attackers can test billions of guesses per second. bcrypt is deliberately slow, adds a unique salt, and its cost can be raised over time.

    BeginnerQuick answer1 min read
  2. How does bcrypt store the salt and what does the cost factor mean?

    The 60-character bcrypt hash contains the algorithm version, the cost, the 22-character salt and the hash itself, so you store one string. The cost is a power of two: each +1 doubles the work.

    IntermediateQuick answer1 min read