0
0
Node.jsframework~20 mins

Chrome DevTools for Node.js in Node.js - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Node.js Debugger Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
Understanding Chrome DevTools Debugger Behavior in Node.js
When you run a Node.js script with the --inspect-brk flag and open Chrome DevTools, what happens immediately after the script starts?
Node.js
node --inspect-brk script.js
AThe script runs fully without pausing, and DevTools attaches after completion.
BThe script pauses only if a breakpoint is manually set in DevTools after starting.
CThe script pauses on the first line before executing any code, waiting for you to resume.
DThe script throws an error because <code>--inspect-brk</code> is deprecated.
Attempts:
2 left
💡 Hint
Think about what the brk part in --inspect-brk means.
📝 Syntax
intermediate
2:00remaining
Correct Usage of the Node.js Inspector Protocol URL
Which of the following is the correct format of the WebSocket URL used by Chrome DevTools to connect to a running Node.js process with the inspector enabled?
Aws://127.0.0.1:9229/uuid
Bhttp://127.0.0.1:9229/uuid
Cwss://127.0.0.1:9229/uuid
Dftp://127.0.0.1:9229/uuid
Attempts:
2 left
💡 Hint
DevTools uses a WebSocket connection, not HTTP or FTP.
🔧 Debug
advanced
2:00remaining
Identifying the Cause of a Debugger Connection Failure
You start a Node.js process with node --inspect=localhost:9230 app.js but Chrome DevTools fails to connect. What is the most likely reason?
AThe <code>--inspect</code> flag requires the port to be above 1024, and 9230 is invalid.
BThe <code>localhost</code> hostname is not allowed; you must use <code>0.0.0.0</code>.
CThe Node.js process must be started with <code>--inspect-brk</code> to allow any connection.
DChrome DevTools only connects to port 9229 by default, so it cannot connect to 9230 without manual configuration.
Attempts:
2 left
💡 Hint
Check the default port Chrome DevTools expects for Node.js debugging.
state_output
advanced
2:00remaining
Effect of Pausing Execution in Chrome DevTools on Node.js Event Loop
If you pause a running Node.js script in Chrome DevTools, what happens to the Node.js event loop and asynchronous callbacks?
AThe event loop continues running, so asynchronous callbacks execute even while paused.
BThe event loop is paused, so no asynchronous callbacks or timers run until resumed.
COnly timers pause, but I/O callbacks continue running during the pause.
DThe event loop crashes and the Node.js process exits.
Attempts:
2 left
💡 Hint
Think about what pausing execution means for the entire JavaScript runtime.
🧠 Conceptual
expert
3:00remaining
Understanding Source Map Support in Node.js Debugging with Chrome DevTools
You are debugging a Node.js application written in TypeScript using Chrome DevTools. You notice that breakpoints in the original TypeScript files are not hit, only in the compiled JavaScript files. What is the most likely cause?
ASource maps are not properly generated or linked, so DevTools cannot map JS back to TS files.
BChrome DevTools does not support debugging TypeScript files at all.
CYou must run Node.js with <code>--inspect-brk</code> to debug TypeScript source maps.
DTypeScript files must be renamed to .js for DevTools to recognize breakpoints.
Attempts:
2 left
💡 Hint
Check if the compiled JavaScript includes source map references.