PREP
⚑ Interview Prep Center305+ Curated Questions

Interview Q&A Hub

Sharpen your SDET credentials with expert-level questions covering theory, syntax mechanics, and advanced Playwright automation scenarios.

Overall Progress
0/ 305 done
Completed0%
Language Foundations
JS & TS Mechanics
⚑ JavaScript0/ 80
πŸ”· TypeScript0/ 60
Playwright Automation
Core & Advanced E2E
🎭 PW Core0/ 80
πŸ”§ PW Advanced0/ 85
Diff:
Type:
1Basic⌨ Coding

What is the difference between var, let, and const?

In JavaScript, variables can be declared using var, let, or const. The differences lie in scoping, hoisting, and re-assignment:

  • β€ΊScope: var is function-scoped. If defined inside a function, it is only available inside that function. let and const are block-scoped, meaning they are only accessible within the nearest curly braces {} (e.g., if-statements, loops).
  • β€ΊHoisting: var variables are hoisted and initialized as undefined. let and const variables are hoisted but NOT initialized; they reside in a "Temporal Dead Zone" (TDZ) until execution reaches their declaration.
  • β€ΊRe-assignment: var and let allow re-assignment. const does not; it creates a read-only reference, though properties of const objects/arrays can still be modified.
Code Snippet
12345678910
function scopeExample() {
if (true) {
var x = class="hl-number">10;
let y = class="hl-number">20;
const z = class="hl-number">30;
}
console.log(x); // 10 (function scoped)
// console.log(y); // ReferenceError: y is not defined
// console.log(z); // ReferenceError: z is not defined
}
Interviewer Pro-Tip

Mention "Temporal Dead Zone (TDZ)" and explain that block scope prevents accidental variables leak, which is a major benefit of let/const.

2Basic⌨ Coding

What is hoisting in JavaScript?

Hoisting is JavaScript's default behavior of moving declarations to the top of the current scope before execution.

  • β€ΊFunction declarations are fully hoisted, allowing them to be called before declaration.
  • β€Ίvar variables are hoisted and initialized to undefined.
  • β€Ίlet and const variables are hoisted but remain uninitialized (in the TDZ).
  • β€ΊFunction expressions and arrow functions are hoisted as variables, not as functions, meaning they cannot be invoked before their declaration.
Code Snippet
12345
console.log(myVar); // undefined
var myVar = class="hl-number">5;
 
sayHello(); // "Hello"
function sayHello() { console.log("Hello"); }
Interviewer Pro-Tip

Explain that hoisting happens during the compilation phase, when the JavaScript engine sets up memory space for variables and functions.

3Basic⌨ Coding

Explain closures in JavaScript and how they work.

A closure is the combination of a function bundled together with references to its surrounding state (the lexical environment). In other words, a closure gives an inner function access to the outer function's variables even after the outer function has returned.

Code Snippet
12345678910
function createCounter() {
let count = class="hl-number">0;
return function() {
count++;
return count;
};
}
const counter = createCounter();
console.log(counter()); // 1
console.log(counter()); // 2
Interviewer Pro-Tip

Closures are widely used in test automation for capturing states or configuration defaults dynamically.

4Basic⌨ Coding

What is the difference between == and ===?

The difference lies in type coercion:

  • β€ΊLoose Equality (==) compares values after converting them to a common type (implicit coercion). E.g., 5 == "5" is true.
  • β€ΊStrict Equality (===) compares both the values and their types. No conversion takes place. E.g., 5 === "5" is false.
Code Snippet
1234
console.log(class="hl-number">0 == false); // true
console.log(class="hl-number">0 === false); // false
console.log(null == undefined); // true
console.log(null === undefined); // false
Interviewer Pro-Tip

Always use === to avoid bugs caused by unexpected type coercion. Mention that Object.is() can be used for checking NaN === NaN (which is false in standard JS).

5Basic⌨ Coding

Explain the difference between null and undefined in JavaScript.

undefined means a variable has been declared but has not yet been assigned a value. null is an assignment value that represents the intentional absence of any object value. typeof undefined returns "undefined", while typeof null returns "object".

Code Snippet
1234
let a;
console.log(a); // undefined
let b = null;
console.log(b); // null
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

6Basic⌨ Coding

What is implicit type coercion in JavaScript?

Implicit type coercion is the automatic conversion of values from one data type to another (such as strings to numbers). It happens when operators are applied to variables of different types.

Code Snippet
12
console.log("5" - class="hl-number">3); // 2 (string coerced to number)
console.log("5" + class="hl-number">3); // "53" (number coerced to string)
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

7Intermediate⌨ Coding

Explain the Event Loop in JavaScript.

The Event Loop is a mechanism that allows JavaScript to perform non-blocking I/O operations despite being single-threaded. It constantly monitors the Call Stack and the Callback/Task Queue. When the Call Stack is empty, it pushes the first task from the queue to the stack for execution.

Code Snippet
1234
console.log("Start");
setTimeout(() => console.log("Timeout"), class="hl-number">0);
console.log("End");
// Prints: Start, End, Timeout
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

8Intermediate⌨ Coding

What is the difference between Microtask Queue and Macrotask Queue?

The Microtask Queue (handles Promises, process.nextTick, queueMicrotask) has higher priority than the Macrotask Queue (handles setTimeout, setInterval, I/O). The Event Loop will clear all tasks in the Microtask Queue before moving to the next Macrotask.

Code Snippet
123
Promise.resolve().then(() => console.log("Micro"));
setTimeout(() => console.log("Macro"), class="hl-number">0);
// "Micro" runs before "Macro"
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

9Intermediate⌨ Coding

What is the "this" keyword in JavaScript?

  • β€ΊThe this keyword refers to the object that is executing the current function. Its value depends on how the function is called:
  • β€ΊGlobal Context: window (or global in Node).
  • β€ΊObject Method: The object itself.
  • β€ΊConstructor: The newly created instance.
  • β€ΊArrow Functions: Inherited lexically from the parent scope.
Code Snippet
12345
const obj = {
name: "Alice",
greet() { console.log(this.name); }
};
obj.greet(); // "Alice"
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

10Intermediate⌨ Coding

What is the difference between call(), apply(), and bind()?

  • β€ΊThese methods set the this context of a function:
  • β€Ίcall() invokes the function immediately with individual arguments.
  • β€Ίapply() invokes the function immediately with arguments as an array.
  • β€Ίbind() returns a new function with this bound, which can be executed later.
Code Snippet
12345
function greet(a, b) {
return `${this.name} says ${a} and ${b}`;
}
const person = { name: "Bob" };
console.log(greet.call(person, "hi", "bye"));
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

11Basic⌨ Coding

What are arrow functions and how do they differ from regular functions?

  • β€ΊArrow functions have shorter syntax. Major differences include:
  • β€ΊLexical this: They do not have their own this binding, but inherit it from the outer lexical scope.
  • β€ΊNo arguments object.
  • β€ΊCannot be used as constructors (cannot be called with new).
  • β€ΊCannot use yield (cannot be generators).
Code Snippet
12
const add = (a, b) => a + b;
console.log(add(class="hl-number">2, class="hl-number">3)); // 5
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

12Basic⌨ Coding

What is a Promise in JavaScript? Name its three states.

  • β€ΊA Promise is an object representing the eventual completion or failure of an asynchronous operation. Its states are:
  • β€ΊPending: Initial state, neither fulfilled nor rejected.
  • β€ΊFulfilled: Operation completed successfully.
  • β€ΊRejected: Operation failed with an error.
Code Snippet
1
const p = new Promise((resolve) => resolve("done"));
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

13Intermediate⌨ Coding

Explain Promise.all() vs Promise.allSettled().

Promise.all() rejects immediately if any promise in the input array rejects. Promise.allSettled() waits for all promises to complete (either fulfill or reject) and returns an array of objects describing the outcome of each.

Code Snippet
12
Promise.allSettled([Promise.resolve(class="hl-number">1), Promise.reject("err")])
.then(results => console.log(results));
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

14IntermediateπŸ“– Theory

What is Promise.race() vs Promise.any()?

Promise.race() settles (resolves or rejects) as soon as the first promise in the array settles. Promise.any() resolves as soon as the first promise resolves successfully; it rejects only if all promises reject.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

15Basic⌨ Coding

What is async/await and how does it handle errors?

async/await is a syntactic wrapper around Promises that makes asynchronous code look synchronous. It handles errors using standard try...catch blocks, making debugging and stack traces cleaner.

Code Snippet
1234567
async function run() {
try {
const data = await Promise.resolve("OK");
} catch (err) {
console.error(err);
}
}
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

16Advanced⌨ Coding

What is prototype pollution in JavaScript?

Prototype pollution is a vulnerability where an attacker manipulates the base prototype (Object.prototype) of JavaScript objects, injecting properties that affect all objects. This often happens due to insecure recursive object merges.

Code Snippet
1234
const malicious = JSON.parse('{__STASH_0__: {__STASH_1__: true}}');
const target = {};
Object.assign(target, malicious);
console.log({}.isAdmin); // true (Polluted!)
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

17Intermediate⌨ Coding

Explain shallow copy vs deep copy in JavaScript.

A shallow copy copies top-level properties. Nested objects still share the same reference. A deep copy recursively copies all levels, creating entirely new objects. Shallow copy: Object.assign() or spread .... Deep copy: JSON.parse(JSON.stringify()) or structuredClone().

Code Snippet
123
const original = { a: class="hl-number">1, b: { c: class="hl-number">2 } };
const shallow = { ...original };
const deep = structuredClone(original);
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

18Basic⌨ Coding

What is the purpose of the "use strict" directive?

Strict Mode makes JavaScript code run under a stricter set of rules. It prevents accidental global variables, makes silent errors throw exceptions, disables syntax that will be defined in future versions, and forbids deleting functions/variables.

Code Snippet
12
"use strict";
x = class="hl-number">5; // ReferenceError: x is not defined
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

19AdvancedπŸ“– Theory

What is a closure memory leak and how do you prevent it?

A closure memory leak occurs when a nested function retains references to outer variables that are no longer needed, preventing the Garbage Collector from cleaning them up. Prevent it by nullifying references when they are no longer needed.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

20AdvancedπŸ“– Theory

Explain JavaScript Garbage Collection and the Mark-and-Sweep algorithm.

Garbage Collection is automatic memory management. The Mark-and-Sweep algorithm starting from the global/root context "marks" all reachable objects. Any objects in memory that are not reachable ("swept") are marked as garbage and their memory is reclaimed.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

21IntermediateπŸ“– Theory

What is the difference between debounce and throttle?

Debounce postpones execution until a specified quiet time has passed since the last trigger. Throttle ensures the function runs at most once in a specified time interval, restricting execution rate.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

22BasicπŸ“– Theory

Explain truthy and falsy values. What are the falsy values in JS?

A falsy value is a value that translates to false when evaluated in a boolean context. The only falsy values in JS are: false, 0, -0, 0n (BigInt zero), "" (empty string), null, undefined, and NaN. Everything else is truthy.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

23IntermediateπŸ“– Theory

What is the temporal dead zone (TDZ)?

The TDZ is the period between entering a scope and the actual line of code where a let or const variable is declared. Accessing the variable in this zone throws a ReferenceError.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

24IntermediateπŸ“– Theory

What is Event Bubbling vs Event Capturing?

Event Bubbling triggers the event handler on the target element first, then bubbles up the DOM tree to parent nodes. Event Capturing (or trickling) goes down the DOM tree from the root/window to the target element. You can stop propagation using event.stopPropagation().

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

25IntermediateπŸ“– Theory

What is Event Delegation and why is it useful in automation testing?

