Question Bank

3705 approved questions from the community

How do you set response headers in Express.js?

MEDIUM
SINGLE CHOICE
30s
Express
by Mohamed

Express.js supports streaming responses using the res.write() method.

HARD
TRUE FALSE
30s
Express
by Mohamed

In Express.js, calling `res.json()` automatically sets the Content-Type header to 'application/json'.

MEDIUM
TRUE FALSE
25s
Express
by Mohamed

The `res.sendFile()` method requires an absolute path to the file.

MEDIUM
TRUE FALSE
25s
Express
by Mohamed

You must manually parse JSON request bodies in Express.js without any middleware.

EASY
TRUE FALSE
25s
Express
by Mohamed

Express.js is synchronous and cannot handle asynchronous operations.

EASY
TRUE FALSE
20s
Express
by Mohamed

What method sends a JSON response in Express.js?

EASY
SINGLE CHOICE
25s
Express
by Mohamed

Which object in Express.js represents the HTTP request?

EASY
SINGLE CHOICE
25s
Express
by Mohamed

Which object in Express.js represents the HTTP response?

EASY
SINGLE CHOICE
25s
Express
by Mohamed

What file is typically the entry point for an Express.js application?

EASY
SINGLE CHOICE
25s
Express
by Mohamed

Using `res.send()` multiple times in the same route handler will send multiple responses to the client.

HARD
TRUE FALSE
30s
Express
by Mohamed

Error-handling middleware can recover from an error and continue processing the request by calling next() without arguments.

HARD
TRUE FALSE
30s
Express
by Mohamed

The order of route definitions in Express.js doesn't matter because Express matches all routes simultaneously.

HARD
TRUE FALSE
30s
Express
by Mohamed

Middleware defined with `app.use()` without a path will execute for every request including static file requests.

HARD
TRUE FALSE
30s
Express
by Mohamed

You can mount an Express application as a sub-application within another Express application.

HARD
TRUE FALSE
30s
Express
by Mohamed

Express.js automatically handles uncaught promise rejections in async route handlers.

HARD
TRUE FALSE
30s
Express
by Mohamed

How would you implement a logging middleware that tracks request processing time?

HARD
SINGLE CHOICE
40s
Express
by Mohamed

What is the best practice for handling asynchronous errors in Express.js route handlers?

HARD
SINGLE CHOICE
40s
Express
by Mohamed

In Express.js, if you call `next('route')`, it will skip to the next route handler, bypassing remaining middleware in the current route.

HARD
TRUE FALSE
30s
Express
by Mohamed

What is the benefit of using `express.Router` for organizing routes?

MEDIUM
SINGLE CHOICE
35s
Express
by Mohamed
PreviousPage 60 of 186Next