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 are good URL naming conventions for REST resources?

    Use plural nouns for resources, let the HTTP method express the action, nest only one level for relationships, and use lowercase with hyphens. So GET /students/5/courses, not /getStudentCourses?id=5.

    BeginnerQuick answer1 min read
  2. What is the difference between PUT and PATCH in a REST API?

    PUT replaces the whole resource with the body you send, so missing fields are cleared. PATCH changes only the fields you send. PUT is idempotent by definition; PATCH is not guaranteed to be.

    BeginnerQuick answer1 min read