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 726–750 of 963

Career & HR topics

By tech stack

Popular tracks

Junior PDF
What is the role of async/await in Node.js?

Short answer: async/await provides a cleaner syntax for handling asynchronous code, making it look synchronous and easier to read compared to nested callbacks or promise chains. async function fetchData() { try { const d…

Node.js Read answer
Junior PDF
What is the event loop in Node.js?

Short answer: synchronous operations in a single thread, constantly checking for events (e.g., incoming data, timers) and executing associated callbacks. Explain a bit more 📌 setTimeout(() => { console.log('Executed…

Node.js Read answer
Junior PDF
What is the difference between CommonJS and ES Modules (ESM) in Node.js?

Short answer: CommonJS (CJS): Uses require() and module.exports. Synchronous module loading. ES Modules: Uses import/export syntax. Supports asynchronous and static analysis. ESM is the modern standard but Node.js suppor…

Node.js Read answer
Junior PDF
What is the difference between CommonJS and ES Modules (ESM) in Node.js?

Short answer: nalysis. ESM is the modern standard but Node.js supports both. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront. Say this in the interview D…

Node.js Read answer
Junior PDF
What is dotenv and how is it used?

Short answer: dotenv is a library to load environment variables from a .env file into process.env. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront. Say t…

Node.js Read answer
Junior PDF
What is test coverage and how do you measure it?

Short answer: Test coverage shows how much of your code is tested (lines, branches, functions). Tools to measure: Istanbul/nyc: Most popular coverage tool. Jest: Has built-in coverage reports. Run coverage with nyc: nyc…

Node.js Read answer
Junior PDF
What is the role of nodemon?

Short answer: nodemon is a development tool that automatically restarts your Node.js app when file changes are detected—great for faster development cycles. It’s not recommended for production. Usage: nodemon app.js Real…

Node.js Read answer
Junior PDF
What is the difference between synchronous and asynchronous functions?

Short answer: Synchronous functions block the execution until they finish. Asynchronous functions allow other code to run while waiting for operations (like I/O) to complete. // Synchronous (blocks event loop) const data…

Node.js Read answer
Junior PDF
What is CSRF and how do you protect against it?

Short answer: CSRF (Cross-Site Request Forgery) tricks a user into submitting unwanted requests to a trusted site. Protection: Use CSRF tokens with forms (e.g., csurf middleware in Express). Implement same-site cookies.…

Node.js Read answer
Junior PDF
What is the util.promisify() function?

Short answer: util.promisify() converts traditional Node.js callback-style functions into functions that return promises — letting you use async/await with them. Example code const util = require('util'); const fs = requ…

Node.js Read answer
Junior PDF
What is the purpose of the main field in package.json?

Short answer: It specifies the entry point file of a package (default is index.js). When someone imports your package, Node.js loads the file in main. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates ca…

Node.js Read answer
Junior PDF
What is CI/CD and how can it be applied to a Node.js project?

Short answer: CI/CD stands for Continuous Integration and Continuous Deployment. CI: Automatically build and test your Node.js app every time you push code (e.g., GitHub Actions, Jenkins). CD: Automatically deploy the ap…

Node.js Read answer
Junior PDF
What is the util.promisify() function?

Short answer: sync function read() { const content = await readFile('file.txt', 'utf8'); console.log(content); } sync function read() { const content = await readFile('file.txt', 'utf8'); console.log(content); } sync fun…

Node.js Read answer
Junior PDF
What is process in Node.js?

Short answer: process is a global object that provides information and control over the current Node.js process. 📌 Examples: console.log(process.pid); // Process ID console.log(process.platform); // OS platform You can…

Node.js Read answer
Junior PDF
What is the difference between spawn() and exec()?

Short answer: Both create child processes, but: spawn() streams data (good for large outputs) exec() buffers data (good for small outputs) const { spawn, exec } = require('child_process'); // spawn example const ls = spa…

Node.js Read answer
Junior PDF
What is the use of __dirname and __filename?

Short answer: __dirname: Returns the directory path of the current module. __filename: Returns the full file path of the current module. 📌 Example code console.log(__dirname); // /Users/yourname/project console.log(__fi…

Node.js Read answer
Junior PDF
What is the EventEmitter class in Node.js?

Short answer: EventEmitter is a core class that allows objects to emit named events and register listeners to respond. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the Rea…

Node.js Read answer
Junior PDF
What is NPM?

Short answer: NPM stands for Node Package Manager. It is the default package manager for Node.js and is used to install, share, and manage reusable packages or libraries. It comes pre-installed with Node.js and gives you…

Node.js Read answer
Junior PDF
What is event loop blocking, and how do you detect it?

Short answer: Blocking happens when synchronous code takes too long, preventing other events from processing. Detect with tools like: clinic.js — Event Loop Delay tool. Manual timing (setInterval to check delay). Real-wo…

Node.js Read answer
Junior PDF
What is middleware chaining in Express?

Short answer: Express allows multiple middleware functions to run sequentially for a request. Each calls next() to pass control to the next middleware. app.use((req, res, next) => { console.log('Middleware 1'); next()…

Node.js Read answer
Junior PDF
What is middleware chaining in Express?

Short answer: pp.use((req, res, next) => { console.log('Middleware 1'); next(); }); pp.use((req, res, next) => { console.log('Middleware 2'); res.send('Done'); }); pp.use((req, res, next) => { console.log('Middl…

Node.js Read answer
Junior PDF
What is the difference between dependencies and devDependencies?

Short answer: dependencies: These are required for your app to run in production. 📌 Example code express, mongoose devDependencies: Only needed during development (testing, building, linting). 📌 Example: nodemon, eslin…

Node.js Read answer
Junior PDF
What is semantic versioning?

Short answer: Semantic Versioning (semver) is a versioning system that uses the format: MAJOR.MINOR.PATCH Example: 2.5.3 MAJOR: Breaking changes MINOR: New features, no breaking changes PATCH: Bug fixes, backwards-compat…

Node.js Read answer
Junior PDF
What is the cluster module?

Short answer: The cluster module lets you fork your Node.js process to create worker processes that share the same server port, improving CPU utilization. Testing Node.js Applications Real-world example (ShopNest) A Shop…

Node.js Read answer
Junior PDF
What is input validation and why is it important?

Short answer: Ensuring incoming data matches expected format to avoid injection attacks, crashes, or invalid data storage. Real-world example (ShopNest) A ShopNest BFF in Node.js aggregates catalog and price APIs for the…

Node.js Read answer

Node.js Node.js Tutorial · Node.js

Short answer: async/await provides a cleaner syntax for handling asynchronous code, making it look synchronous and easier to read compared to nested callbacks or promise chains. async function fetchData() { try { const data = await someAsyncFunction(); console.log(data); } catch (err) { console.error(err); }

Real-world example (ShopNest)

ShopNest’s Node API handles many checkout requests concurrently because I/O (DB/HTTP) is non-blocking on the event loop.

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: synchronous operations in a single thread, constantly checking for events (e.g., incoming data, timers) and executing associated callbacks.

Explain a bit more

📌 setTimeout(() => { console.log('Executed after 2 seconds'); }, 2000); This callback is scheduled by the event loop and executed when the time is up. synchronous operations in a single thread, constantly checking for events (e.g., incoming data, timers) and executing associated callbacks. 📌

Example code

setTimeout(() => { console.log('Executed after 2 seconds'); }, 2000); This callback is scheduled by the event loop and executed when the time is up. synchronous operations in a single thread, constantly checking for events (e.g., incoming data, timers) and executing associated callbacks. 📌 Example: setTimeout(() => { console.log('Executed after 2 seconds'); }, 2000); This callback is scheduled by the event loop and executed when the time is up. synchronous operations in a single thread, constantly checking for events (e.g., incoming data, timers) and executing associated callbacks. 📌 Example: setTimeout(() => { console.log('Executed after 2 seconds'); }, 2000); This callback is scheduled by the event loop and executed when the time is up.

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: CommonJS (CJS): Uses require() and module.exports. Synchronous module loading. ES Modules: Uses import/export syntax. Supports asynchronous and static analysis. ESM is the modern standard but Node.js supports both.

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: nalysis. ESM is the modern standard but Node.js supports both.

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: dotenv is a library to load environment variables from a .env file into process.env.

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: Test coverage shows how much of your code is tested (lines, branches, functions). Tools to measure: Istanbul/nyc: Most popular coverage tool. Jest: Has built-in coverage reports. Run coverage with nyc: nyc mocha It outputs stats like: % of lines covered % of functions covered % of branches covered Security 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: nodemon is a development tool that automatically restarts your Node.js app when file changes are detected—great for faster development cycles. It’s not recommended for production. Usage: nodemon app.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: Synchronous functions block the execution until they finish. Asynchronous functions allow other code to run while waiting for operations (like I/O) to complete. // Synchronous (blocks event loop) const data = fs.readFileSync('file.txt'); // Asynchronous (non-blocking) fs.readFile('file.txt', (err, data) => { if (err) throw err; console.log(data); });

Real-world example (ShopNest)

ShopNest’s Node API handles many checkout requests concurrently because I/O (DB/HTTP) is non-blocking on the event loop.

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: CSRF (Cross-Site Request Forgery) tricks a user into submitting unwanted requests to a trusted site. Protection: Use CSRF tokens with forms (e.g., csurf middleware in Express). Implement same-site cookies. Require authentication on sensitive endpoints.

Example code

const csurf = require('csurf'); app.use(csurf());

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: util.promisify() converts traditional Node.js callback-style functions into functions that return promises — letting you use async/await with them.

Example code

const util = require('util');
const fs = require('fs');
const readFile = util.promisify(fs.readFile);
async function read() {
const content = await readFile('file.txt', 'utf8'); console.log(content); }

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: It specifies the entry point file of a package (default is index.js). When someone imports your package, Node.js loads the file in main.

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: CI/CD stands for Continuous Integration and Continuous Deployment. CI: Automatically build and test your Node.js app every time you push code (e.g., GitHub Actions, Jenkins). CD: Automatically deploy the app to production or staging after tests pass. Benefits: Catch bugs early Fast, repeatable releases Automated testing and deployment pipelines Typical pipeline steps:

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: sync function read() { const content = await readFile('file.txt', 'utf8'); console.log(content); } sync function read() { const content = await readFile('file.txt', 'utf8'); console.log(content); } sync function read() { const content = await readFile('file.txt', 'utf8'); console.log(content); } sync function read() { const content = await… readFile('file.txt', 'utf8'); console.log(content); }

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: process is a global object that provides information and control over the current Node.js process. 📌 Examples: console.log(process.pid); // Process ID console.log(process.platform); // OS platform You can also handle exit events: process.on('exit', () => { console.log('Exiting...'); });

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: Both create child processes, but: spawn() streams data (good for large outputs) exec() buffers data (good for small outputs) const { spawn, exec } = require('child_process'); // spawn example const ls = spawn('ls', ['-lh', '/usr']);

Example code

ls.stdout.on('data', (data) => console.log(`Output: ${data}`)); // exec example exec('ls -lh /usr', (error, stdout) => console.log(stdout));

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: __dirname: Returns the directory path of the current module. __filename: Returns the full file path of the current module. 📌

Example code

console.log(__dirname); // /Users/yourname/project console.log(__filename); // /Users/yourname/project/app.js These are very useful for reading or writing files relative to the script's location. PM and Module Management

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: EventEmitter is a core class that allows objects to emit named events and register listeners to respond.

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: NPM stands for Node Package Manager. It is the default package manager for Node.js and is used to install, share, and manage reusable packages or libraries. It comes pre-installed with Node.js and gives you access to a huge ecosystem of open-source tools. 📌 Example Use: npm install express This command downloads the Express.js library into your project. ✅ NPM also: Manages package versions Handles dependencies…

Explain a bit more

Supports scripts to automate tasks (npm run build, npm test, 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: Blocking happens when synchronous code takes too long, preventing other events from processing. Detect with tools like: clinic.js — Event Loop Delay tool. Manual timing (setInterval to check delay).

Real-world example (ShopNest)

ShopNest’s Node API handles many checkout requests concurrently because I/O (DB/HTTP) is non-blocking on the event loop.

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 allows multiple middleware functions to run sequentially for a request. Each calls next() to pass control to the next middleware. app.use((req, res, next) => { console.log('Middleware 1'); next(); }); app.use((req, res, next) => { console.log('Middleware 2'); res.send('Done'); });

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.use((req, res, next) => { console.log('Middleware 1'); next(); }); pp.use((req, res, next) => { console.log('Middleware 2'); res.send('Done'); }); pp.use((req, res, next) => { console.log('Middleware 1'); next(); }); pp.use((req, res, next) => { console.log('Middleware 2'); res.send('Done'); }); pp.use((req, res, next) => { console.log('Middleware 1');… next(); }); pp.use((req, res, next) => {…

Explain a bit more

console.log('Middleware 2'); res.send('Done'); }); pp.use((req, res, next) => { console.log('Middleware 1'); next(); }); pp.use((req, res, next) => { console.log('Middleware 2'); res.send('Done'); });

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: dependencies: These are required for your app to run in production. 📌

Example code

express, mongoose devDependencies: Only needed during development (testing, building, linting). 📌 Example: nodemon, eslint, jest 📦 These are defined in package.json: "dependencies": { "express": "^4.18.0" }, "devDependencies": { "nodemon": "^3.0.0" } ✅ Install a dev dependency with: npm install nodemon --save-dev

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: Semantic Versioning (semver) is a versioning system that uses the format: MAJOR.MINOR.PATCH Example: 2.5.3 MAJOR: Breaking changes MINOR: New features, no breaking changes PATCH: Bug fixes, backwards-compatible 📌 Example: If a package moves from 1.2.0 to 2.0.0, it likely has breaking changes. In package.json, you might see: "express": "^4.17.1" ^ means it can auto-update minor and patch versions, but not major ones.

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: The cluster module lets you fork your Node.js process to create worker processes that share the same server port, improving CPU utilization. Testing Node.js Applications

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: Ensuring incoming data matches expected format to avoid injection attacks, crashes, or invalid data storage.

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