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 76–100 of 100

Popular tracks

Mid PDF
How do you implement rate limiting in a Node.js API?

Short answer: Use middleware like express-rate-limit to limit the number of requests per IP. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront. Say this in…

Node.js Read answer
Mid PDF
How do you parse JSON request bodies in Express?

Short answer: Use Express’s built-in middleware: app.use(express.json()); This enables the app to read req.body in JSON POST/PUT requests. Example code Use Express’s built-in middleware: app.use(express.json()); This ena…

Node.js Read answer
Mid PDF
What are websockets and how do they work with Node.js?

Short answer: Websockets enable two-way real-time communication over a single TCP connection. Use libraries like socket.io. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for th…

Node.js Read answer
Mid PDF
How do you parse JSON request bodies in Express?

Short answer: pp.use(express.json()); This enables the app to read req.body in JSON POST/PUT requests. pp.use(express.json()); This enables the app to read req.body in JSON POST/PUT requests. pp.use(express.json()); This…

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

Short answer: CORS (Cross-Origin Resource Sharing) allows servers to specify who can access their APIs. ✅ Use the cors middleware: npm install cors const cors = require('cors'); app.use(cors()); You can also customize it…

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

Short answer: PIs. ✅ Use the cors middleware: npm install cors const cors = require('cors'); pp.use(cors()); You can also customize it: pp.use(cors({ origin: ' })); PIs. ✅ Use the cors middleware: npm install cors const…

Node.js Read answer
Mid PDF
How do you debug a Node.js application?

Short answer: Use console.log for quick checks. Use node --inspect and Chrome DevTools. Use debuggers in IDEs (VSCode). Use profiling tools like clinic.js. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregat…

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

Short answer: You define a catch-all middleware after all routes: app.use((req, res) => { res.status(404).json({ message: 'Route not found' }); }); Example code You define a catch-all middleware after all routes: app.…

Node.js Read answer
Mid PDF
How do you mock HTTP requests in tests?

Short answer: Use libraries like nock to intercept and mock HTTP calls. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront. Say this in the interview Define…

Node.js Read answer
Mid PDF
How do you secure your REST API in Node.js?

Short answer: Use HTTPS Implement authentication & authorization (e.g., JWT) Sanitize inputs to prevent XSS/SQLi Rate-limit requests Use helmet for HTTP headers: const helmet = require('helmet'); app.use(helmet()); S…

Node.js Read answer
Mid PDF
How can you perform load testing on your Node.js API?

Short answer: Use tools like Apache JMeter, k6, or Artillery to simulate many users and measure performance. Ecosystem & Tools Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs…

Node.js Read answer
Mid PDF
How do you validate request data in a REST API?

Short answer: You can use validation libraries to ensure incoming data is valid. 📌 Example with express-validator: npm install express-validator const { body, validationResult } = require('express-validator'); app.post(…

Node.js Read answer
Mid PDF
How do you validate request data in a REST API?

Short answer: pp.post('/users', body('email').isEmail(), (req, res) => { const errors = validationResult(req); if (!errors.isEmpty()) return res.status(400).json({ errors: errors.array() }); res.send('User created');…

Node.js Read answer
Mid PDF
What libraries can you use for input validation in Express?

Short answer: express-validator Joi yup zod All support schema-based and custom validations. Real-world example (ShopNest) Express middleware authenticates JWT, then the /orders route handler creates the order. Say this…

Node.js Read answer
Mid PDF
How does Node.js versioning work?

Short answer: Uses semantic versioning: MAJOR.MINOR.PATCH. New major versions can include breaking changes. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefro…

Node.js Read answer
Mid PDF
What libraries can you use for input validation in Express?

Short answer: ll support schema-based and custom validations. Real-world example (ShopNest) Express middleware authenticates JWT, then the /orders route handler creates the order. Say this in the interview Define — one c…

Node.js Read answer
Mid PDF
How do you handle authentication in a REST API?

Short answer: Typical options include: JWT tokens OAuth API keys Sessions (less common for APIs) 📌 Usually, the client includes a token in the Authorization header: Authorization: Bearer <token> The server verifie…

Node.js Read answer
Mid PDF
How do you handle authentication in a REST API?

Short answer: uthorization: Bearer <token> The server verifies the token on every request. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront. Say thi…

Node.js Read answer
Mid PDF
What are JWTs and how do you use them?

Short answer: JWT (JSON Web Token) is a compact, URL-safe token used for securely transmitting information. Consists of Header, Payload, and Signature Used to verify user identity and permissions 📌 Generate: const jwt =…

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

Short answer: Use the multer middleware: npm install multer 📌 Example: const multer = require('multer'); const upload = multer({ dest: 'uploads/' }); app.post('/upload', upload.single('file'), (req, res) => { res.sen…

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

Short answer: pp.post('/upload', upload.single('file'), (req, res) => { res.send('File uploaded'); }); pp.post('/upload', upload.single('file'), (req, res) => { res.send('File uploaded'); }); pp.post('/upload', upl…

Node.js Read answer
Mid PDF
How do you test REST APIs built with Node.js?

Short answer: Use testing frameworks: Jest or Mocha for unit tests Supertest for HTTP API testing 📌 Example with Supertest: const request = require('supertest'); request(app) .get('/api/users') .expect(200) .then(res =&…

Node.js Read answer
Mid PDF
How do you log HTTP requests in Node.js?

Short answer: Use the morgan middleware: npm install morgan const morgan = require('morgan'); app.use(morgan('dev')); Logs every request with method, status, time, etc. Example code Use the morgan middleware: npm install…

Node.js Read answer
Mid PDF
How do you log HTTP requests in Node.js?

Short answer: pp.use(morgan('dev')); Logs every request with method, status, time, etc. pp.use(morgan('dev')); Logs every request with method, status, time, etc. pp.use(morgan('dev')); Logs every request with method, sta…

Node.js Read answer
Mid PDF
What are some best practices for designing REST APIs?

Short answer: Use plural nouns in endpoints (/users, not /user) Use proper HTTP methods Send meaningful status codes Keep URLs simple and consistent Use pagination for large data Protect with authentication/authorization…

Node.js Read answer

Node.js Node.js Tutorial · Node.js

Short answer: Use middleware like express-rate-limit to limit the number of requests per IP.

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 Express’s built-in middleware: app.use(express.json()); This enables the app to read req.body in JSON POST/PUT requests.

Example code

Use Express’s built-in middleware: app.use(express.json()); This enables the app to read req.body in JSON POST/PUT requests.

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: Websockets enable two-way real-time communication over a single TCP connection. Use libraries like socket.io.

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()); This enables the app to read req.body in JSON POST/PUT requests. pp.use(express.json()); This enables the app to read req.body in JSON POST/PUT requests. pp.use(express.json()); This enables the app to read req.body in JSON POST/PUT requests. pp.use(express.json()); This enables the app to read req.body in JSON POST/PUT requests.

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: CORS (Cross-Origin Resource Sharing) allows servers to specify who can access their APIs. ✅ Use the cors middleware: npm install cors const cors = require('cors'); app.use(cors()); You can also customize it: 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: PIs. ✅ Use the cors middleware: npm install cors const cors = require('cors'); pp.use(cors()); You can also customize it: pp.use(cors({ origin: ' })); PIs. ✅ Use the cors middleware: npm install cors const cors = require('cors'); pp.use(cors()); You can also customize it: pp.use(cors({ origin: ' })); PIs. ✅ Use the cors middleware: npm install cors const… cors = require('cors'); pp.use(cors()); You can also…

Explain a bit more

customize it: pp.use(cors({ origin: ' })); PIs. ✅ Use the cors middleware: npm install cors const cors = require('cors'); pp.use(cors()); You can also customize it: 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: Use console.log for quick checks. Use node --inspect and Chrome DevTools. Use debuggers in IDEs (VSCode). Use profiling tools like clinic.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: You define a catch-all middleware after all routes: app.use((req, res) => { res.status(404).json({ message: 'Route not found' }); });

Example code

You define a catch-all middleware after all routes: app.use((req, res) => { res.status(404).json({ message: 'Route not found' }); });

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 libraries like nock to intercept and mock HTTP calls.

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 HTTPS Implement authentication & authorization (e.g., JWT) Sanitize inputs to prevent XSS/SQLi Rate-limit requests Use helmet for HTTP headers: const helmet = require('helmet'); app.use(helmet());

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 tools like Apache JMeter, k6, or Artillery to simulate many users and measure performance. Ecosystem & Tools

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 use validation libraries to ensure incoming data is valid. 📌 Example with express-validator: npm install express-validator const { body, validationResult } = require('express-validator'); app.post('/users', body('email').isEmail(), (req, res) => { const errors = validationResult(req);

Example code

if (!errors.isEmpty()) return res.status(400).json({ errors: errors.array() }); res.send('User created'); });

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.post('/users', body('email').isEmail(), (req, res) => { const errors = validationResult(req); if (!errors.isEmpty()) return res.status(400).json({ errors: errors.array() }); res.send('User created'); }); pp.post('/users', body('email').isEmail(), (req, res) => { const errors = validationResult(req); if (!errors.isEmpty())… return res.status(400).json({…… errors: errors.array() }); res.send('User created'); }); pp.

Explain a bit more

post('/users', body('email').isEmail(), (req, res) => { const errors = validationResult(req); if (!errors.isEmpty()) return res.status(400).json({ errors: errors.array() }); res.send('User created'); }); pp.post('/users', body('email').isEmail(), (req, res) => { const errors = validationResult(req); if (!errors.isEmpty())… return res.status(400).json({ errors: errors.array() }); res.send('User created'); });

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: express-validator Joi yup zod All support schema-based and custom validations.

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: Uses semantic versioning: MAJOR.MINOR.PATCH. New major versions can include breaking changes.

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: ll support schema-based and custom validations.

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: Typical options include: JWT tokens OAuth API keys Sessions (less common for APIs) 📌 Usually, the client includes a token in the Authorization header: Authorization: Bearer <token> The server verifies the token on every request.

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: uthorization: Bearer <token> The server verifies the token on every request.

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: JWT (JSON Web Token) is a compact, URL-safe token used for securely transmitting information. Consists of Header, Payload, and Signature Used to verify user identity and permissions 📌 Generate: const jwt = require('jsonwebtoken'); const token = jwt.sign({ id: user.id }, 'secret', { expiresIn: '1h' }); 📌 Verify: jwt.verify(token, 'secret');

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 the multer middleware: npm install multer 📌 Example: const multer = require('multer'); const upload = multer({ dest: 'uploads/' }); app.post('/upload', upload.single('file'), (req, res) => { res.send('File uploaded'); });

Example code

Use the multer middleware: npm install multer 📌 Example: const multer = require('multer');
const upload = multer({ dest: 'uploads/' }); app.post('/upload', upload.single('file'), (req, res) => { res.send('File uploaded'); });

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.post('/upload', upload.single('file'), (req, res) => { res.send('File uploaded'); }); pp.post('/upload', upload.single('file'), (req, res) => { res.send('File uploaded'); }); pp.post('/upload', upload.single('file'), (req, res) => { res.send('File uploaded'); }); pp.post('/upload', upload.single('file'), (req, res) => { res.send('File uploaded'); });

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 testing frameworks: Jest or Mocha for unit tests Supertest for HTTP API testing 📌 Example with Supertest: const request = require('supertest'); request(app) .get('/api/users') .expect(200) .then(res => { console.log(res.body); });

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 the morgan middleware: npm install morgan const morgan = require('morgan'); app.use(morgan('dev')); Logs every request with method, status, time, etc.

Example code

Use the morgan middleware: npm install morgan const morgan = require('morgan'); app.use(morgan('dev')); Logs every request with method, status, time, 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: pp.use(morgan('dev')); Logs every request with method, status, time, etc. pp.use(morgan('dev')); Logs every request with method, status, time, etc. pp.use(morgan('dev')); Logs every request with method, status, time, etc. pp.use(morgan('dev')); Logs every request with method, status, time, 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: Use plural nouns in endpoints (/users, not /user) Use proper HTTP methods Send meaningful status codes Keep URLs simple and consistent Use pagination for large data Protect with authentication/authorization Use versioning (/api/v1/...) Validate and sanitize all inputs NPM and module-related Node.js interview questions

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
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