Node.js Tutorial
- Node.js Tutorial
- Install Node.js on Windows
- Install Node.js on Linux/Ubuntu/CentOS
- Node.js First Example
- Node.js Console
- Node.js REPL
- Node.js Package Manager
- Node.js Command Line Options
- Node.js Global Objects
- Node.js OS
- Node.js Timer
- Node.js Errors
- Node.js DNS
- Node.js Net
- Node.js Crypto
- Node.js TLS/SSL
- Node.js Debugger
- Node.js Process
- Node.js Child Process
- Node.js Buffers
- Node.js Streams
- Node.js File System (FS)
- Node.js Path
- Node.js StringDecoder
- Node.js Query String
- Node.js ZLIB
- Node.js Assertion Testing
- Node.js V8
- Node.js Callbacks
- Node.js Events
- Node.js Punycode
- Node.js TTY
- Node.js Web Module
- NestJS
Node.js MySQL
Node.js MongoDB
Nodejs Difference
Node.js MCQ
Node.js Express
Nodejs Interview Questions
Node.js MCQ
1)Which of the following statement is correct?
- js is Server Side Language.
- js is the Client Side Language.
- js is both Server Side and Client Side Language.
- None of the above.
Show Answer Workspace
2) What does the REPL stand for?
- REPL stands for "Read Eval Print Loop."
- REPL stands for "Research Eval Program Learn."
- REPL stands for "Read Earn Point Learn."
- REPL stands for "Read Eval Point Loop."
Show Answer Workspace
3) Which of the following command is used to start a REPL session?
- $ node
- $ node start
- $ node repl
- $ node console
Show Answer Workspace
4) In which language is Node.js written?
Backward Skip 10sPlay VideoForward Skip 10s
- JavaScript
- C
- C++
- CoffeeScript
- All of the above
Show Answer Workspace
5) Which of the following command is used to install the Node.js express module?
- $ npm install express
- $ node install express
- $ install express
- None of the above
Show Answer Workspace
6) What is Callback?
- The callback is a technique in which a method calls back the caller method.
- The callback is an asynchronous equivalent for a function.
- Both of the above.
- None of the above.
Show Answer Workspace
7) Which of the following extension is used to save the Node.js files?
- .js
- .node
- .java
- .txt
Show Answer Workspace
8) The Node.js modules can be exposed using:
- expose
- module
- exports
- All of the above
Show Answer Workspace
9) Which of the following module is not a built-in node module?
- zlib
- https
- dgram
- fsread
Show Answer Workspace
10) Which of the following method of fs module is used to get file information?
- fs.open(path, flags[, mode], callback)
- fs.stat(path, callback)
- fs.readFile(path, flags[, mode], callback)
- None of the above.
Show Answer Workspace
11) What does the fs module stand for?
- File Service
- File System
- File Store
- File Sharing
Show Answer Workspace
12) Which of the following method of fs module is used to truncate a file?
- fs.delete(fd, len, callback)
- fs.remove(fd, len, callback)
- fs.ftruncate(fd, len, callback)
- None of the above.
Show Answer Workspace
13) Which of the following template engines can be used with Node.js?
- Jade
- Vash
- Handlebars
- All of the above
Show Answer Workspace
14) Which of the following code print the platform of operating system?
- console.log('platform : ' + os.platform);
- console.log('platform : ' + os.platform());
- console.log('platform : ' + os.getPlatform());
- None of the above.
Show Answer Workspace
15) Which of the following method is used to return the current working directory of the process?
- cwd();
- cwd();
- pwd();
- None of the above.
Show Answer Workspace
16) Which of the following statement defines Express?
- Express is an application framework that provides a robust set of features to develop desktop-based applications.
- Express is a minimal and flexible Node.js web application framework that provides a robust set of features to develop web and mobile applications.
- Both of the above.
- None of the above.
Show Answer Workspace
17) Which of the following is not a benefit of using modules in Express?
- It provides a means of dividing up tasks.
- It provides a means of reuse of program code.
- It provides a means of reducing the size of the program.
- It provides a means of testing individual parts of the program.
Show Answer Workspace
18) What is the best practice to do in your code to improve the performance of your application?
- Using gzip compression.
- Don't use synchronous functions.
- Do logging correctly.
- Handle exceptions properly.
Show Answer Workspace
19) What is the default scope in the Node.js application?
- Global
- Local
- Global Function
- Local to object
- Show Answer Workspace
20) Which of the following engine Node in core?
- Chrome V8
- Microsoft Chakra
- SpiderMonkey
- Node En
Show Answer Workspace
21) Which of the following statement is used to execute the code of the sample.js file?
- sample.js
- node sample.js
- nodejs sample.js
- None of the above
- Show Answer Workspace
22) Which of the following is not a valid language for Node.js?
- JavaScript
- Java
- C
- C++
Show Answer Workspace
23) Which of the following shortcut command is used to kill a process in Node.js?
- Ctrl + B
- Ctrl + K
- Ctrl + T
- Ctrl + C
Show Answer Workspace
24) How many Node object methods are available?
- 21
- 18
- 19
- 20
Show Answer Workspace
25) What is the main usage of Node.js terminal (REPL)?
- To specify the preview of the Node.js application.
- For testing Node.js/JavaScript expressions.
- For executing browser's JavaScript expressions.
- None of the above.
Show Answer Workspace
26) Which of the following types of applications can be built using Node.js?
- Web Application
- Chat Application
- RESTful Service
- All of the above
Show Answer Workspace
27) Which of the following is used to test if two nodes are equal?
- ==
- equal()
- isEqualNode()
- None of the above.
Show Answer Workspace
28) Which of the following tool is used to automate the various tasks of the Node.js application?
- Express.js
- GruntJS
- NPM
- None of the above
Show Answer Workspace
29) Which of the following areas, Node.js, is not advised to be used?
- Single Page Applications
- JSON APIs based Applications
- CPU intensive applications
- Data-Intensive Real-time Applications (DIRT)
Show Answer Workspace
30) Which of the following route parameter formats are valid?
- /books/!:from-:to
- /flights/:from-:to
- /users/:userId/books/:bookId
- None of the above.
Show Answer Workspace
31) Which of the following module is required to create a web server?
- net module
- http module
- net module
- url module
Show Answer Workspace
32) Which of the following is the correct syntax to initiate the Node.js File?
- filename.js
- javascript filename.js
- node filename.js
- node filename
Show Answer Workspace
33) Which of the following method is used to compare the placement of two nodes in the DOM hierarchy (document)?
- cloneNode()
- compareDocumentPosition()
- getFeature()
- getUserData()
Show Answer Workspace
34) Which of the following platforms does Node.js support?
- Windows
- Macintosh
- Unix/Linux
- All of the above.
Show Answer Workspace
35) Which of the following keyword is used to make properties and methods available outside the module file?
- import
- module
- exports
- require
Show Answer Workspace
36) Which of the following Node.js object property is used to return the node immediately before a node?
- localName
- index
- previousSibling
- textContent
Show Answer Workspace
37) Which of the following method can append specified content to a file?
- fs.appendFile()
- fs.open()
- fs.writeFile()
- None of the above.
Show Answer Workspace
38) Which of the following is a GUI-based debugging tool for Node.js?
- Core node debugger
- Console
- REPL
- Node Inspector
Show Answer Workspace
39) What is the use of underscore variable in REPL session in Node.js?
- It is used to store the result.
- It is used to get the last command used.
- It is used to get the last result.
- None of the above.
Show Answer Workspace
True or False Questions
40) The buffer class is a global class that can be accessed without importing a buffer module.
- True
- False
Show Answer Workspace
41) Is Node.js multithreaded?
- Yes
- No
Show Answer Workspace
42) Is the process a global object and can be accessed from anywhere?
- True
- False
Show Answer Workspace
43) Node.js uses an event-driven, non-blocking I/O model. Is it true?
- True
- False
Show Answer Workspace
44) The net.isIP(input) returns 0 for invalid input. Is it true?
- True
- False
Show Answer Workspace
45) A stream fires finish event when all data has been flushed to the underlying system. Is it true?
- True
- False
Show Answer Workspace
46) A stream fires data event when there is data available to read. Is it true?
- True
- False
Show Answer Workspace