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 1801–1825 of 3281

Career & HR topics

By tech stack

Popular tracks

Mid PDF
How do you create responsive tables?

Short answer: Wrap the table in .table-responsive: <div class="table-responsive"> <table class="table">...</table> </div> Real-world example (ShopNest) ShopNest’s browser cart…

JavaScript Read answer
Mid PDF
What are object methods?

Short answer: Functions defined inside objects are called methods. Example code let person = { name: "Sandeep", greet() { console.log(`Hello, ${this.name}`); } }; person.greet(); // Hello, Sandeep Real-world ex…

JavaScript Read answer
Mid PDF
How can you reduce Bootstrap bundle size?

Short answer: Import only needed components via SCSS. Use tools like PurgeCSS to remove unused classes. Use custom builds from Bootstrap’s build system. Real-world example (ShopNest) ShopNest’s browser cart uses modern J…

JavaScript Read answer
Mid PDF
How does this behave in different contexts?

Short answer: rrow: () => console.log(this.name), // undefined in global regular() { console.log(this.name); } // Sandeep }; obj.regular(); obj.arrow(); rrow: () => console.log(this.name), // undefined in global re…

JavaScript Read answer
Mid PDF
How can you integrate Bootstrap with custom CSS frameworks?

Short answer: Load Bootstrap first, then your custom CSS to override styles. Use namespacing or BEM methodology to prevent conflicts. Combine selectively via SCSS imports. Follow me on LinkedIn: Real-world example (ShopN…

JavaScript Read answer
Mid PDF
How does this behave in different contexts?

Short answer: Global function: this = window (browser) Object method: this = the object Arrow function: this = lexical context (inherits from parent scope) Example code const obj = { name: "Sandeep", arrow: ()…

JavaScript Read answer
Mid PDF
What are arrays in JavaScript?

Short answer: Arrays are ordered collections of values. Example: let numbers = [1, 2, 3, 4]; Example code Arrays are ordered collections of values. Example: let numbers = [1, 2, 3, 4]; Real-world example (ShopNest) ShopN…

JavaScript Read answer
Mid PDF
How do you iterate over arrays?

Short answer: for loop for...of forEach Example: numbers.forEach(n => console.log(n)); Example code for loop for...of forEach Example: numbers.forEach(n => console.log(n)); Real-world example (ShopNest) ShopNest’s…

JavaScript Read answer
Mid PDF
How does inheritance work in JavaScript?

Short answer: Objects inherit from other objects via Object.create(), constructor functions, or classes (ES6). Methods can be shared via prototypes. Example using constructor: function Person(name) { this.name = name; }…

JavaScript Read answer
Mid PDF
What are classes in JavaScript?

Short answer: Classes are blueprints for creating objects. They provide syntactic sugar over the traditional prototype-based inheritance. Example: class Person { constructor(name, age) { this.name = name; Example code th…

JavaScript Read answer
Mid PDF
How does inheritance work with classes?

Short answer: Classes support extends to create a subclass that inherits properties and methods from a parent class. Example: class Animal { speak() { console.log("Animal speaks"); } } class Dog extends Animal…

JavaScript Read answer
Mid PDF
What are static methods?

Short answer: Static methods are called on the class itself, not on instances. Example code class MathUtils { static square(x) { return x * x; } } console.log(MathUtils.square(5)); // 25 Real-world example (ShopNest) Sho…

JavaScript Read answer
Mid PDF
Can you use getters and setters in classes?

Short answer: Yes, getters and setters control access to object properties. Example: class Person { Example code constructor(name) { this._name = name; } get name() { return this._name; } set name(value) { this._name = v…

JavaScript Read answer
Mid PDF
What are callbacks?

Short answer: Functions passed as arguments to run after another function completes. Example: setTimeout(() => console.log("Hello after 1s"), 1000); Example code Functions passed as arguments to run after an…

JavaScript Read answer
Mid PDF
States of a Promise:?

Short answer: pending fulfilled rejected Real-world example (ShopNest) The checkout button uses async/await to call /api/orders , shows a spinner, and catches network errors with a toast. Say this in the interview Define…

JavaScript Read answer
Mid PDF
How do you chain Promises?

Short answer: fetch('/api/data') .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error(err)); Example code fetch('/api/data') .then(res => res.json()) .then(data => console.…

JavaScript Read answer
Mid PDF
Difference between Promise.all and Promise.race:?

Short answer: Promise.all – waits for all promises to resolve Promise.race – resolves/rejects as soon as one completes Real-world example (ShopNest) The checkout button uses async/await to call /api/orders , shows a spin…

JavaScript Read answer
Mid PDF
Call stack vs Microtask queue vs Macrotask queue:?

Short answer: Call stack: executes synchronous code Microtask queue: handles Promises Macrotask queue: handles setTimeout, I/O, etc. Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch API…

JavaScript Read answer
Mid PDF
How do you handle events?

Short answer: button.addEventListener('click', () => console.log('Clicked!')); button.addEventListener('click', () => console.log('Clicked!')); button.addEventListener('click', () => console.log('Clicked!')); bu…

JavaScript Read answer
Mid PDF
What are preventDefault() and stopPropagation()?

Short answer: preventDefault() – stops default browser action stopPropagation() – stops event bubbling Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, a…

JavaScript Read answer
Mid PDF
How do you create a custom error?

Short answer: class ValidationError extends Error { } throw new ValidationError("Invalid input"); Example code class ValidationError extends Error { } throw new ValidationError("Invalid input"); Real-…

JavaScript Read answer
Mid PDF
Types of errors in JavaScript:?

Short answer: ReferenceError, TypeError, SyntaxError, RangeError, EvalError, URIError Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error ha…

JavaScript Read answer
Mid PDF
Template literals: String interpolation using backticks?

Short answer: Template literals: String interpolation using backticks? is a common interview topic in JavaScript. Give a clear definition, then one concrete example. Real-world example (ShopNest) ShopNest’s browser cart…

JavaScript Read answer
Mid PDF
Destructuring assignment:?

Short answer: const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}…

JavaScript Read answer
Mid PDF
Spread / Rest operator:?

Short answer: let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let ar…

JavaScript Read answer

JavaScript JavaScript Tutorial · JavaScript

Short answer: Wrap the table in .table-responsive: <div class="table-responsive"> <table class="table">...</table> </div>

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Functions defined inside objects are called methods.

Example code

let person = { name: "Sandeep", greet() { console.log(`Hello, ${this.name}`); } }; person.greet(); // Hello, Sandeep

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Import only needed components via SCSS. Use tools like PurgeCSS to remove unused classes. Use custom builds from Bootstrap’s build system.

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: rrow: () => console.log(this.name), // undefined in global regular() { console.log(this.name); } // Sandeep }; obj.regular(); obj.arrow(); rrow: () => console.log(this.name), // undefined in global regular() { console.log(this.name); } // Sandeep }; obj.regular(); obj.arrow(); rrow: () => console.log(this.name), // undefined in global regular() {… console.log(this.name); } // Sandeep }; obj.regular(); obj.arrow();…

Explain a bit more

rrow: () => console.log(this.name), // undefined in global regular() { console.log(this.name); } // Sandeep }; obj.regular(); obj.arrow();

Real-world example (ShopNest)

Prefer arrow functions for React/event callbacks in ShopNest so this is not accidentally rebound.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Load Bootstrap first, then your custom CSS to override styles. Use namespacing or BEM methodology to prevent conflicts. Combine selectively via SCSS imports. Follow me on LinkedIn:

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Global function: this = window (browser) Object method: this = the object Arrow function: this = lexical context (inherits from parent scope)

Example code

const obj = { name: "Sandeep", arrow: () => console.log(this.name), // undefined in global regular() { console.log(this.name); } // Sandeep }; obj.regular(); obj.arrow();

Real-world example (ShopNest)

Prefer arrow functions for React/event callbacks in ShopNest so this is not accidentally rebound.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Arrays are ordered collections of values. Example: let numbers = [1, 2, 3, 4];

Example code

Arrays are ordered collections of values. Example: let numbers = [1, 2, 3, 4];

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: for loop for...of forEach Example: numbers.forEach(n => console.log(n));

Example code

for loop for...of forEach Example: numbers.forEach(n => console.log(n));

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Objects inherit from other objects via Object.create(), constructor functions, or classes (ES6). Methods can be shared via prototypes. Example using constructor: function Person(name) { this.name = name; } Person.prototype.greet = function() { console.log(`Hello ${this.name}`); }; const p = new Person("Sandeep"); p.greet(); // Hello Sandeep

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Classes are blueprints for creating objects. They provide syntactic sugar over the traditional prototype-based inheritance. Example: class Person { constructor(name, age) { this.name = name;

Example code

this.age = age;
}
}
const sandeep = new Person("Sandeep", 30); console.log(sandeep.name); // Sandeep

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Classes support extends to create a subclass that inherits properties and methods from a parent class. Example: class Animal { speak() { console.log("Animal speaks"); } } class Dog extends Animal { speak() { console.log("Dog barks"); } } const dog = new Dog(); dog.speak(); // Dog barks

Example code

Classes support extends to create a subclass that inherits properties and methods from a parent class. Example: class Animal { speak() { console.log("Animal speaks"); } }
class Dog extends Animal { speak() { console.log("Dog barks"); } }
const dog = new Dog(); dog.speak(); // Dog barks

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Static methods are called on the class itself, not on instances.

Example code

class MathUtils { static square(x) { return x * x; } } console.log(MathUtils.square(5)); // 25

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Yes, getters and setters control access to object properties. Example: class Person {

Example code

constructor(name) { this._name = name; } get name() { return this._name; } set name(value) { this._name = value; }
}
const p = new Person("Sandeep"); console.log(p.name); // Sandeep p.name = "Ravi"; console.log(p.name); // Ravi

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Functions passed as arguments to run after another function completes. Example: setTimeout(() => console.log("Hello after 1s"), 1000);

Example code

Functions passed as arguments to run after another function completes. Example: setTimeout(() => console.log("Hello after 1s"), 1000);

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: pending fulfilled rejected

Real-world example (ShopNest)

The checkout button uses async/await to call /api/orders, shows a spinner, and catches network errors with a toast.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: fetch('/api/data') .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error(err));

Example code

fetch('/api/data') .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error(err));

Real-world example (ShopNest)

The checkout button uses async/await to call /api/orders, shows a spinner, and catches network errors with a toast.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Promise.all – waits for all promises to resolve Promise.race – resolves/rejects as soon as one completes

Real-world example (ShopNest)

The checkout button uses async/await to call /api/orders, shows a spinner, and catches network errors with a toast.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Call stack: executes synchronous code Microtask queue: handles Promises Macrotask queue: handles setTimeout, I/O, etc.

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: button.addEventListener('click', () => console.log('Clicked!')); button.addEventListener('click', () => console.log('Clicked!')); button.addEventListener('click', () => console.log('Clicked!')); button.addEventListener('click', () => console.log('Clicked!'));

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: preventDefault() – stops default browser action stopPropagation() – stops event bubbling

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: class ValidationError extends Error { } throw new ValidationError("Invalid input");

Example code

class ValidationError extends Error { } throw new ValidationError("Invalid input");

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: ReferenceError, TypeError, SyntaxError, RangeError, EvalError, URIError

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: Template literals: String interpolation using backticks? is a common interview topic in JavaScript. Give a clear definition, then one concrete example.

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20};

Example code

const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20}; const [a,b]=[1,2]; const {x,y}={x:10,y:20};

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){}

Example code

let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){} let arr2 = [...arr1,4,5]; function sum(...nums){}

Real-world example (ShopNest)

ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.

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