OpenJS Node js Application Developer ATLAS Certification Review Guide [JSNADAT], Exams of Technology

This review guide provides concise revision material for Node.js application development within the ATLAS certification pathway. Topics include event-driven architecture, API integration, testing strategies, and performance tuning, supported by exam-focused summaries.

Typology: Exams

2025/2026

Available from 03/01/2026

shilpi-jain-3
shilpi-jain-3 🇮🇳

2.5

(11)

80K documents

1 / 85

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
OpenJS Node js Application Developer ATLAS
Certification Review Guide [JSNADAT]
**Question 1. Which JavaScript keyword creates a blockscoped variable that cannot be
reassigned?**
A) var
B) let
C) const
D) static
Answer: C
Explanation: `const` declares a blockscoped constant whose binding cannot be reassigned after
initialization.
**Question 2. What does the spread operator (`...`) do when used inside an array literal?**
A) Joins two arrays into a string
B) Expands an iterable into individual elements
C) Creates a shallow copy of an object
D) Converts a string to a number
Answer: B
Explanation: Inside an array literal, `...iterable` spreads each element of the iterable into the new
array.
**Question 3. In Node.js, which flag enables the inspector for debugging?**
A) --eval
B) --check
C) --inspect
D) --trace-warnings
Answer: C
Explanation: The `--inspect` flag starts the V8 inspector, allowing debugging tools like Chrome
DevTools to connect.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55

Partial preview of the text

Download OpenJS Node js Application Developer ATLAS Certification Review Guide [JSNADAT] and more Exams Technology in PDF only on Docsity!

Certification Review Guide [JSNADAT]

Question 1. Which JavaScript keyword creates a block‑scoped variable that cannot be re‑assigned? A) var B) let C) const D) static Answer: C Explanation: const declares a block‑scoped constant whose binding cannot be reassigned after initialization. Question 2. What does the spread operator (...) do when used inside an array literal? A) Joins two arrays into a string B) Expands an iterable into individual elements C) Creates a shallow copy of an object D) Converts a string to a number Answer: B Explanation: Inside an array literal, ...iterable spreads each element of the iterable into the new array. Question 3. In Node.js, which flag enables the inspector for debugging? A) --eval B) --check C) --inspect D) --trace-warnings Answer: C Explanation: The --inspect flag starts the V8 inspector, allowing debugging tools like Chrome DevTools to connect.

Certification Review Guide [JSNADAT]

Question 4. Which property of the process object contains the command‑line arguments passed to a Node script? A) process.env B) process.argv C) process.cwd D) process.execPath Answer: B Explanation: process.argv is an array where the first two elements are the node executable and script path, followed by the user‑provided arguments. Question 5. How can you retrieve the number of logical CPU cores from the os module? A) os.totalmem() B) os.cpus().length C) os.platform() D) os.uptime() Answer: B Explanation: os.cpus() returns an array of CPU core info; its length property gives the number of logical cores. Question 6. Which Buffer method creates a Buffer of a specified size filled with zeros? A) Buffer.allocUnsafe(size) B) Buffer.from(string) C) Buffer.alloc(size) D) Buffer.concat(list) Answer: C Explanation: Buffer.alloc(size) allocates a zero‑filled Buffer of the given size, ensuring no old memory leaks. Question 7. Which stream type can be both read from and written to?

Certification Review Guide [JSNADAT]

B) Blocks the current thread until the promise resolves C) Suspends execution of the async function until the promise settles D) Converts a callback‑based API to a promise Answer: C Explanation: await pauses the async function’s execution (not the event loop) until the awaited promise resolves or rejects. Question 11. Which phase of the Node.js event loop handles callbacks scheduled by setImmediate()? A) Timers B) I/O callbacks C) Check D) Close callbacks Answer: C Explanation: The check phase processes callbacks queued by setImmediate() after I/O callbacks. Question 12. When using process.nextTick(), when will the callback be executed? A) After the current poll phase completes B) Immediately after the current operation, before any I/O events C) In the timers phase D) In the close callbacks phase Answer: B Explanation: process.nextTick callbacks run after the current stack clears, before the event loop proceeds to the next phase. Question 13. Which method of EventEmitter adds a listener that is invoked at most once? A) on() B) addListener()

Certification Review Guide [JSNADAT]

C) once() D) prependListener() Answer: C Explanation: once() registers a listener that automatically removes itself after the first invocation. Question 14. If an EventEmitter emits an 'error' event without a listener, what happens? A) The event is ignored silently B) Node logs a warning and continues C) The process throws and exits with an uncaught exception D) The 'error' event is queued for later processing Answer: C Explanation: Emitting 'error' without a handler triggers an uncaught exception, causing the process to terminate. Question 15. Which fs method reads a file asynchronously and returns a Buffer? A) fs.readFileSync(path) B) fs.readFile(path, callback) C) fs.open(path, flags, callback) D) fs.createReadStream(path) Answer: B Explanation: fs.readFile reads the entire file contents asynchronously and provides a Buffer (or string) to the callback. Question 16. Which fs method creates a directory recursively, creating parent directories as needed? A) fs.mkdir(path) B) fs.mkdirSync(path) C) fs.mkdir(path, { recursive: true }, callback)

Certification Review Guide [JSNADAT]

D) stdio: ['pipe', 'inherit', 'pipe'] Answer: B Explanation: Setting the second element of the stdio array to 'pipe' creates a readable stream for the child’s stdout. Question 20. In a CommonJS module, what does module.exports = function(){} accomplish? A) Exports a named function called exports B) Sets the default export to the provided function C) Adds the function to the global namespace D) Creates a circular dependency Answer: B Explanation: Assigning directly to module.exports defines what the module returns when required; here it returns the function. Question 21. Which field in package.json specifies the command that runs when npm start is executed? A) main B) scripts.start C) bin D) start Answer: B Explanation: The scripts object can define a start script; npm start runs npm run start, which executes the command in scripts.start. Question 22. What does the caret (^) symbol mean in a dependency version range like "express": "^4.17.1"? A) Accept only the exact version 4.17. B) Accept any version >=4.17.1 but <5.0. C) Accept any version >4.17.

Certification Review Guide [JSNADAT]

D) Accept any version >=4.0. Answer: B Explanation: The caret allows updates that do not modify the left‑most non‑zero digit, i.e., any compatible version within the same major release. Question 23. Which of the following is a correct way to create a custom error class in Node.js? A) class MyError extends Error { constructor(msg){ super(msg); this.name='MyError'; } } B) function MyError(msg){ this.message = msg; } C) const MyError = new Error('MyError'); D) class MyError { constructor(msg){ this.msg = msg; } } Answer: A Explanation: Extending Error and calling super(msg) ensures proper stack trace and name property. Question 24. What is the purpose of the --check flag when running Node? A) Execute the script in strict mode B) Validate syntax without executing the code C) Run the debugger automatically D) Enable experimental modules Answer: B Explanation: node --check script.js parses the file for syntax errors but does not run the program. Question 25. Which of the following statements about process.env is true? A) It is a read‑only object B) It contains only numeric environment variables C) Modifying it changes the environment of the parent process D) It reflects the current process’s environment variables as strings

Certification Review Guide [JSNADAT]

Explanation: util.promisify accepts a function following the error‑first callback pattern and returns a version that returns a Promise. Question 29. Which method of the fs module writes data to a file atomically (i.e., without race conditions) on most platforms? A) fs.writeFileSync() B) fs.appendFile() C) fs.writeFile() D) fs.promises.writeFile() Answer: D Explanation: While all write methods can be used, the Promise‑based fs.promises.writeFile is often paired with proper error handling and avoids callback hell; however, true atomic writes require external libraries. (Given the options, fs.promises.writeFile is the most modern and safe choice.) Question 30. Which of the following correctly creates a readable stream from a file? A) fs.createReadStream('data.txt') B) fs.readFile('data.txt') C) new Readable('data.txt') D) stream.read('data.txt') Answer: A Explanation: fs.createReadStream returns a Readable stream that reads data from the specified file. Question 31. In the context of Node’s event loop, what does the “poll” phase do? A) Executes timer callbacks B) Processes I/O callbacks ready to be executed C) Calls setImmediate callbacks D) Runs process.nextTick queue Answer: B

