Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Answer: A safe way to access nested properties without throwing an error if something is undefined or null. Example: console.log(user?.address?.city); What interviewers expect A clear definition tied to JavaScript in Jav…
Both execute dynamic code, but: eval() executes in the current scope (less safe). Function() executes in a new scope (safer). Example: eval("var a = 5"); const b = new Function("return 5;"); ⚠ Both are discouraged due to…
Lexical scoping means that the scope of a variable is determined by its position in the source code. Inner functions have access to variables declared in their outer scope. Example: function outer() { let name = "Sandeep…
Answer: Reboot is a modernized CSS reset that standardizes browser styles for consistent rendering. Follow me on LinkedIn: What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs…
Answer: n object is a collection of key-value pairs used to store related data and functions. Example: let person = { name: "Sandeep", age: 30 }; What interviewers expect A clear definition tied to JavaScript in JavaScri…
this refers to the context in which a function is called. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, security, cost) When you would and…
Answer: Extract values from objects into variables. Example: const person = { name: "Sandeep", age: 30 }; const { name, age } = person; console.log(name, age); // Sandeep 30 What interviewers expect A clear definition ti…
Answer: Extract elements from arrays into variables. Example: let [first, second] = [10, 20]; console.log(first, second); // 10 20 What interviewers expect A clear definition tied to JavaScript in JavaScript projects Tra…
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 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…
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:…
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…
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); //…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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…
When an event occurs in a nested element: Bubbling: Event moves upward (child → parent). Capturing: Event moves downward (parent → child). Example: element.addEventListener('click', handler, true); // capturing element.a…
ttach a listener to a parent to handle events on child elements. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, security, cost) When you wo…
JavaScript JavaScript Tutorial · JavaScript
Answer: A safe way to access nested properties without throwing an error if something is undefined or null. Example: console.log(user?.address?.city);
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Both execute dynamic code, but:
Example:
eval("var a = 5");
const b = new Function("return 5;");
⚠ Both are discouraged due to security and performance issues.
Bootstrap Interview Questions
JavaScript JavaScript Tutorial · JavaScript
Lexical scoping means that the scope of a variable is determined by its position in the
source code. Inner functions have access to variables declared in their outer scope.
Example:
function outer() {
let name = "Sandeep";
function inner() {
console.log(name); // accesses outer variable
}
inner();
}
outer(); // Sandeep
JavaScript JavaScript Tutorial · JavaScript
Answer: Reboot is a modernized CSS reset that standardizes browser styles for consistent rendering. Follow me on LinkedIn:
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: n object is a collection of key-value pairs used to store related data and functions. Example: let person = { name: "Sandeep", age: 30 };
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
this refers to the context in which a function is called.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Extract values from objects into variables. Example: const person = { name: "Sandeep", age: 30 }; const { name, age } = person; console.log(name, age); // Sandeep 30
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Extract elements from arrays into variables. Example: let [first, second] = [10, 20]; console.log(first, second); // 10 20
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
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]
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
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
JavaScript JavaScript Tutorial · JavaScript
The prototype chain is the chain of objects that JavaScript follows to look up properties
or methods.
continues up the chain.
Example:
console.log(child.toString()); // from Object.prototype
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
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
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
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
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; } }
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
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
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
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;
}
}JavaScript JavaScript Tutorial · JavaScript
Answer: llows non-blocking execution, letting other code run while waiting for tasks (e.g., network requests).
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Nested callbacks causing hard-to-read code. Solution: Use Promises or async/await.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
n object representing future completion or failure of an async task.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
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); } }
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Mechanism that manages async callbacks and executes them after the call stack is empty.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
n action like click, load, input, keypress.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
When an event occurs in a nested element:
Example:
element.addEventListener('click', handler, true); // capturing
element.addEventListener('click', handler, false); // bubbling
JavaScript JavaScript Tutorial · JavaScript
ttach a listener to a parent to handle events on child elements.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.