TGViewer
Web Development Web Development @webdevcoursefree · 79.6K subscribers
Post #3762 2.71K
🚀 Web Development Interview Questions with Answers — Part 5: Node.js

🧠 111. What is Node.js?

Node.js is a JavaScript runtime built on Chrome’s V8 engine.

It allows JavaScript to run outside the browser.

Features:

✅ Fast execution

✅ Event-driven

✅ Non-blocking I/O

✅ Scalable applications

Example:

console.log("Hello Node.js");

🧠 112. Why Use Node.js?

Advantages:

✅ Fast performance

✅ Single programming language for frontend & backend

✅ Handles multiple requests efficiently

✅ Huge npm ecosystem

Best Use Cases:

• APIs

• Real-time apps

• Chat applications

• Streaming services

🧠 113. What is npm?

npm stands for: 👉 Node Package Manager

Used to install libraries/packages.

Example:

npm install express

Uses:

• Install packages

• Manage dependencies

• Run scripts

🧠 114. Difference Between CommonJS and ES Modules

CommonJS : Uses require() : Uses module.exports

ES Modules : Uses import : Uses export

CommonJS:

const fs = require("fs");

ES Modules:

import fs from "fs";

🧠 115. What is Express.js?

Express.js is a minimal backend framework for Node.js.

Features:

✅ Routing

✅ Middleware support

✅ API development

Example:

const express = require("express");

const app = express();

app.get("/", (req, res) => {

res.send("Hello");

});

🧠 116. What is Middleware?

Middleware functions execute between: Request → Response

Uses:

• Authentication

• Logging

• Validation

Example:

app.use((req, res, next) => {

console.log("Middleware");

next();

});

🧠 117. What is REST API?

REST API follows REST architecture principles.

Common Methods:

• GET

• POST

• PUT

• DELETE

Example:

app.get("/users", (req, res) => {

res.json(users);

});

🧠 118. Difference Between PUT and PATCH

PUT : Updates entire resource

PATCH : Updates partial resource

Example:

PUT /user/1

PATCH /user/1

🧠 119. What is JWT?

JWT stands for: 👉 JSON Web Token

Used for authentication.

Structure:

Header.Payload.Signature

Benefits:

✅ Secure authentication

✅ Stateless sessions

🧠 120. What is Authentication vs Authorization?

Authentication : Verifies identity

Authorization : Verifies permissions

Example:

• Login → Authentication

• Admin access → Authorization

🧠 121. What is CORS?

CORS stands for: 👉 Cross-Origin Resource Sharing

It controls resource sharing between different domains.

Example:

app.use(cors());

🧠 122. What is dotenv?

dotenv loads environment variables from .env file.

Example:

require("dotenv").config();

.env

PORT=5000

🧠 123. What is Event Loop?

Event loop handles asynchronous operations in Node.js.

Process:

1. Executes synchronous code

2. Handles callbacks

3. Processes async tasks

Benefits:

✅ Non-blocking execution

✅ Efficient concurrency

🧠 124. What is Non-Blocking I/O?

Node.js can process multiple requests without waiting.

Benefits:

✅ Faster performance

✅ Better scalability

🧠 125. What is package.json?

package.json stores project metadata and dependencies.
  • ❤ 6
More from @webdevcoursefree
  1. Oct 12, 2026For example: Go to Profile → <a> Submit Form → <button> Open Article → <a> Delete Account…
  2. Oct 12, 2026🌐 Web Development Roadmap — Part 16 HTML Links — Tag Links are one of the most important…
  3. Oct 12, 2026🚀 𝗪𝗵𝗶𝗰𝗵 𝗧𝗲𝗰𝗵 𝗦𝗸𝗶𝗹𝗹 𝗪𝗶𝗹𝗹 𝗬𝗼𝘂 𝗠𝗮𝘀𝘁𝗲𝗿 𝗶𝗻 𝟮𝟬𝟮𝟲? Want to buil…
  4. Oct 9, 2026Post #4079
  5. Oct 9, 2026Post #4078
  6. Oct 9, 2026Post #4077
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →