linkedin-skill-assessments-quizzes

Node.js

Q1. When a javaScript function is invoked (called) in Node, where is a new frame placed?

Q2. Which of the following is a core module in Node?

Q3. Which of the following Buffer class methods returns an uninitialized buffer?

Q4. Which of the following modules is NOT a built-in module in Node?

Q5. Which fs module method can be used to read the content of a file without buffering it in memory?

Explanation:

From official docs: https://nodejs.org/api/fs.html#fs_dir_read To minimize memory costs, when possible prefer streaming via fs.createReadStream().

Q6. Which of the following DNS module methods uses the underlying OS facilities and does not necessarily perform any network communication?

Q7. How do you check that a value is a date object in Node?

Q8. Can you create an https web server with Node.js?

Q9. What is the Api that is designed to insulate Addons from changes in the underlying JavaScript engine?

Q10. Which CLI option can you use to debug a node script in Chrome DevTools?

Q11. How can you count the number of logical CPUs on the machine that is running Node?

Q12. Which of the following is a method on the console object?

Q13. Which object is used to manage the cache of required modules?

Q14. What is the command to silence all process warnings?

Q15. How can you use the promise API with a callback-based function like child_process.exec?

Q16. Which of the following is NOT a Node repl command?

Q17. Which statement is true when you run the code shown below?

require('child_process').fork('script.js');

Q18. If EventEmitter is in scope, which of the following lines of code will have an event emitter emitting a change event?

Explanation:

Because the EventEmitter is already in scope. No need to create new one.

Q19. Which of the following objects is a stream

Explanation:

process.stdout is Buffer type.

Q20. Which module variable holds the resolved aboslute path of the current module file?

21. If the child_process module methods are in scope, what is a current way to execute the command ps -ef using a child process?

Q22.Which console method can be used to print the stack trace to the point of its execution?

Q23.When you run JavaScript in a Node.js application, which of the following elements in a Node.js stack actually executes that JavaScript?

Q24. Looking at the code below, what does the console show?

const http = require('http');
 const hostname = '127.0.0.1'; const port = 3000;
 const server = http.createServer((req, res) => {
  res.statusCode = 200;  res.setHeader("Content-Type", "text/plain");  res.end("Hello World\n");
});
server.listen(port, hostname, () => { console.log(`server running at http://${hostname}:${port}/`); });

Q25.What is the purpose of the path module?

Q26.How do you make an HTTP server object active and listen to requests on certain ports?

Q27.What does the code shown below do?

const fs = require('fs'); const os = require('os');
const system = os.platform(); const user = os.userInfo().username;
fs.appendFile('hello.txt', `Hello ${user} on ${system}`, (err) => { if (err) throw err; console.log('The data was appended to file!');}
);

Q28.How do you start a Node application, if the entry file is indexjs?

Q29.What is the purpose of the file system (fs) module?

Q30.What is the Node LTS version?

Q31. Which of the following is NOT a valid stream in Node?

Q32. You have a script.js file with the single line of code shown here. What will be the output of executing script.js with the node command?

console.log(arguments);

Q33. Which choice is not a valid method on event emitters?

Q34. Which special object is an instance of EventEmitter?Which special object is an instance of null?

Q35. What is the command to get a list of available commands for Node.js?What is the command to get a list of available commands for Node.js?

Q36. When a request event is received in the HTTP module, what is the type of the first argument passed to that event, usually named req?

Q37. What are the arguments passed to the module wrapper function?

Q38. Which library provides Node.js with the event loop?

Q39. What does the .node file extension represent?

Q40. What can you export with module.exports?

Q41. Which core module in Node can you use to take advantage of multicore systems?

Q42. Which core Node module has wrappers for OpenSSL methods?

Q43. Which line imports a promise-based version of the readFile method?

Q44. According to the rules of semantic versioning, what does a release incrementing the third number in an npm version string communicate to users about the release changes?

Q45. What does REPL stand for?

Q46. Which file does node-gyp use to read the build configuration of module ?

Q47. Which core module in Node can you use for testing?