NodeJS quiz and interview questions

Comprehensive NodeJS quiz and questions from basic to advanced level that help you to review your NodeJS knowledge and become the master of NodeJS. Please read the following question carefully and select the correct anwser, you have to make your choice before going to the next question.

Hot and trending quiz topics for NodeJS

Events

NodeJS is built basing on event-driven architecture and understand how events in NodeJS work is one of the most important things for every NodeJS developers. In this quiz topic we will cover the common API function around the events and events handling.

ExpressJS

Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications and being one of most popular NodeJS framework today

Recent added questions

  • Fs module provides both synchronous as well as asynchronous methods.

  • How can we create chainable route handlers for a route path in ExpressJS app?

  • The methods on the response object (res) in the following table can send a response to the client, and terminate the request-response cycle. If none of these methods are called from a route handler, the client request__________

    Method Description
    res.download() Prompt a file to be downloaded.
    res.end() End the response process.
    res.json() Send a JSON response.
    res.jsonp() Send a JSON response with JSONP support.
    res.redirect() Redirect a request.
    res.render() Render a view template.
    res.send() Send a response of various types.
    res.sendFile() Send a file as an octet stream.
    res.sendStatus() Set the response status code and send its string representation as the response body.
  • Is the code below valid?

    var cb0 = function (req, res, next) {
      console.log('CB0')
      next()
    }
    var cb1 = function (req, res, next) {
      console.log('CB1')
      next()
    }
    app.get('/example/d', [cb0, cb1], function (req, res, next) {
      console.log('the response will be sent by the next function ...')
      next()
    }, function (req, res) {
      res.send('Hello from D!')
    })
  • Is the below code valid?

    var cb0 = function (req, res, next) {
      console.log('CB0')
      next()
    }
    var cb1 = function (req, res, next) {
      console.log('CB1')
      next()
    }
    var cb2 = function (req, res) {
      res.send('Hello from C!')
    }
    app.get('/example/c', [cb0, cb1, cb2])
  • How many number of callback functions can be attached to handle a request?

  • Select all valid rout parameter formats

  • Where is captured values are populated regarding route parameters?

View all NodeJS quiz questions

© 2017 QuizBucket.org