Graded Quiz :D Post published. View post Dismiss this notice. Add titleeveloping Back-End Apps with Node.js and Express (Cloud Application Development Foundations Specialization) Answers 2025
1. What best describes the network operations Node.js makes?
❌ Non-blocked operations return in sync with added time
✅ Non-blocked operations return immediately without added processing time on the server
❌ Applications block every network operation
❌ Blocked operations return immediately
Explanation:
Node.js uses non-blocking I/O, meaning operations return instantly while work continues in the background.
2. What does the immediate result of http.request() state?
✅ A request is in progress.
❌ Message will be sent successfully
❌ Callback executed successfully
❌ Response will be sent successfully
Explanation:http.request() returns a ClientRequest object, indicating the request has been initiated.
3. Which parameter is optional in an HTTP request?
❌ Resource variable
❌ Event variable
❌ Location function
✅ Callback function parameter
Explanation:
Node’s HTTP request API allows you to omit the callback. You can attach events instead.
4. What object is passed as the first parameter in a Node.js callback?
❌ Destination
❌ Location
❌ Identity
✅ Error
Explanation:
Node uses the error-first callback pattern:callback(error, result).
5. What do you pass to indicate a successful callback return?
❌ 404 status code
✅ Null object
❌ Empty string
❌ Error
Explanation:
In Node.js, success is indicated by passing null as the first argument of the callback.
6. Which function calls resultCallback to return results?
❌ step()
❌ aggregate_context()
❌ http.request()
✅ result()
Explanation:
Based on the pattern described, result() triggers resultCallback.
7. Why can inversion of control be an issue when using callbacks?
❌ Requires nested callbacks
❌ Uses promises
✅ Third-party code gains control, making errors hard to track
❌ Used for sequential behavior
Explanation:
Callback inversion means you “hand over control” to external code, risking hidden errors.
8. JSON’s relationship with Node.js
❌ Metadata file
✅ Standard representation of native JavaScript objects
❌ Common data model folder
❌ JSON_SET
Explanation:
JSON is essentially JavaScript object syntax, making it natural for Node.js APS.
9. When an error occurs, the promise is in which state?
✅ Rejected
❌ Pending
❌ Resolved
❌ Aborted
Explanation:
A failed promise enters the rejected state.
10. What method does a promise use after completion?
✅ then
❌ or
❌ if
❌ else
Explanation:promise.then() handles resolved values; .catch() handles rejected ones.
🧾 SUMMARY TABLE
| Q# | Correct Answer |
|---|---|
| 1 | Non-blocked ops return immediately |
| 2 | A request is in progress |
| 3 | Callback function parameter |
| 4 | Error |
| 5 | Null object |
| 6 | result() |
| 7 | Third-party control makes errors hard to identify |
| 8 | Standard representation of JS objects |
| 9 | Rejected |
| 10 | then |