Node.js Cheat Sheet 2026
The 30 highest-yield Node.js facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
65 questions
120 min time limit
68.00% to pass
- _________ is a Node.js debugging tool with a graphical user interface. → Node Inspector
- What event does a Readable stream emit after all data has been consumed and the stream has closed? → 'end'
- In the REPL session, the Underscore Variable is used → to get the last result.
- What is the default string encoding used when creating a Buffer from a string in Node.js? → utf8
- What is semantic versioning (semver) in npm? → A versioning scheme using MAJOR.MINOR.PATCH where each number indicates the type of change
- To read a file, the ______ fs module's method is utilized. → fs.read(fd, buffer, offset, length, position, callback)
- How should Node.js professionals prioritize identified risks? → Based on likelihood of occurrence combined with severity of potential impact
- What method connects a Readable stream to a Writable stream so data flows automatically? → readable.pipe(writable)
- What role does active listening play in Node.js practice? → It ensures accurate understanding, demonstrates respect, and improves outcomes
- What HTTP method should be used to update an existing resource in a REST API? → PUT or PATCH
- Which Node.js stream type is used exclusively for reading data? → Readable
- How do you determine the byte length of a string for a given encoding without allocating a full Buffer? → Buffer.byteLength(string, encoding)
- How do you convert a Node.js Buffer to a UTF-8 encoded string? → buffer.toString('utf8')
- Why is stream.pipeline() preferred over readable.pipe() for production code? → It handles errors and automatically destroys all streams in the pipeline
- Which stream base class should you extend to implement a custom stream that both reads input and produces transformed output? → stream.Transform
- What is the file extension for NodeJs files? → .js
- Node.js streams kinds are. → All of the above
- What is the first step in risk assessment for Node.js professionals? → Identifying potential hazards and vulnerabilities in the specific context
- What does 'require()' do in Node.js? → Imports and caches a module, returning its exports
- Which of the following statements regarding Chaining Streams is correct? → Both of the above
- What exactly is the REPL? → REPL stands for "Read Eval Print Loop."
- What is the purpose of regular risk reviews in Node.js practice? → To identify new risks, evaluate control effectiveness, and update mitigation strategies
- How does a Node.js professional communicate risks to stakeholders? → By presenting risks clearly with context, potential impacts, and recommended actions
- Which of the following statements regarding the EventEmitter.on property is correct? → on property is used to bind a function with the event
- Which of the following lines of code prints the amount of memory used? → console.log('Current version: ' + process.memory());
- What is the importance of data security in Node.js digital applications? → Protecting sensitive information from unauthorized access, breaches, and loss is essential
- What is the purpose of 'try...catch' with async/await? → To catch errors thrown by awaited Promises in a synchronous-looking style
- How should unhandled Promise rejections be handled in a production Node.js application? → By adding a global 'unhandledRejection' event handler and logging the error
- What is a risk mitigation strategy in Node.js practice? → Implementing controls that reduce the likelihood or impact of identified risks
- In Node.js, the ______ core module is used to create a web server. → http
Turn these facts into recall: