Node.js & Express Interview Preparation

Backend interviews test whether you can build APIs, handle auth, and reason about server-side concerns โ€” not just copy Express boilerplate.

What Interviewers Look For

  • REST API design
  • Middleware understanding
  • Authentication & security basics
  • Error handling and validation
  • Database integration patterns
  • How your project backend is structured

Files in This Section

FilePurpose
topics-not-to-miss.mdMust-know concepts checklist
interview-questions.md30+ questions with full answers
auth-security.mdJWT, sessions, hashing, CORS
api-design.mdREST conventions and patterns
project-style-questions.md15 scenario questions
common-mistakes.mdWhat students get wrong
revision-sheet.mdOne-page cram before interview
mock-interview.md45-minute practice flow

Study Order

  1. topics-not-to-miss.md โ€” identify gaps
  2. api-design.md + auth-security.md โ€” core backend literacy
  3. interview-questions.md โ€” 5 questions/day
  4. project-style-questions.md โ€” scenario practice
  5. mock-interview.md โ€” practice with a friend
  6. revision-sheet.md โ€” day before interview

Time Estimate

  • Minimum viable prep: 5โ€“7 days
  • Solid prep: 2 weeks (with a small API project)

Project Connection

Be ready to explain: your API routes, auth flow, database schema, error handling, and one security decision you made.

Interactive

Express Middleware Pipeline

Follow a request through logger โ†’ auth โ†’ validate โ†’ handler, short-circuit a 401, and crash into the error middleware.

app.use(logger);app.use(auth);app.post('/orders', validate, handler);app.use(errorHandler);
requestloggerauthvalidatehandlererror mwresponse
  • ๐Ÿ“ logged: POST /orders

POST /orders arrives. Middleware run IN REGISTRATION ORDER; each calls next() to pass the request on.

1 / 5

JWT: Sign, Verify, Tamper

Edit a real token signed live in your browser, then tamper the payload and watch the signature scream โ€” the whole JWT security model in one box.

header (fixed)
{"alg":"HS256","typ":"JWT"}
payload โ€” edit me
secret โ€” the server's, never the client's
..
โ€ฆ verifying

The signature covers exactly the bytes of header.payload. Change one character โ€” by hand or with Tamper โ€” and verification fails. Fix it by editing the payload pane instead: that re-signs with the secret, which an attacker doesn't have.

POST /login { user, pass }โ† 200 { token }GET /ordersAuthorization: Bearer <token>โ† 200 [ ...orders ]
clientcredentials โ†’server

The client proves identity ONCE, with credentials.

1 / 4

Study materials