Certification Review Guide [JSNADAT]

Explanation: The poll phase retrieves new I/O events and executes I/O callbacks that are ready. Question 32. Which method on a Promise is used to handle both fulfillment and rejection in a single call? A) then() B) catch() C) finally() D) all() Answer: C Explanation: finally() runs after the promise settles, regardless of whether it was fulfilled or rejected. Question 33. What does the --experimental-modules flag enable? A) Support for ES6 modules (import/export) without the .mjs extension B) Automatic transpilation of TypeScript files C) Enabling the V8 inspector D) Running code in a sandboxed VM Answer: A Explanation: The flag activates experimental support for ECMAScript modules, allowing import/export syntax. Question 34. Which of the following is a valid way to listen for an 'exit' event on the process object? A) process.on('exit', () => { … }) B) process.once('exit', () => { … }) C) Both A and B D) Neither A nor B Answer: C

Certification Review Guide [JSNADAT]

Question 38. Which of the following correctly spawns a child process to execute the ls - l command? A) spawn('ls - l') B) spawn('ls', ['-l']) C) exec('ls - l') D) fork('ls', ['-l']) Answer: B Explanation: spawn takes the command as the first argument and an array of arguments as the second; spawn('ls', ['-l']) runs ls - l. Question 39. When using exec(), how is the child’s output accessed? A) Through the stdout stream property of the returned ChildProcess object B) Via the callback’s stdout argument C) By reading a temporary file created by exec D) Using process.send() Answer: B Explanation: exec’s callback receives (error, stdout, stderr), which contain the command’s output. Question 40. Which of the following is the correct way to send a message from a parent process to a forked child? A) child.send('hello') B) process.send('hello') C) child.write('hello') D) process.emit('message', 'hello') Answer: A Explanation: The parent uses the ChildProcess object’s send method to transmit data over the IPC channel.

Certification Review Guide [JSNADAT]

Question 41. Which npm command installs a package as a development dependency? A) npm install package --save B) npm install package --save-dev C) npm install package --global D) npm install package --peer Answer: B Explanation: --save-dev (or -D) records the package under devDependencies in package.json. Question 42. In a package.json file, what does the "engines" field specify? A) The Node.js version required to run the package B) The JavaScript engine (V8, Chakra) to use C) The build tools needed for compilation D) The operating systems supported Answer: A Explanation: The engines field can define required Node (and npm) versions, e.g., "node": "&gt;=14". Question 43. Which of the following correctly imports a CommonJS module using ES6 import syntax (assuming Node supports it)? A) import * as utils from './utils.js' B) import utils from './utils' C) import { default as utils } from './utils' D) import utils = require('./utils') Answer: B Explanation: When using ES modules with Node, import utils from './utils' imports the default export, which corresponds to module.exports in a CommonJS file. Question 44. Which of the following statements about semantic versioning (MAJOR.MINOR.PATCH) is true?

Certification Review Guide [JSNADAT]

B) assert.strictEqual() C) assert.deepStrictEqual() D) assert.notDeepEqual() Answer: C Explanation: assert.deepStrictEqual performs a deep equality check using strict (===) comparison for primitive values. Question 48. In Mocha, which hook runs once before all tests in a suite? A) beforeEach() B) afterEach() C) before() D) after() Answer: C Explanation: before() runs a single time before any test in the containing describe block. Question 49. Which of the following Node APIs can be used to detect a memory leak caused by growing object references? A) process.memoryUsage() B) console.time() C) fs.statSync() D) os.uptime() Answer: A Explanation: process.memoryUsage() returns heap statistics that can reveal abnormal growth indicative of leaks. Question 50. Which of these is a correct way to start the Node debugger on a script named app.js? A) node --inspect app.js B) node debug app.js

