Backend Developer Interview Question

How should passwords be stored, and what would you flag in a review if you saw an existing implementation?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Hash with a slow, memory hard function: Argon2id is the current recommendation, with bcrypt and scrypt acceptable. Each password gets a unique salt, which these algorithms generate and store in the output, and parameters should be tuned so hashing takes a meaningful fraction of a second on your hardware. Never use a plain fast hash such as SHA-256 or MD5, never encrypt passwords reversibly, and rehash on login when you raise the parameters.

Why interviewers ask this

It is a factual security question with a clear right answer, so it filters quickly. The interviewer wants Argon2id or bcrypt, per user salts and deliberate slowness, plus awareness of the surrounding controls: rate limiting, breached password checks and a safe reset flow. Reviewing an existing implementation also shows whether you can spot the subtle problems, such as bcrypt truncating long inputs.

How to structure your answer

  • Name the algorithm and why slowness and memory hardness matter.
  • Cover salts and why a per user salt defeats precomputed tables.
  • Say how you choose parameters and how you upgrade them later.
  • List the surrounding controls beyond the hash itself.

Example answer

Spoken example, first person

Argon2id is what I reach for, with bcrypt as the fallback if the platform library is better supported. The point is that it is deliberately slow and memory hard, so an attacker with the dump cannot test billions of candidates per second on a graphics card. Each password gets its own random salt, which those algorithms embed in the encoded output, so identical passwords produce different hashes and precomputed tables are useless. I tune the parameters against real hardware, aiming for a few hundred milliseconds per hash, and I store them with the hash so I can raise them later and rehash transparently the next time a user logs in successfully. In a review, the things I flag are a bare SHA-256 or MD5, anything reversible, a single global salt, and with bcrypt specifically the fact that it silently ignores input past 72 bytes, which quietly weakens long passphrases. Beyond the hash I want rate limiting on login, a check against known breached passwords, and a reset flow with single use expiring tokens.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • What is a pepper, and where would you keep it?
  • How do you migrate an existing table of weakly hashed passwords?
  • How do you protect the login endpoint from credential stuffing?

Related backend developer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot