Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 51–75 of 100

Popular tracks

Mid PDF
How do you optimize Node.js applications for high throughput?

Short answer: Avoid blocking the event loop. Use asynchronous APIs. Use clustering or worker threads. Cache results where possible. Profile and fix bottlenecks. Use load balancers for scaling horizontally. Real-world exa…

Node.js Read answer
Mid PDF
How do you emit and listen for events?

Short answer: const EventEmitter = require('events'); const emitter = new EventEmitter(); emitter.on('greet', (name) => { console.log(`Hello, ${name}!`); }); emitter.emit('greet', 'Alice'); // Output: Hello, Alice! Ex…

Node.js Read answer
Mid PDF
How do you install a package globally vs locally?

Short answer: Local Installation (default): Installs the package into the node_modules folder of your current project. npm install lodash ✅ Used when the package is needed as part of your app's code. Global Installation:…

Node.js Read answer
Mid PDF
Explain clustering and how it improves Node.js app performance.

Short answer: Clustering runs multiple Node.js instances on different CPU cores sharing the same server port. This spreads load and uses full CPU capacity, increasing concurrency. Real-world example (ShopNest) A ShopNest…

Node.js Read answer
Mid PDF
How does Node.js handle concurrency?

Short answer: Node.js uses a single-threaded event loop to handle many I/O operations asynchronously, allowing it to handle thousands of concurrent connections efficiently without creating threads per connection. Real-wo…

Node.js Read answer
Mid PDF
How do you scale Node.js horizontally?

Short answer: Deploy multiple instances on different machines or containers. Use a load balancer to distribute traffic. Share state externally (e.g., Redis) since instances are stateless. Say this in the interview Define…

Node.js Read answer
Mid PDF
How does Node.js handle concurrency?

Short answer: llowing it to handle thousands of concurrent connections efficiently without creating threads per connection. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for th…

Node.js Read answer
Mid PDF
What are some common causes of memory leaks in Node.js?

Short answer: Global variables holding references. Event listeners not removed. Closures holding onto variables. Caches growing without limits. Security & Best Practices Real-world example (ShopNest) A ShopNest BFF i…

Node.js Read answer
Mid PDF
How do you update a package in Node.js?

Short answer: To update all packages to their latest safe versions based on semver: npm update To update a specific package to its latest version: npm install express@latest For a more interactive way: npx npm-check-upda…

Node.js Read answer
Mid PDF
How do you create a custom Node.js module?

