Node JS interview questions

Node JS interview questions
  1. What is Node JS?
  • Node.js is an open-source server environment.
  • Node.js is a platform built on Chrome's Javascript runtime for easily building fast and scalable network applications.
  • Node.js is a single-threaded, non-blocking, and even driven architecture.
  1. When to use Node JS?
  • Considering the main features of Node.js and its strengths, we can say data-driven, I/O-driven, event-driven, and non-blocking applications benefit the best from a Node.js implementation
  • It can be used to create:
    • Web servers
    • Real-Time applications
    • Command line applications
    • Building APIs
  1. Machnisam of why Node JS is so fast?
  • Node JS is using an event loop that handles the asynchronous task.
  • The event loop makes our programming nonblocking.
  • We can handle multiple requests at a time parallel that's the reason why Node JS is so fast.
  1. What is Express JS?
  • Express JS is a Node.JS based web application framework that provides broad features for building web and mobile applications.
  • It's a layer built on top of the Node JS that helps manage servers and routes
  1. What is event loop?
  • The event loop makes the code async.
  • Behind the scenes when our code runs asynchronously, some containers are call-stack, call-back queue, web API, and microtask queue.
  • The purpose of the event loop is to execute the async task as per priority
  1. What is Package.json file?
  • The Package.json file is the heart of any Node project.
  • In the Package.json file we keep all the details of the projects that hold various metadata relevant to the project like version, description, dependencies, run scripts, license, and all npm packages
  • The purpose of the event loop is to execute the async task as per priority
  • Without this package, Your project will not work