Node.js Course
Node.js
/
Intermediate

Debugging Questions

Definition

Questions designed to test a developer's ability to track down and fix bugs, memory leaks, or crashes in a Node.js environment.

Explain Like I'm New

How do you find the needle in the haystack when your app crashes in production with no error message?

Real World Example

Knowing how to use the `--inspect` flag, understanding stack traces, and knowing the difference between `process.on('uncaughtException')` and `unhandledRejection`.

Common Use Cases

  • •Troubleshooting production outages

Interactive Example

Loading...
Console output will appear here...

Interview Questions

basic

  • What is an `UnhandledPromiseRejection`?

intermediate

  • How do you catch synchronous crashes globally so the app doesn't die immediately?

Flash Cards

Question

UnhandledPromiseRejection?

Click to reveal answer
Answer

It happens when an asynchronous Promise fails (rejects), but you forgot to attach a `.catch()` block or use a `try/catch` with async/await. In modern Node, this will completely crash your server.

Question

Catch crashes globally?

Click to reveal answer
Answer

By listening to the `process.on('uncaughtException')` event. Note: It is best practice to log the error and STILL gracefully shut down the app, because the app is now in an unpredictable state.