wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FSD based

Total questions: 25

Worksheet time: 19mins

Name
Class
Date
1.

What is Node.js?

a)

A front-end framework

b)

A JavaScript runtime built on Chrome’s V8 engine

c)

A relational database

d)

A programming language

2.

Which of the following is true about Node.js?

a)

It is single-threaded and non-blocking

b)

It is multi-threaded and blocking

c)

It only supports synchronous programming

d)

It is not suitable for building APIs

3.

Which command is used to check the installed version of Node.js?

a)

node -v

b)

node --check

c)

npm -v

d)

node version

4.

What is npm in Node.js?

a)

Node Programming Module

b)

Node Package Manager

c)

Node Processing Method

d)

New Package Manager

5.

Which file is used to define project dependencies in a Node.js project?

a)

index.js

b)

config.json

c)

package.json

d)

dependencies.json

6.

How do you import a module in Node.js using CommonJS?

a)

import module from 'module-name'

b)

require('module-name')

c)

include 'module-name'

d)

fetch('module-name')

7.

What does the fs module in Node.js do?

a)

Handles file system operations

b)

Manages frontend styling

c)

Manages database connections

d)

Creates web servers

8.

Which of the following frameworks is built on top of Node.js?

a)

React

b)

Angular

c)

Express

d)

Django

9.

How do you create an HTTP server in Node.js?

a)

Using the http module

b)

Using the fs module

c)

Using the net module

d)

Using the dns module

10.

What is the main difference between fs.readFileSync() and fs.readFile() in Node.js?

a)

fs.readFileSync() is asynchronous, while fs.readFile() is synchronous

b)

fs.readFileSync() blocks execution until the file is read, while fs.readFile() does not.

c)

fs.readFile() is faster than fs.readFileSync().

d)

fs.readFileSync() does not require the fs module.

11.

Which method is used to add content to an existing file without overwriting it?

a)

fs.writeFileSync()

b)

fs.appendFileSync()

c)

fs.readFileSync()

d)

fs.renameSync()

12.

Which statement about file streams and directories in Node.js is correct?

a)

fs.readdirSync() is used to delete directories.

b)

File streams (fs.createReadStream()) allow reading large files efficiently without loading the entire file into memory.

c)

fs.mkdirSync() is used to list all files in a directory.

d)

fs.writeStream() is used only for deleting files.

13.

What is Express.js?

a)

A JavaScript library for front-end

b)

A Node.js framework for building web applications

c)

A web server for hosting static websites

d)

A package manager for Node.js

14.

Which command is used to install Express in a Node.js project?

a)

npm install express

b)

npm add express

c)

npm express install

d)

node install express

15.

What is the correct way to create an Express app?

a)

const app = express.create()

b)

const app = express()

c)

const app = new Express()

d)

const app = createExpressApp()

16.

How do you define a GET route in Express?

a)

app.get('/route', function(req, res) {})

b)

app.post('/route', function(req, res) {})

c)

app.put('/route', function(req, res) {})

d)

app.get('/route') {}

17.

What is middleware in Express?

a)

A function to handle HTTP requests

b)

A function that runs before a route handler

c)

A tool to manage databases

d)

A method for handling routes in Express

18.

How can you add middleware to your Express app?

a)

app.use(middlewareFunction)

b)

app.add(middlewareFunction)

c)

app.include(middlewareFunction)

d)

app.middleware(middlewareFunction)

19.

How do you send a JSON response in Express?

a)

res.sendJson({ key: "value" })

b)

res.json({ key: "value" })

c)

res.send({ key: "value" })

d)

res.writeJson({ key: "value" })

20.

What does req represent in Express?

a)

The request object, containing HTTP request information

b)

The response object

c)

The server instance

d)

The middleware function

21.

How do you handle a route with a dynamic parameter in Express?

a)

app.get('/users/:id', function(req, res) {})

b)

app.get('/users/id', function(req, res) {})

c)

app.get('/users?param', function(req, res) {})

d)

app.get('/users(id)', function(req, res) {})

22.

What is the purpose of next() in Express middleware?

a)

To end the request-response cycle

b)

To pass control to the next middleware function

c)

To send a response to the client

d)

To process the route

23.

What is Postman primarily used for?

a)

Writing SQL queries

b)

Sending HTTP requests and testing APIs

c)

Designing front-end web pages

d)

Managing cloud storage

24.

Which of the following request methods can be used in Postman?

a)

GET

b)

POST

c)

PUT

d)

All of the above

25.

What is the purpose of Collections in Postman?

a)

To store API response data

b)

To group related API requests for better organization

c)

To write server-side scripts

d)

To generate SQL queries automatically