Node Js LinkedIn Skill Assessment Answer

Here, We see Node Js LinkedIn Skill Assessment Answer. This assessment test consists 15-20 MCQs to demonstrate your knowledge in your selected skills. MCQs comes from different topics – Node Js Console, Events, HTTP, Modules, Packages.

Node Js LinkedIn Skill Assessment Answer

Node Js LinkedIn Skill Assessment Answer :-

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

  1. the call stack✔️
  2. the event loop
  3. the poll phase
  4. the events queue

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

  1. webpack
  2. crypto✔️
  3. request
  4. chalk

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

  1. allocUnsafe✔️
  2. concat
  3. from
  4. alloc

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

  1. ftp✔️
  2. events
  3. dgram
  4. http2

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

  1. read
  2. readFile
  3. createReadStream✔️
  4. readFileSync

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

  1. lookup✔️
  2. resolve
  3. resolve4
  4. reverse

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

  1. util.types.isDate(value)✔️
  2. assert.isDate(value)
  3. console.isDate(value)
  4. util.date(value)

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

  1. no, there are no modules supporting it yet
  2. yes, with the https or http2 modules✔️
  3. yes, through the path module
  4. yes, with the http module

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

  1. A-API
  2. Z-API
  3. N-API✔️
  4. X-API

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

  1. –dev-tools
  2. –inspect✔️
  3. –chrome
  4. –debug

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

  1. node -p "process.cpus"
  2. node -p "util.cpus().size"
  3. node -p "process.os.cpus"
  4. node -p "os.cpus().length"✔️

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

  1. exit
  2. test
  3. time✔️
  4. print

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

  1. global.cache
  2. module.cache
  3. process.cache
  4. require.cache✔️

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

  1. node index.js –trace-warnings
  2. node –no-warnings✔️
  3. node -trace-warnings
  4. node index.js –no-warnings

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

  1. new Promise(child_process.exec())
  2. util.promisify(child_process.exec())
  3. util.promisify(child_process.exec)✔️
  4. new Promise(child_process.exec)

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

  1. .break
  2. .history✔️
  3. .editor
  4. .save

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

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

  1. The forked process shares the event loop with the parent process
  2. A new VM instance is created and the two VM instances will be shared between the forked process and the parent process.
  3. The forked process will have its own VM instance.✔️
  4. The forked process shares the same VM thread with the parent process.

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

  1. EventEmitter.emit(‘change’);✔️
  2. EventEmitter.new().emit(‘change’);
  3. (new EventEmitter()).emit(‘change’);
  4. new EventEmitter(‘change’);

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

Q19. Which of the following objects is a stream

  1. process.uptime
  2. process.stdout✔️
  3. process
  4. Buffer

