Node JS MCQ Questions and Answers
Q. What is Node.js used for?
A. Server-side scriptingB. Client-side web development
C. Mobile app development
D. All of the above
Q. Which company developed Node.js?
A. GoogleB. Microsoft
C. Mozilla
D. Joyent
Q. What is an advantage of using Node.js?
A. Single-threaded architectureB. Cross-platform compatibility
C. Fast and scalable
D. All of the above
Q. Which of the following is a core module in Node.js?
A. httpB. fs
C. path
D. All of the above
Q. What is the purpose of the Node Package Manager (npm)?
A. To manage Node.js packages and dependenciesB. To run Node.js applications
C. To debug Node.js code
D. To deploy Node.js applications to the cloud
Q. What is an event-driven architecture?
A. An architecture where the flow of the program is determined by eventsB. An architecture that uses callback functions to handle asynchronous operations
C. An architecture that uses promises to handle asynchronous code
D. All of the above
Q. What is the purpose of the "process" object in Node.js?
A. To provide information about the current Node.js processB. To handle uncaught exceptions
C. To exit the Node.js process
D. All of the above
Q. What is a callback function in Node.js?
A. A function passed as an argument to another functionB. A function that is called synchronously
C. A function that is called asynchronously
D. A function that returns a value
Q. How can you check if a value is undefined in Node.js?
A. value == undefinedB. value === undefined
C. typeof value === "undefined"
D. All of the above
Q. What is the purpose of the "util" module in Node.js?
A. To provide utility functions for working with data structuresB. To format and inspect objects
C. To perform asynchronous operations
D. All of the above