🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Node, Express and REST: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. In Express, how do you read 7 from the route /api/courses/:id when the URL is /api/courses/7?
  2. Q2. Which status code fits "a new resource was created"?
  3. Q3. What must a middleware call to pass control to the next handler?
  4. Q4. Which URL design follows REST conventions?
  5. Q5. Why should database credentials be in environment variables?
  6. Q6. For the URL /api/courses?maxPrice=1000, how does Express read 1000?
  7. Q7. What must you add so that req.body contains the parsed JSON sent by a client?
  8. Q8. A client asks for course 999, which does not exist. Which status code should the API return?
  9. Q9. Which is a REST-style route for deleting course 7?
  10. Q10. Why should SQL queries use parameters instead of joining strings with user input?