Explanation: process.stdout is Buffer type.

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

  1. __pathname
  2. __location
  3. __flder
  4. __filename✔️

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

  1. spawn("ps -ef")
  2. exec("ps -ef")✔️
  3. exec("ps", "-ef")
  4. fork("ps -ef")

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

  1. stack
  2. trace✔️
  3. debug
  4. print

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

  1. the libuv library
  2. the c-ares library
  3. the VM (like VS or Chakra)✔️
  4. the repl module

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}/`); });
  1. server running at http://localhost:3000/
  2. server running at port 3000
  3. server running at http://localhost:4000/
  4. server running at http://127.0.0.1:3000/✔️

Q25.What is the purpose of the path module?

  1. to provide utilities to play with file and directory paths✔️
  2. to provide utilities to add and remove files
  3. It is a retiring module.
  4. to provide utilities to test files

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

  1. server. start
  2. server.activate
  3. server.listen✔️
  4. server. run

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!');}
);
  1. creates a text file hello.txt and appends customized text✔️
  2. creates an image file
  3. console logs system information
  4. creates a file named data and append numbers

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

  1. nodemon start
  2. start index.js
  3. node index.js✔️
  4. node start

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

  1. to provide methods to work with requests and responses
  2. to provide methods to work with files✔️
  3. to provide methods to work with databases
  4. to find new file systems

Q30.What is the Node LTS version?

  1. It is the current unstable version and is to be avoided.
  2. It is the version that will be retired soon.
  3. It is the version with the latest features.
  4. It is the safest version for long-term support.✔️

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

  1. process. stdinfo✔️
  2. process. stdin
  3. process. stdout
  4. process. stderr

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);

  1. ReferenceError: arguments is not defined
  2. an empty string
  3. undefined
  4. an object representing an array that has five elements✔️

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

  1. start✔️
  2. on
  3. once
  4. off

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

  1. process
  2. Buffer
  3. root
  4. require✔️

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?

  1. node index.js -x
  2. node -v
  3. node -h✔️
  4. node index.js -h

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?

  1. http.IncomingMessage✔️
  2. http.ServerRequest
  3. http.ClientRequest
  4. http.ServerResponse

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

  1. exports, __filename, __dirname
  2. exports, process, require, module, __filename, __dirname
  3. exports, module, __filename, __dirname
  4. exports, require, module, __filename, __dirname✔️

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

  1. V8
  2. c-ares
  3. libuv✔️
  4. events

Q39. What does the .node file extension represent?

  1. a C++ file that can have a .node extension and that Node will be able to execute directly.
  2. a C++ Addon file that is built with node-gyp✔️
  3. a JSON file that can have a .node extension as well as the .json extension
  4. a JavaScript file that can have a .node extension as well as the .js extension

Q40. What can you export with module.exports?

  1. only objects.
  2. only functions
  3. only variables and arrays
  4. functions, objects, arrays, or anything you assign to the module✔️

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

  1. os
  2. util
  3. cluster✔️
  4. net

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

  1. SSL
  2. hash
  3. crypto✔️
  4. TLS

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

  1. const { readFile } = require(fs).promises✔️
  2. const { readFile } = require(fs)
  3. const { readFilePromises: readFile } = require(fs)
  4. const { readFile } = require(promises)

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?

  1. Changes are not backwards compatible.
  2. Changes might not be backward compatible and might break existing code.
  3. Changes are just bug fixes and no new features were added.✔️
  4. Changes will add new functionality but will not break any existing code.

Q45. What does REPL stand for?

  1. run, examine, put, loop
  2. read, eval, print, loop✔️
  3. run, edit, print, loop
  4. read, extend, print, loop

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

  1. .gyprc
  2. binding.gyp✔️
  3. gyp.json
  4. package.gyp

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

  1. chai
  2. jest
  3. assert✔️
  4. mocha

Q48. Which core module in Node provides an API to register callbacks to track asynchronous resources created inside a Node.js application?

  1. cluster
  2. async_hooks✔️
  3. dgram
  4. inspector

Q49. Which Node.js module should you use when you need to decode raw data into strings?

  1. buffer
  2. util
  3. string_decoder✔️
  4. string_buffer

Q50. Which global object acts like a bridge between a Node script and the host operating system?

  1. v8
  2. env
  3. process✔️
  4. child_process

Q51. Which statement is true about Node.js and threads?

  1. Every Node process runs in a single thread, and all the I/O work is run in that same thread.
  2. Every Node process gets four threads that it can share between its JavaScript VM and the event loop.
  3. The event loop is single-threaded, but a JavaScript VM can use multiple threads.✔️
  4. JavaScript execution in Node.js is single-threaded, but I/O operations are executed using multiple threads.

Explanation: https://www.geeksforgeeks.org/why-node-js-is-a-single-threaded-language/

Q52. Which statement about event emitters is false?

  1. Event names must be camelCase strings.✔️
  2. The emit method allows a arbitrary set of arguments to be passed to the listener functions.
  3. Any values returned by the listeners for an emitted events are ignored.
  4. When an event emitter objeect emits an event, all of the functions attached to that specific event are called synchronously.

Q53. Which core module in Node can you use to compile and run JavaScript code in a sandbox environment?

  1. sandbox
  2. buffer
  3. vm✔️
  4. v8

Q54. How would you determine the number of cluster instances to start when using the cluster module?

  1. const numInstances = cluster.instances().length;
  2. const numInstances = cluster.instances();
  3. const numInstances = require(‘os’).cpus().length;
  4. const numInstances = process.cpus().length;✔️

Explanation: From official docs: https://nodejs.org/api/cluster.html#cluster_cluster

Q55. You have to read a large text file, replace some words in it, and write it back to a new file. You know that the memory on your target system is limited. What should you do?

  1. Use regular expressions directly on the file.
  2. Use Promises and async/await to offload the task to libuv.
  3. Copy the file into a database and perform the operations there.
  4. Use readline together with streams to read and transform and write the file contents line by line.✔️

Explanation: From official docs: https://nodejs.org/api/readline.html#readline_example_read_file_stream_line_by_line

Q56. Which choice is not a Node global object?

  1. process
  2. exports
  3. setTimeout
  4. Buffer✔️

Explanation: process, exports and setTimeout are global objects, Buffer isn’t (please see https://nodejs.org/api/globals.html)

Q57. What is the correct way to pipe a readable stream and a writable stream?

  1. readableStream.pipe(writableStream)✔️
  2. readableStream.on(pipe, writableStream)
  3. writableStream.pipe(readableStream)
  4. writableStream.on(pipe, readableStream)

Q58. How can you convert path segments into a string using the platform-specific separator as a delimiter?

  1. path.concat
  2. path.join✔️
  3. path.format
  4. path.parse

Q59. What is the purpose of N-API?

  1. to allow users to make requests to the server
  2. to insulate Addons from changes in the underlying JavaScript engine✔️
  3. to execute multi-threaded code in the Node environment
  4. to provide a quick way for users to create REST APIs

Q60. What is a process object and its role?

  1. a locally scoped object that provides information about the current node process
  2. a global object that provides information about files
  3. a global object that provides information about the database
  4. a global object that provides information about the current node process✔️

Q61. What will this code log to the console?

// File: person.js
exports.name = "Jane";

// File: index.js
const person = require('./person.js');
console.log(person);
  1. {'Jane'}
  2. { name: 'Jane' }✔️
  3. {}
  4. Jane

Q62. What will this code log to the console?

// File: person.js
exports = "John";

// File: index.js
const person = require('./person.js');
console.log(person);
  1. John
  2. Undefined
  3. {'John'}
  4. {}✔️

Q63. Is it possible to write tests in Node.js without an external library?

  1. yes, through the assert module✔️
  2. yes, through the debugger module
  3. yes, through the console module
  4. no

From the article: Making a Testing Framework in Node.js (Without any External Libraries)

Q64. Which assert module method is usually used to test the error-first argument in callbacks?

  1. fail
  2. doesNotThrow
  3. deepStrictEqual
  4. ifError✔️

LinkedIn Node Js Quiz Answers, LinkedIn Node Js Assessment Answers, Node Js LinkedIn Quiz Answers, Node Js Assessment LinkedIn Answers, LinkedIn Skill Quiz Answers Node Js, LinkedIn Node Js Quiz, Node Js LinkedIn Quiz, LinkedIn Quiz Answers Node Js, LinkedIn Node Js Assessment Quiz Answers, LinkedIn Skill Assessment Node Js Answers, Node Js LinkedIn Quiz, LinkedIn Node Js Assessment Test Answers, LinkedIn Node Js Test Answers, LinkedIn Node Js Skill Assessment Answers, LinkedIn Skill Assessment Answers Node Js, Node Js LinkedIn Assessment Answers, LinkedIn Node Js Assessment Answers, Node Js LinkedIn Assessment Answers, Answers to LinkedIn Quizzes, LinkedIn Skill Assessment Answers GitHub, LinkedIn Assessment Test Answers, LinkedIn Skill Assessments Answers, Node Js LinkedIn Skill Assessment Answer, Node Js LinkedIn Skill Assessment Answer, LinkedIn assessment answers, LinkedIn skill assessment answers, LinkedIn assessments, LinkedIn skill assessment, LinkedIn assessment answers 2021, LinkedIn assessment answers GitHub, LinkedIn assessment quiz answers

No post found!

Leave a Comment

Your email address will not be published.