Interview Q&A · questions with model answers
Authentication Interview Questions
Part of the study plan for: Backend Engineer · Full Stack Engineer
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Why do cookie-based sessions need CSRF protection, and how do you implement it?
Browsers automatically attach cookies to requests, so a malicious site can trigger state-changing requests to your app with the user's session. Defend with SameSite cookies plus anti-CSRF tokens…