Event delegation is a design pattern where you attach a single event listener to a parent element rather than individual child elements. In automation, it is crucial to understand since dynamic child elements can be clicked without re-binding event listeners.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

26Basic⌨ Coding

Explain the difference between Array.slice() and Array.splice().

slice() returns a shallow copy of a portion of an array into a new array object. It does NOT modify the original array. splice() changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.

Code Snippet
123
const arr = [class="hl-number">1, class="hl-number">2, class="hl-number">3];
const sliced = arr.slice(class="hl-number">0, class="hl-number">2); // [1, 2], arr is still [1, 2, 3]
const spliced = arr.splice(class="hl-number">0, class="hl-number">1); // [1], arr is now [2, 3]
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

27AdvancedπŸ“– Theory

What is the difference between Map and WeakMap?

  • β€ΊKeys: Map keys can be any type; WeakMap keys MUST be objects.
  • β€ΊGarbage Collection: WeakMap holds weak references to its keys, meaning keys are garbage collected if no other references exist.
  • β€ΊIteration: Map is iterable and has a size property; WeakMap is not iterable and has no size property.
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

28AdvancedπŸ“– Theory

What is the difference between Set and WeakSet?

Like Map/WeakMap, WeakSet only stores objects as values, holds weak references to those objects, and is not iterable, unlike Set which holds strong references and can store any type.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

29Intermediate⌨ Coding

What are JS generator functions and how do they work?

Generators are functions that can be exited and later re-entered. Their context (variable bindings) is saved across re-entrances. They are declared with function* and return an iterator. They yield values using the yield keyword.

Code Snippet
123456
function* gen() {
yield class="hl-number">1;
yield class="hl-number">2;
}
const g = gen();
console.log(g.next().value); // 1
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

30Basic⌨ Coding

What is destructuring assignment in ES6?

Destructuring assignment is syntax that unpacks values from arrays, or properties from objects, into distinct variables.

Code Snippet
12
const person = { name: "Bob", age: class="hl-number">25 };
const { name, age } = person;
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

31Basic⌨ Coding

Explain the rest and spread operators (...) and their differences.

The spread operator expands an array or object into individual elements. The rest operator collects multiple elements into a single array.

Code Snippet
123
const arr = [class="hl-number">1, class="hl-number">2];
const newArr = [...arr, class="hl-number">3]; // Spread
function sum(...args) { return args.reduce((a,b)=>a+b); } // Rest
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

32Basic⌨ Coding

What is Nullish Coalescing (??) vs OR (||) operator?

?? returns the right-hand operand only if the left-hand operand is null or undefined. || returns the right-hand operand if the left-hand is ANY falsy value (e.g. 0, "", false).

Code Snippet
123
const count = class="hl-number">0;
console.log(count ?? class="hl-number">10); // 0
console.log(count || class="hl-number">10); // 10
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

33Basic⌨ Coding

What is Optional Chaining (?.) and when is it useful?

Optional chaining allows reading properties nested deep within a chain of objects without having to explicitly validate that each reference in the chain is valid. If a reference is nullish, it returns undefined.

Code Snippet
1
const street = user?.address?.street;
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

34Intermediate⌨ Coding

What is the purpose of Object.freeze() vs Object.seal()?

Object.freeze() makes an object completely immutable: cannot add/delete/modify properties. Object.seal() prevents adding/deleting properties, but existing properties can still be modified.

Code Snippet
123
const o = { a: class="hl-number">1 };
Object.freeze(o);
o.a = class="hl-number">2; // Silent failure/Error in strict mode
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

35Advanced⌨ Coding

How does Object.defineProperty() work?

It defines a new property directly on an object, or modifies an existing property, allowing configuration of details like writable, enumerable, configurable, get, and set.

Code Snippet
12
const obj = {};
Object.defineProperty(obj, "prop", { value: class="hl-number">42, writable: false });
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

36IntermediateπŸ“– Theory

Explain how modules work in JavaScript (CommonJS vs ES Modules).

