Interview Q&A

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

4616 total questions 4516 technical 100 career & HR 4346 from PDF library

Showing 251–275 of 289

Career & HR topics

By tech stack

Junior PDF
What is the spread operator?

Answer: Used to expand arrays or objects into individual elements. Example: const arr = [1, 2, 3]; const newArr = [...arr, 4, 5]; // [1, 2, 3, 4, 5] What interviewers expect A clear definition tied to JavaScript in JavaS…

JavaScript Read answer
Junior PDF
What is prototypal inheritance?

JavaScript objects inherit properties and methods from other objects through prototypes. This allows reuse of methods and shared behavior. Example: const parent = { greet() { console.log("Hello"); } }; const child = Obje…

JavaScript Read answer
Junior PDF
What is the prototype chain?

The prototype chain is the chain of objects that JavaScript follows to look up properties or methods. If a property isn’t found on the object itself, JS checks the object's prototype, and continues up the chain. Example:…

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

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.prototy…

JavaScript Read answer
Junior PDF
What is Object.create()?

Answer: Creates a new object with the specified prototype object. Example: const parent = { greet() { console.log("Hello"); } }; const child = Object.create(parent); child.greet(); // Hello What interviewers expect A cle…

JavaScript Read answer
Junior PDF
What is the difference between __proto__ and prototype? Property Description prototy pe

property of functions, used when creating objects with new. __proto __ property of objects, points to the object’s prototype (used in the prototype chain). Example: function Person() {} console.log(Person.prototype); //…

JavaScript Read answer
Junior PDF
What is the difference between __proto__ and prototype?

Property Description prototy A property of functions, used when creating objects with new. __proto A property of objects, points to the object’s prototype (used in the prototype chain). Example: function Person() {} cons…

JavaScript Read answer
Mid PDF
What are classes in JavaScript?

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; this.age = age; } } const san…

JavaScript Read answer
Junior PDF
What is the constructor method?

Answer: The constructor is a special method for initializing new objects created from a class. Example: class Car { constructor(brand, model) { this.brand = brand; this.model = model; } } What interviewers expect A clear…

JavaScript Read answer
Junior PDF
What is the difference between class and function constructor?

Answer: Feature Function Constructor Class Syntax function Person(){} class Person{} Hoisting Yes, function declarations are hoisted No, classes are not hoisted new required Recommended Required What interviewers expect…

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

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

JavaScript Read answer
Junior PDF
What is super()?

super() calls the parent class constructor. Must be called before using this in subclass. Example: class Animal { constructor(name) { this.name = name; } } class Dog extends Animal { constructor(name, breed) { super(name…

JavaScript Read answer
Mid PDF
What are static methods?

Answer: Static methods are called on the class itself, not on instances. Example: class MathUtils { static square(x) { return x * x; } } console.log(MathUtils.square(5)); // 25 What interviewers expect A clear definition…

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

Yes, getters and setters control access to object properties. Example: class Person { constructor(name) { this._name = name; } get name() { return this._name; } set name(value) { this._name = value; } } const p = new Per…

JavaScript Read answer
Junior PDF
What is asynchronous programming?

Answer: llows non-blocking execution, letting other code run while waiting for tasks (e.g., network requests). What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance…

JavaScript Read answer
Mid PDF
What are callbacks?

A callback is a function passed as an argument to another function to be executed after some operation completes. Example: function fetchData(callback) { setTimeout(() => { callback("Data received!"); }, 1000); Follow…

JavaScript Read answer
Junior PDF
What is callback hell?

Answer: Nested callbacks causing hard-to-read code. Solution: Use Promises or async/await. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, s…

JavaScript Read answer
Junior PDF
What is a Promise?

n object representing future completion or failure of an async task. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, security, cost) When yo…

JavaScript Read answer
Mid PDF
States of a Promise:?

pending fulfilled rejected What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, security, cost) When you would and would not use it in production…

JavaScript Read answer
Mid PDF
How do you chain Promises?

Answer: fetch('/api/data') .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error(err)); What interviewers expect A clear definition tied to JavaScript in JavaScript pr…

JavaScript Read answer
Junior PDF
What is async / await? Syntactic sugar over Promises for cleaner asynchronous code.

Answer: sync function fetchData() { try { const res = await fetch('/api/data'); const data = await res.json(); console.log(data); } catch (err) { console.error(err); } } What interviewers expect A clear definition tied t…

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

Answer: Promise.all – waits for all promises to resolve Promise.race – resolves/rejects as soon as one completes What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performan…

JavaScript Read answer
Junior PDF
What is an event loop?

Answer: Mechanism that manages async callbacks and executes them after the call stack is empty. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainabili…

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

Answer: Call stack: executes synchronous code Microtask queue: handles Promises Macrotask queue: handles setTimeout, I/O, etc. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-o…

JavaScript Read answer
Junior PDF
What is an event in JavaScript?

n action like click, load, input, keypress. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, security, cost) When you would and would not use…

