Express JS MCQ Questions And Answers
ExpressJS MCQ : This section focuses on "Basics" of Express JS. These Multiple Choice Questions (MCQ) should be practiced to improve the Express JS skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Express is a minimal and flexible _______ web application framework.
A. Node.js
B. React.js
C. Redux.js
D. Angular.js
View Answer
Ans : A
Explanation: Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. It is an open source framework developed and maintained by the Node.js foundation.
2. When did Express js Initial release?
A. 2009
B. 2010
C. 2011
D. 2012
View Answer
Ans : B
Explanation: Initial release: November 16, 2010; 10 years ago
3. Express.js, or simply Express, is a _________ web application framework for Node.js
A. Front-end
B. Back-end
C. Database
D. None of the above
View Answer
Ans : B
Explanation: Express.js, or simply Express, is a back end web application framework for Node.js, released as free and open-source software under the MIT License.
4. Express was developed by ?
A. Microsoft
B. Facebook
C. TJ Holowaychuk
D. Rasmus Lerdorf
View Answer
Ans : C
Explanation: Express was developed by TJ Holowaychuk and is maintained by the Node.js foundation and numerous open source contributors.
5. Pug earlier known as ?
A. Terse
B. DRY
C. Express
D. Jade
View Answer
Ans : D
Explanation: Pug (earlier known as Jade) is a terse language for writing HTML templates
6. Which function tells what to do when a get request at the given route is called?
A. app.get(route, callback)
B. get(route, callback)
C. js.get(route, callback)
D. fun.get(route, callback)
View Answer
Ans : A
Explanation: app.get(route, callback) : This function tells what to do when a get request at the given route is called.
7. backlog arguments defines as?
A. A port number on which the server should accept incoming requests.
B. Name of the domain
C. The maximum number of queued pending connections
D. An asynchronous function that is called when the server starts listening for requests.
View Answer
Ans : C
Explanation: backlog : The maximum number of queued pending connections. The default is 511.
8. Which method requests that the server accept the data enclosed in the request as a new object/entity of the resource identified by the URI?
A. GET
B. PUT
C. SET
D. POST
View Answer
Ans : D
Explanation: The POST method requests that the server accept the data enclosed in the request as a new object/entity of the resource identified by the URI.
9. Which method requests that the server accept the data enclosed in the request as a modification to existing object identified by the URI?
A. GET
B. DELETE
C. PUT
D. POST
View Answer
Ans : C
Explanation: The PUT method requests that the server accept the data enclosed in the request as a modification to existing object identified by the URI. If it does not exist then the PUT method should create one.
10. Which of the following is a templating engine for Express?
A. SUG
B. PUG
C. DUG
D. NUG
View Answer
Ans : B
Explanation: Pug is a templating engine for Express. Templating engines are used to remove the cluttering of our server code with HTML, concatenating strings wildly to existing HTML templates.
11. This method of using values is called ?
A. filters
B. interpolation
C. inheritance
D. includes
View Answer
Ans : B
Explanation: This method of using values is called interpolation.
12. ____________ can also be used to include plaintext, css and JavaScript.
A. filters
B. interpolation
C. inheritance
D. includes
View Answer
Ans : D
Explanation: include can also be used to include plaintext, css and JavaScript.
13. What are core features of Express framework?
A. Allows to set up middlewares to respond to HTTP Requests
B. Defines a routing table which can works as per HTTP Method and URL
C. Dynamically render HTML Pages
D. All of the above
View Answer
Ans : D
Explanation: All of the above are core features of Express framework.
14. How to store local variables that can be access within the application?
A. Using app.locals
B. Using app.storage
C. Using database
D. Config file
View Answer
Ans : A
Explanation: Using app.locals to store local variables that can be access within the application
15. _________ is a middleware which parses cookies attached to the client request object.
A. cookie
B. req.cookies
C. cookie-parser
D. None of the above
View Answer
Ans : C
Explanation: cookie-parser is a middleware which parses cookies attached to the client request object.
16. Where is captured values are populated regarding route parameters?
A. app.locals object
B. req.data object
C. req.params object
D. None of the above
View Answer
Ans : C
Explanation: req.params object is captured values are populated regarding route parameters
17. _____________ allows us to easily create a skeleton for a web application
A. Authentication
B. APIs
C. Debugging
D. Scaffolding
View Answer
Ans : D
Explanation: Scaffolding allows us to easily create a skeleton for a web application
18. Cookies are complex, large files/data that are sent to server with a client request and stored on the server side.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : B
Explanation: Cookies are simple, small files/data that are sent to client with a server request and stored on the client side.
19. In order to use Mongo with Express, we need a client API for node.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: In order to use Mongo with Express, we need a client API for node.
20. HTTP is stateless
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, HTTP is stateless; in order to associate a request to any other request, you need a way to store user data between HTTP requests.
Discussion