Loading

Quipoin Menu

Learn • Practice • Grow

node-js / Building REST API with Pure Node.js
mcq
Direction: Choose the correct option

Q1.

What does REST API stand for?
A. Request-Response State
B. Rapid Execution Service
C. Representational State Transfer
D. Remote Server Transfer
Direction: Choose the correct option

Q2.

In a REST API, what HTTP method is typically used to retrieve a resource?
A. GET
B. POST
C. PUT
D. DELETE
Direction: Choose the correct option

Q3.

How would you parse the request body for a POST request in raw Node.js?
A. Use `req.query`
B. Using `JSON.parse(req)`
C. By listening to 'data' events and concatenating chunks
D. `req.body` is automatically available
Direction: Choose the correct option

Q4.

What status code indicates a successful resource creation?
A. 202
B. 200
C. 204
D. 201
Direction: Choose the correct option

Q5.

When building a REST API, how do you typically send an error response?
A. Ignore errors
B. Send 200 with error message
C. Set appropriate status code (e.g., 400, 404) and error message
D. Just crash