JavaScript Read answer

JavaScript JavaScript Tutorial · JavaScript

Answer: Used to expand arrays or objects into individual elements. Example: const arr = [1, 2, 3]; const newArr = [...arr, 4, 5]; // [1, 2, 3, 4, 5]

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

JavaScript objects inherit properties and methods from other objects through

prototypes. This allows reuse of methods and shared behavior.

Example:

const parent = { greet() { console.log("Hello"); } };
const child = Object.create(parent);

child.greet(); // Hello

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

The prototype chain is the chain of objects that JavaScript follows to look up properties

or methods.

  • If a property isn’t found on the object itself, JS checks the object's prototype, and

continues up the chain.

Example:

console.log(child.toString()); // from Object.prototype

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

  • 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

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Creates a new object with the specified prototype object. Example: const parent = { greet() { console.log("Hello"); } }; const child = Object.create(parent); child.greet(); // Hello

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

property of functions, used when creating objects with new.

__proto

__

property of objects, points to the object’s prototype (used in the prototype

chain).

Example:

function Person() {}

console.log(Person.prototype); // prototype object

const p = new Person();

console.log(p.__proto__); // same as Person.prototype

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Property Description

prototy

A property of functions, used when creating objects with new.

__proto

A property of objects, points to the object’s prototype (used in the prototype

chain).

Example:

function Person() {}

console.log(Person.prototype); // prototype object

const p = new Person();

console.log(p.__proto__); // same as Person.prototype

🔹 6. Classes (ES6+) – Q&A

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

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;
this.age = age;
}
}
const sandeep = new Person("Sandeep", 30);

console.log(sandeep.name); // Sandeep

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: The constructor is a special method for initializing new objects created from a class. Example: class Car { constructor(brand, model) { this.brand = brand; this.model = model; } }

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Feature Function Constructor Class Syntax function Person(){} class Person{} Hoisting Yes, function declarations are hoisted No, classes are not hoisted new required Recommended Required

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

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

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

super() calls the parent class constructor. Must be called before using this in

subclass.

Example:

class Animal {
constructor(name) { this.name = name; }
}
class Dog extends Animal {

constructor(name, breed) {

super(name);

this.breed = breed;
}
}
Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Static methods are called on the class itself, not on instances. Example: class MathUtils { static square(x) { return x * x; } } console.log(MathUtils.square(5)); // 25

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Yes, getters and setters control access to object properties.

Example:

class Person {
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

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: llows non-blocking execution, letting other code run while waiting for tasks (e.g., network requests).

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

A callback is a function passed as an argument to another function to be executed after

some operation completes.

Example:

function fetchData(callback) {

setTimeout(() => {

callback("Data received!");

}, 1000);

Follow me on LinkedIn:

}

fetchData(console.log);

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Nested callbacks causing hard-to-read code. Solution: Use Promises or async/await.

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

n object representing future completion or failure of an async task.

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

pending fulfilled rejected

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

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

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: sync function fetchData() { try { const res = await fetch('/api/data'); const data = await res.json(); console.log(data); } catch (err) { console.error(err); } }

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

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

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Mechanism that manages async callbacks and executes them after the call stack is empty.

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

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

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

n action like click, load, input, keypress.

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

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