CommonJS (require/module.exports) is synchronous and loaded at runtime (used in older Node.js). ES Modules (import/export) are static, loaded during compile-time, and support static analysis and tree-shaking.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

37Intermediate⌨ Coding

What are JavaScript Symbol types?

A Symbol is a unique and immutable primitive data type introduced in ES6, used as unique keys for object properties to avoid collisions.

Code Snippet
12
const sym = Symbol("id");
const obj = { [sym]: class="hl-number">123 };
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

38Basic⌨ Coding

What is the difference between static and instance methods in ES6 classes?

Static methods are called on the class itself, not on instances of the class. Instance methods require a class instantiation (new object) to be called.

Code Snippet
1234
class MyClass {
static staticM() {}
instanceM() {}
}
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

39BasicπŸ“– Theory

What is Object.assign() and what are its limitations?

Object.assign() is used to copy values of all enumerable own properties from one or more source objects to a target object. Limitation: It only performs a shallow copy, not a deep copy.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

40IntermediateπŸ“– Theory

Explain the difference between constructor functions and ES6 classes.

ES6 classes are syntactical sugar over constructor functions and prototype-based inheritance. Classes introduce strict mode by default, support extends keyword easily, and their methods are non-enumerable.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

41IntermediateπŸ“– Theory

Explain how to determine the type of a variable in JS (typeof, instanceof, constructor).

typeof evaluates primitives (e.g. "string", "number"). instanceof checks if an object's prototype chain contains a class constructor prototype. Object.prototype.toString.call(val) is the most reliable check.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

42BasicπŸ“– Theory

What is NaN and how do you test for it?

NaN represents "Not-a-Number", but its type is "number". Since NaN === NaN is false, use isNaN() or Number.isNaN() to check for it.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

43IntermediateπŸ“– Theory

Explain how arguments are passed in JavaScript (Pass by Value vs Pass by Reference).

JavaScript always passes by value. However, for objects and arrays, the value passed is the *reference* to the object. Thus, modifying properties of an object parameter affects the outer object, but re-assigning the parameter does not.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

44IntermediateπŸ“– Theory

What is the pipeline pattern or function composition in JS?

Function composition is passing the output of one function as the input to the next function in a pipeline sequence.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

45Intermediate⌨ Coding

What is currying in JavaScript?

Currying is a technique of translating a function that takes multiple arguments into a sequence of functions that each take a single argument.

Code Snippet
12
const multiply = a => b => a * b;
console.log(multiply(class="hl-number">2)(class="hl-number">3)); // 6
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

46IntermediateπŸ“– Theory

What is memoization and how is it implemented?

Memoization is an optimization technique where you store the results of expensive function calls in a cache and return the cached result when the same inputs occur again.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

47AdvancedπŸ“– Theory

What are Proxy objects in JS?

A Proxy object wraps another object and intercepts basic operations (like get, set, delete) to implement custom behavior or validations.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

48AdvancedπŸ“– Theory

What is the Reflect API and why is it used with Proxies?

Reflect is a built-in object providing methods for interceptable JS operations. It mirrors the handler methods of Proxies, making it clean to forward default operations back to target objects.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

49BasicπŸ“– Theory

What is the difference between Object.keys(), Object.values(), and Object.entries()?

Object.keys() returns an array of own enumerable property keys. Object.values() returns an array of own enumerable property values. Object.entries() returns an array of [key, value] pairs.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

50BasicπŸ“– Theory

Explain the difference between Array.map() and Array.forEach().

map() creates and returns a new array by calling a function on every element. forEach() executes a function on each element in place and returns undefined.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

51Intermediate⌨ Coding

What does Array.reduce() do? Provide a simple calculation code example.

reduce() executes a reducer function on each element of the array, resulting in a single output value.

Code Snippet
1
const sum = [class="hl-number">1, class="hl-number">2, class="hl-number">3].reduce((acc, val) => acc + val, class="hl-number">0); // 6
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

52AdvancedπŸ“– Theory

What are TypedArrays in JavaScript?

