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 2851–2875 of 3281

Career & HR topics

By tech stack

Popular tracks

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

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

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