Short answer: You can create a custom module by writing logic in a separate .js file and exporting it using module.exports. Explain a bit more 📌 Example: mathUtils.js function add(a, b) { return a + b; module.exports =…

Node.js Read answer
Mid PDF
How do you prevent Denial of Service (DoS) attacks in Node.js?

Short answer: Use rate limiting. Validate and sanitize inputs. Avoid blocking event loop. Use security middleware like helmet. Use a reverse proxy with DDoS protection. Real-world example (ShopNest) A ShopNest BFF in Nod…

Node.js Read answer
Mid PDF
How do you create a custom Node.js module?

Short answer: pp.js const math = require('./mathUtils'); console.log(math.add(5, 3)); // 8 console.log(math.subtract(9, 4)); // 5 ✅ This is how you break your code into reusable pieces (modules) in Node.js. REST API Deve…

Node.js Read answer
Mid PDF
How do you sanitize user input to avoid security risks?

Short answer: Strip out dangerous characters. Use libraries like validator.js. Escape output in HTML contexts. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the React store…

Node.js Read answer
Mid PDF
What are HTTP methods used in REST?

Short answer: RESTful APIs use the following standard HTTP methods: Method Purpose GET Retrieve data POST Create new data PUT Update existing PATCH Partial update DELETE Remove data Real-world example (ShopNest) A ShopNe…

Node.js Read answer
Mid PDF
Explain CORS and how to configure it in Node.js.

Short answer: Cross-Origin Resource Sharing controls which domains can access your API. Configure with the cors package: const cors = require('cors'); app.use(cors({ origin: ' })); Real-world example (ShopNest) A ShopNes…

Node.js Read answer
Mid PDF
What are status codes?

Short answer: Name commonly used ones. HTTP status codes indicate the result of a request: Code Meaning 200 OK 201 Created 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error 📌 Example…

Node.js Read answer
Mid PDF
Explain CORS and how to configure it in Node.js. Cross-Origin Resource Sharing controls which domains can access your API. Configure with the cors package: const cors = require('cors');

Short answer: pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.…

Node.js Read answer
Mid PDF
What are status codes? Name commonly used ones.

Short answer: HTTP status codes indicate the result of a request: Code Meaning 200 OK 201 Created 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error 📌 res.status(201).json({ message:…

Node.js Read answer
Mid PDF
How do you create a REST API using Node.js?

Short answer: Using Express.js, you can quickly set up routes and logic. 📌 Example: const express = require('express'); const app = express(); app.use(express.json()); app.get('/api/users', (req, res) => { res.json([…

Node.js Read answer
Mid PDF
How do you securely handle file uploads in Node.js?

Short answer: Validate file types and sizes. Store files outside of the web root. Use libraries like multer. Scan files for malware. REST API & Web Development Real-world example (ShopNest) A ShopNest BFF in Node.js…

Node.js Read answer
Mid PDF
How do you create a REST API using Node.js?

Short answer: pp.use(express.json()); pp.get('/api/users', (req, res) => { res.json([{ id: 1, name: 'Alice' }]); }); pp.listen(3000, () => console.log('Server running')); pp.use(express.json()); pp.get('/api/users'…

Node.js Read answer
Mid PDF
How do you implement pagination in REST APIs?

Short answer: Use query parameters like ?page=2&limit=10 to return chunks of data instead of all at once. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storef…

Node.js Read answer
Mid PDF
How do you handle routing in Express?

Short answer: Routing refers to defining how the application responds to different HTTP methods and URLs. 📌 Example code app.get('/users', (req, res) => { res.send('Get all users'); }); app.post('/users', (req, res)…

Node.js Read answer
Mid PDF
How do you handle routing in Express?

Short answer: pp.get('/users', (req, res) => { res.send('Get all users'); }); pp.post('/users', (req, res) => { res.send('Create user'); }); pp.get('/users', (req, res) => { res.send('Get all users'); }); pp.pos…

Node.js Read answer
Mid PDF
What are route parameters in Express?

Short answer: Route parameters are dynamic values in the URL, defined using :. 📌 Example code app.get('/users/:id', (req, res) => { const id = req.params.id; res.send(`User ID: ${id}`); }); Request to /users/42 retur…

Node.js Read answer

Node.js Node.js Tutorial · Node.js

Short answer: Avoid blocking the event loop. Use asynchronous APIs. Use clustering or worker threads. Cache results where possible. Profile and fix bottlenecks. Use load balancers for scaling horizontally.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: const EventEmitter = require('events'); const emitter = new EventEmitter(); emitter.on('greet', (name) => { console.log(`Hello, ${name}!`); }); emitter.emit('greet', 'Alice'); // Output: Hello, Alice!

Example code

const EventEmitter = require('events');
const emitter = new EventEmitter(); emitter.on('greet', (name) => { console.log(`Hello, ${name}!`); }); emitter.emit('greet', 'Alice'); // Output: Hello, Alice!

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Local Installation (default): Installs the package into the node_modules folder of your current project. npm install lodash ✅ Used when the package is needed as part of your app's code. Global Installation: Installs the package system-wide, making it available in the command line anywhere. npm install -g nodemon ✅ Used for tools/CLI apps like nodemon, eslint, typescript, etc.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Clustering runs multiple Node.js instances on different CPU cores sharing the same server port. This spreads load and uses full CPU capacity, increasing concurrency.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Node.js uses a single-threaded event loop to handle many I/O operations asynchronously, allowing it to handle thousands of concurrent connections efficiently without creating threads per connection.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Deploy multiple instances on different machines or containers. Use a load balancer to distribute traffic. Share state externally (e.g., Redis) since instances are stateless.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: llowing it to handle thousands of concurrent connections efficiently without creating threads per connection.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Global variables holding references. Event listeners not removed. Closures holding onto variables. Caches growing without limits. Security & Best Practices

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: To update all packages to their latest safe versions based on semver: npm update To update a specific package to its latest version: npm install express@latest For a more interactive way: npx npm-check-updates -u npm install ✅ The npm-check-updates tool helps update versions in your package.json.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: You can create a custom module by writing logic in a separate .js file and exporting it using module.exports.

Explain a bit more

📌 Example: mathUtils.js function add(a, b) { return a + b; module.exports = { add, subtract }; app.js const math = require('./mathUtils'); console.log(math.add(5, 3)); // 8 console.log(math.subtract(9, 4)); // 5 ✅ This is how you break your code into reusable pieces (modules) in Node.js. REST API Development in Node.js

Example code

} function subtract(a, b) { return a - b;
}

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Use rate limiting. Validate and sanitize inputs. Avoid blocking event loop. Use security middleware like helmet. Use a reverse proxy with DDoS protection.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: pp.js const math = require('./mathUtils'); console.log(math.add(5, 3)); // 8 console.log(math.subtract(9, 4)); // 5 ✅ This is how you break your code into reusable pieces (modules) in Node.js. REST API Development in Node.js pp.js const math = require('./mathUtils'); console.log(math.add(5, 3)); // 8 console.log(math.subtract(9, 4)); // 5 ✅ This is how you break your code into reusable pieces (modules) in Node.js.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Strip out dangerous characters. Use libraries like validator.js. Escape output in HTML contexts.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: RESTful APIs use the following standard HTTP methods: Method Purpose GET Retrieve data POST Create new data PUT Update existing PATCH Partial update DELETE Remove data

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Cross-Origin Resource Sharing controls which domains can access your API. Configure with the cors package: const cors = require('cors'); app.use(cors({ origin: ' }));

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Name commonly used ones. HTTP status codes indicate the result of a request: Code Meaning 200 OK 201 Created 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error 📌

Example code

res.status(201).json({ message: 'User created successfully' });

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' })); pp.use(cors({ origin: ' }));

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: HTTP status codes indicate the result of a request: Code Meaning 200 OK 201 Created 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error 📌 res.status(201).json({ message: 'User created successfully' }); HTTP status codes indicate the result of a request: Code Meaning 200 OK 201 Created… 400 Bad Request 401… Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error 📌

Example code

res.status(201).json({ message: 'User created successfully' }); HTTP status codes indicate the result of a request: Code Meaning 200 OK 201 Created 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error 📌 Example: res.status(201).json({ message: 'User created successfully' }); HTTP status codes indicate the result of a request: Code Meaning 200 OK 201 Created… 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error 📌 Example: res.status(201).json({ message: 'User created successfully' });

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Using Express.js, you can quickly set up routes and logic. 📌 Example: const express = require('express'); const app = express(); app.use(express.json()); app.get('/api/users', (req, res) => { res.json([{ id: 1, name: 'Alice' }]); }); app.listen(3000, () => console.log('Server running'));

Example code

Using Express.js, you can quickly set up routes and logic. 📌 Example: const express = require('express');
const app = express(); app.use(express.json()); app.get('/api/users', (req, res) => { res.json([{ id: 1, name: 'Alice' }]); }); app.listen(3000, () => console.log('Server running'));

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Validate file types and sizes. Store files outside of the web root. Use libraries like multer. Scan files for malware. REST API & Web Development

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: pp.use(express.json()); pp.get('/api/users', (req, res) => { res.json([{ id: 1, name: 'Alice' }]); }); pp.listen(3000, () => console.log('Server running')); pp.use(express.json()); pp.get('/api/users', (req, res) => { res.json([{ id: 1, name: 'Alice' }]); }); pp.listen(3000, () => console.log('Server running')); Real-world example… (ShopNest) Express…… middleware authenticates JWT, then the /orders route handler…

Explain a bit more

creates the order. pp.use(express.json()); pp.get('/api/users', (req, res) => { res.json([{ id: 1, name: 'Alice' }]); }); pp.listen(3000, () => console.log('Server running')); pp.use(express.json()); pp.get('/api/users', (req, res) => { res.json([{ id: 1, name: 'Alice' }]); }); pp.listen(3000, () => console.log('Server running')); Real-world example… (ShopNest) Express middleware authenticates JWT, then the /orders route handler creates the order.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Use query parameters like ?page=2&limit=10 to return chunks of data instead of all at once.

Real-world example (ShopNest)

A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Routing refers to defining how the application responds to different HTTP methods and URLs. 📌

Example code

app.get('/users', (req, res) => { res.send('Get all users'); }); app.post('/users', (req, res) => { res.send('Create user'); });

Real-world example (ShopNest)

Express middleware authenticates JWT, then the /orders route handler creates the order.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: pp.get('/users', (req, res) => { res.send('Get all users'); }); pp.post('/users', (req, res) => { res.send('Create user'); }); pp.get('/users', (req, res) => { res.send('Get all users'); }); pp.post('/users', (req, res) => { res.send('Create user'); }); pp.get('/users', (req, res) => { res.send('Get all users'); }); pp.post('/users', (req, res) => {… res.send('Create user'); }); pp.get('/users', (req, res) => {…

Explain a bit more

res.send('Get all users'); }); pp.post('/users', (req, res) => { res.send('Create user'); });

Real-world example (ShopNest)

Express middleware authenticates JWT, then the /orders route handler creates the order.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

Node.js Node.js Tutorial · Node.js

Short answer: Route parameters are dynamic values in the URL, defined using :. 📌

Example code

app.get('/users/:id', (req, res) => { const id = req.params.id; res.send(`User ID: ${id}`); }); Request to /users/42 returns: User ID: 42

Real-world example (ShopNest)

Express middleware authenticates JWT, then the /orders route handler creates the order.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details