TypedArrays are array-like objects providing a mechanism for reading and writing raw binary data in memory buffers (e.g. Int8Array, Float64Array). They are common in performance-critical applications.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

53AdvancedπŸ“– Theory

Explain the concept of Web Workers.

Web Workers run scripts in background threads separate from the main execution thread, allowing expensive computations to run without blocking the user interface (DOM).

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

54BasicπŸ“– Theory

What is the difference between sessionStorage, localStorage, and Cookies?

localStorage persists indefinitely across browser sessions. sessionStorage lasts until the tab is closed. Cookies store small data (4KB) sent back to servers with every HTTP request, and support expiration dates.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

55IntermediateπŸ“– Theory

Explain Shadow DOM and how it differs from Virtual DOM.

Shadow DOM is a browser technology providing encapsulation for DOM subtrees (styles and markup isolated from the rest of the page). Virtual DOM is a lightweight JS representation of the real DOM used by libraries like React to optimize rendering.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

56IntermediateπŸ“– Theory

How does JSON serialization work and what are its limitations?

JSON.stringify() converts an object to a JSON string. Limitations: It ignores/removes undefined, functions, symbols, and collapses NaN/Infinity to null. It also fails on circular references.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

57Basic⌨ Coding

What is an IIFE (Immediately Invoked Function Expression)?

An IIFE is a JavaScript function that runs as soon as it is defined. It prevents polluting the global scope with temporary variables.

Code Snippet
123
(function() {
var temp = "secret";
})();
Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

58AdvancedπŸ“– Theory

Explain Javascript recursion and tail call optimization.

Recursion is a function calling itself until a base condition is met. Tail Call Optimization (TCO) allows recursive calls in tail position to reuse the same stack frame, preventing stack overflow errors.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

59BasicπŸ“– Theory

How can you detect browser support for standard features?

Use feature detection checking if property exists on window or element (e.g., typeof Promise !== "undefined").

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

60BasicπŸ“– Theory

What is the purpose of URL helper API?

The URL class easily parses, constructs, and validates web URLs in a structured way.

Interviewer Pro-Tip

This is a key interview question that tests core JS fundamentals. Focus on precise terminology.

61BasicπŸ“– Theory

JavaScript Q&A #61: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

62BasicπŸ“– Theory

JavaScript Q&A #62: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

63BasicπŸ“– Theory

JavaScript Q&A #63: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

64BasicπŸ“– Theory

JavaScript Q&A #64: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

65BasicπŸ“– Theory

JavaScript Q&A #65: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

66BasicπŸ“– Theory

JavaScript Q&A #66: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

67BasicπŸ“– Theory

JavaScript Q&A #67: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

68BasicπŸ“– Theory

JavaScript Q&A #68: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

69BasicπŸ“– Theory

JavaScript Q&A #69: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

70BasicπŸ“– Theory

JavaScript Q&A #70: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

71BasicπŸ“– Theory

JavaScript Q&A #71: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

72BasicπŸ“– Theory

JavaScript Q&A #72: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

73BasicπŸ“– Theory

JavaScript Q&A #73: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

74BasicπŸ“– Theory

JavaScript Q&A #74: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

75BasicπŸ“– Theory

JavaScript Q&A #75: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

76BasicπŸ“– Theory

JavaScript Q&A #76: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

77BasicπŸ“– Theory

JavaScript Q&A #77: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

78BasicπŸ“– Theory

JavaScript Q&A #78: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

79BasicπŸ“– Theory

JavaScript Q&A #79: Explain the concept of functional programming in JS.

Functional programming in JavaScript treats functions as first-class citizens. Functions can be passed as arguments, returned by other functions, and assigned to variables. Code avoids state mutation.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.

80BasicπŸ“– Theory

JavaScript Q&A #80: Explain the concept of strict typing vs dynamic typing.

JavaScript is a dynamically typed language. This means variables are not bound to a specific type, and their types can change during runtime. Type checking occurs at execution.

Interviewer Pro-Tip

Explain with simple analogies and mention modern trends.