Certification Review Guide [JSNADAT]

C) node --debug-brk app.js D) node --inspect-brk app.js Answer: D Explanation: --inspect-brk starts the inspector and pauses execution on the first line, allowing a debugger to attach. Question 51. Which of the following statements about the global object is FALSE? A) Variables declared without var, let, or const become properties of global in non‑strict mode B) global is the same as window in browsers C) Modifying global affects all modules in the same process D) global can be deleted using delete global Answer: D Explanation: The global identifier itself cannot be deleted; attempting delete global has no effect. Question 52. Which of the following is the correct way to create a read‑only property on an object? A) Object.defineProperty(obj, 'prop', { value: 42, writable: false }) B) obj.prop = 42; Object.freeze(obj) C) const obj = { prop: 42 } D) obj.prop = Object.seal(42) Answer: A Explanation: Object.defineProperty with writable: false creates a non‑writable (read‑only) property. Question 53. Which of the following is NOT a valid way to handle a rejected promise? A) promise.catch(err => { … }) B) promise.then(null, err => { … }) C) try { await promise } catch (err) { … }

Certification Review Guide [JSNADAT]

Answer: A Explanation: setHeader adds or updates a header field in the outgoing response. Question 57. Which of the following statements about the url module’s URL class is true? A) It parses query strings automatically into an object B) It works only with absolute URLs that include a protocol C) It can be used to modify the pathname and then serialize back to a string D) It is deprecated in favor of the querystring module Answer: C Explanation: The URL class allows reading and mutating components (e.g., pathname) and then converting back via url.toString(). Question 58. Which of the following is the correct syntax to import only the parse function from the querystring core module using CommonJS? A) const { parse } = require('querystring'); B) const parse = require('querystring').parse; C) import parse from 'querystring'; D) const parse = require('querystring').default; Answer: B Explanation: In CommonJS, you retrieve a named export by accessing the property on the required module object. Question 59. Which of the following is the default behavior when an unhandled promise rejection occurs in Node.js (as of Node 16+)? A) The process silently ignores it B) The process emits an 'unhandledRejection' event and continues C) The process throws an uncaught exception and exits with a non‑zero code D) The process logs a warning and terminates after a short delay Answer: C

Certification Review Guide [JSNADAT]

Explanation: Starting with Node 15, unhandled rejections cause the process to exit with a non‑zero code unless a handler is attached. Question 60. Which method of the EventEmitter class removes a specific listener for an event? A) off(event, listener) B) removeListener(event, listener) C) deleteListener(event, listener) D) Both A and B Answer: D Explanation: Both off (alias) and removeListener remove a particular listener for the given event. Question 61. Which of the following is a correct way to create a reusable logger that prefixes each message with a timestamp using EventEmitter? A) class Logger extends EventEmitter { log(msg){ this.emit('log', [${Date.now()}] ${msg}); } } B) const logger = new EventEmitter(); logger.on('log', msg => console.log(msg)); logger.log('test'); C) const logger = new EventEmitter(); logger.emit('log', 'test'); D) class Logger { log(msg){ console.log([${Date.now()}] ${msg}); } } Answer: A Explanation: Extending EventEmitter and emitting a 'log' event with a formatted message allows listeners to handle the prefixed output. Question 62. Which of the following statements about process.nextTick vs. setImmediate is correct? A) nextTick callbacks run after I/O callbacks, setImmediate runs before them B) nextTick callbacks run before the event loop continues to the next phase, setImmediate runs in the check phase C) Both run in the same phase, but nextTick has lower priority D) setImmediate can only be used inside a worker thread Answer: B