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 2426–2450 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
What are decorators?

Short answer: Decorators modify classes or methods at runtime. Common in TypeScript and frameworks like Angular. Example (TypeScript): function log(target, key) { console.log(`${key} was called`); } Example code class Ex…

JavaScript Read answer
Junior PDF
What is a promise chain?

Short answer: Promise chaining allows multiple async tasks to run sequentially. Example code fetch('/data') .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error(err)); Real-world…

JavaScript Read answer
Junior PDF
What is the DOM?

Short answer: DOM (Document Object Model) represents the structure of an HTML document as a tree of objects, allowing JavaScript to access and manipulate elements dynamically. Follow me on LinkedIn: Real-world example (S…

JavaScript Read answer
Mid PDF
How do you use CSS variables?

Short answer: Define a variable with --name and access it with var(). Example code :root { -main-color: #007bff; -padding: 10px; } button { background: var(--main-color); padding: var(--padding); } Follow me on LinkedIn:…

JavaScript Read answer
Junior PDF
What is the difference between <b> and <strong>?

Short answer: &lt;b&gt; only makes text bold visually. &lt;strong&gt; adds semantic meaning (important text). Example: &lt;b&gt;Warning:&lt;/b&gt; Incorrect password.&lt;br&gt; &lt;strong&gt;Warning:&lt;/strong&gt; Incor…

JavaScript Read answer
Junior PDF
What is a callback function?

Short answer: A function passed as an argument to another function to be executed later. Example: function greet(name, callback) { console.log(`Hello, ${name}`); callback(); } Example code greet(&quot;Sandeep&quot;, () =…

JavaScript Read answer
Junior PDF
What is the purpose of the .btn class?

Short answer: Provides consistent button styling: &lt;button class=&quot;btn btn-primary&quot;&gt;Click&lt;/button&gt; Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/a…

JavaScript Read answer
Mid PDF
How can you implement inheritance in JavaScript?

Short answer: Using prototypes or classes. Example (ES6): class Animal { eat() { console.log(&quot;Eating&quot;); } } class Dog extends Animal { bark() { console.log(&quot;Bark!&quot;); } Follow me on LinkedIn: } Example…

JavaScript Read answer
Mid PDF
What are WeakMap and WeakSet?

Short answer: They are collections that hold weak references to objects — allowing garbage collection if no other reference exists. Example: let obj = {}; let wm = new WeakMap(); wm.set(obj, &quot;value&quot;); obj = nul…

JavaScript Read answer
Junior PDF
What is JSON?

Short answer: JSON (JavaScript Object Notation) is a lightweight format for storing and transferring data. Example: let obj = { name: &quot;Bob&quot; }; let json = JSON.stringify(obj); // Convert to JSON string Example c…

JavaScript Read answer
Mid PDF
What are media queries?

Short answer: Media queries apply styles based on device conditions (width, orientation, etc.). Example code @media (max-width: 768px) { body { background-color: lightgray; } } Key Takeaway: Media queries enable responsi…

JavaScript Read answer
Junior PDF
What is the difference between <i> and <em>?

Short answer: &lt;i&gt; makes text italic for style only. &lt;em&gt; gives emphasis that can change meaning. Example: &lt;i&gt;Book titles&lt;/i&gt; are italicized. Please &lt;em&gt;do not&lt;/em&gt; touch that. Follow m…

JavaScript Read answer
Junior PDF
What is a pure function?

Short answer: A function that: Always returns the same output for the same input Has no side effects (doesn’t modify external variables) Example: function sum(a, b) { return a + b; Real-world example (ShopNest) ShopNest’…

JavaScript Read answer
Mid PDF
What are form controls in Bootstrap?

Short answer: Styled inputs, selects, and textareas: &lt;input type=&quot;text&quot; class=&quot;form-control&quot; placeholder=&quot;Enter name&quot;&gt; Real-world example (ShopNest) ShopNest’s browser cart uses modern…

JavaScript Read answer
Mid PDF
What are async iterators?

Short answer: Async iterators allow looping over asynchronous data sources. Example: async function* fetchItems() { yield await fetch('/item1'); yield await fetch('/item2'); } for await (let item of fetchItems()) { conso…

JavaScript Read answer
Junior PDF
What is the difference between slice() and splice()?

Short answer: Method Mutates Original? Purpose slice(start, end) ❌ No Extracts portion Follow me on LinkedIn: splice(start, count, ...items) ✅ Yes Adds/removes items Real-world example (ShopNest) ShopNest’s browser cart…

JavaScript Read answer
Junior PDF
What is localStorage?

Short answer: localStorage stores key-value pairs in the browser permanently (until cleared). Example code localStorage.setItem(&quot;user&quot;, &quot;Alice&quot;); console.log(localStorage.getItem(&quot;user&quot;)); /…

JavaScript Read answer
Junior PDF
What is float and why is it used?

Short answer: float moves elements to the left or right — allowing text and inline elements to wrap around. Example code img { float: right; margin: 10px; } Key Takeaway: Used for text wrapping, but Flexbox/Grid is bette…

JavaScript Read answer
Junior PDF
What is a favicon and how is it added?

Short answer: A favicon is the small icon shown in the browser tab. Example code &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; href=&quot;favicon.png&quot;&gt; Key Takeaway: Favicons help brand your site in th…

JavaScript Read answer
Junior PDF
What is recursion?

Short answer: A function that calls itself until a base condition is met. Example: function factorial(n) { if (n === 0) return 1; return n * factorial(n - 1); } console.log(factorial(5)); // 120 Example code A function t…

JavaScript Read answer
Mid PDF
How can you align elements vertically in Bootstrap?

Short answer: dvanced What is the difference between order and offset classes? order-*: Changes element order in flex containers. .offset-*: Adds left margin space in grids. &lt;div class=&quot;col-md-4 order-2 offset-md…

JavaScript Read answer
Mid PDF
How can you align elements vertically in Bootstrap?

Short answer: Use Flexbox utilities: &lt;div class=&quot;d-flex align-items-center&quot; style=&quot;height:200px;&quot;&gt; &lt;p&gt;Vertically centered&lt;/p&gt; &lt;/div&gt; Advanced What is the difference between ord…

JavaScript Read answer
Junior PDF
What is the difference between microtask and macrotask queue?

Short answer: Type Example Priority Microtask Promise.then, MutationObserver Higher Macrotask setTimeout, setInterval Lower Example: setTimeout(() =&gt; console.log(&quot;Macro&quot;), 0); Example code Promise.resolve().…

JavaScript Read answer
Junior PDF
What is the difference between mutable and immutable objects?

Short answer: Mutable: Can be changed after creation (e.g., arrays, objects). Immutable: Cannot be changed once created (e.g., strings, numbers). Say this in the interview Define — one clear sentence (the short answer ab…

JavaScript Read answer
Junior PDF
What is destructuring in JavaScript?

Short answer: It allows unpacking values from arrays or objects. Example: const [a, b] = [1, 2]; const { name, age } = { name: &quot;John&quot;, age: 30 }; Example code It allows unpacking values from arrays or objects.…

JavaScript Read answer

JavaScript JavaScript Tutorial · JavaScript

Short answer: Decorators modify classes or methods at runtime. Common in TypeScript and frameworks like Angular. Example (TypeScript): function log(target, key) { console.log(`${key} was called`); }

Example code

class Example { @log test() {} }

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: Promise chaining allows multiple async tasks to run sequentially.

Example code

fetch('/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: DOM (Document Object Model) represents the structure of an HTML document as a tree of objects, allowing JavaScript to access and manipulate elements dynamically. 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: Define a variable with --name and access it with var().

Example code

:root { -main-color: #007bff; -padding: 10px; } button { background: var(--main-color); padding: var(--padding); } Follow me on LinkedIn: Key Takeaway: CSS variables make styles dynamic and reusable.

Real-world example (ShopNest)

In ShopNest’s cart UI, a click handler closes over productId. Use let in loops so each button keeps the correct id.

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: <b> only makes text bold visually. <strong> adds semantic meaning (important text). Example: <b>Warning:</b> Incorrect password.<br> <strong>Warning:</strong> Incorrect password. Key Takeaway: Use <strong> for emphasis that affects meaning.

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: A function passed as an argument to another function to be executed later. Example: function greet(name, callback) { console.log(`Hello, ${name}`); callback(); }

Example code

greet("Sandeep", () => console.log("Callback executed"));

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: Provides consistent button styling: <button class="btn btn-primary">Click</button>

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: Using prototypes or classes. Example (ES6): class Animal { eat() { console.log("Eating"); } } class Dog extends Animal { bark() { console.log("Bark!"); } Follow me on LinkedIn: }

Example code

Using prototypes or classes. Example (ES6): class Animal { eat() { console.log("Eating"); } }
class Dog extends Animal { bark() { console.log("Bark!"); } 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: They are collections that hold weak references to objects — allowing garbage collection if no other reference exists. Example: let obj = {}; let wm = new WeakMap(); wm.set(obj, "value"); obj = null; // entry removed automatically

Example code

They are collections that hold weak references to objects — allowing garbage collection if no other reference exists. Example: let obj = {};
let wm = new WeakMap(); wm.set(obj, "value"); obj = null; // entry removed automatically

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: JSON (JavaScript Object Notation) is a lightweight format for storing and transferring data. Example: let obj = { name: "Bob" }; let json = JSON.stringify(obj); // Convert to JSON string

Example code

JSON (JavaScript Object Notation) is a lightweight format for storing and transferring data. Example: let obj = { name: "Bob" };
let json = JSON.stringify(obj); // Convert to JSON string

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: Media queries apply styles based on device conditions (width, orientation, etc.).

Example code

@media (max-width: 768px) { body { background-color: lightgray; } } Key Takeaway: Media queries enable responsive design across devices.

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: <i> makes text italic for style only. <em> gives emphasis that can change meaning. Example: <i>Book titles</i> are italicized. Please <em>do not</em> touch that. Follow me on LinkedIn: Key Takeaway: <em> adds importance — <i> adds style.

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: A function that: Always returns the same output for the same input Has no side effects (doesn’t modify external variables) Example: function sum(a, b) { return a + b;

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: Styled inputs, selects, and textareas: <input type="text" class="form-control" placeholder="Enter name">

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: Async iterators allow looping over asynchronous data sources. Example: async function* fetchItems() { yield await fetch('/item1'); yield await fetch('/item2'); } for await (let item of fetchItems()) { console.log(item); }

Example code

Async iterators allow looping over asynchronous data sources. Example: async function* fetchItems() { yield await fetch('/item1'); yield await fetch('/item2'); }
for await (let item of fetchItems()) { console.log(item); }

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: Method Mutates Original? Purpose slice(start, end) ❌ No Extracts portion Follow me on LinkedIn: splice(start, count, ...items) ✅ Yes Adds/removes items

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: localStorage stores key-value pairs in the browser permanently (until cleared).

Example code

localStorage.setItem("user", "Alice"); console.log(localStorage.getItem("user")); // Alice

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: float moves elements to the left or right — allowing text and inline elements to wrap around.

Example code

img { float: right; margin: 10px; } Key Takeaway: Used for text wrapping, but Flexbox/Grid is better for layout today.

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: A favicon is the small icon shown in the browser tab.

Example code

<link rel="icon" type="image/png" href="favicon.png"> Key Takeaway: Favicons help brand your site in the browser.

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: A function that calls itself until a base condition is met. Example: function factorial(n) { if (n === 0) return 1; return n * factorial(n - 1); } console.log(factorial(5)); // 120

Example code

A function that calls itself until a base condition is met. Example: function factorial(n) { if (n === 0) return 1;
return n * factorial(n - 1);
} console.log(factorial(5)); // 120

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: dvanced What is the difference between order and offset classes? order-*: Changes element order in flex containers. .offset-*: Adds left margin space in grids. <div class="col-md-4 order-2 offset-md-1"></div> 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: Use Flexbox utilities: <div class="d-flex align-items-center" style="height:200px;"> <p>Vertically centered</p> </div> Advanced What is the difference between order and offset classes? .order-*: Changes element order in flex containers. .offset-*: Adds left margin space in grids. <div class="col-md-4 order-2 offset-md-1"></div> 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: Type Example Priority Microtask Promise.then, MutationObserver Higher Macrotask setTimeout, setInterval Lower Example: setTimeout(() => console.log("Macro"), 0);

Example code

Promise.resolve().then(() => console.log("Micro")); // Output: Micro → Macro

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: Mutable: Can be changed after creation (e.g., arrays, objects). Immutable: Cannot be changed once created (e.g., strings, numbers).

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: It allows unpacking values from arrays or objects. Example: const [a, b] = [1, 2]; const { name, age } = { name: "John", age: 30 };

Example code

It allows unpacking values from arrays or objects. Example: const [a, b] = [1, 2];
const { name, age } = { name: "John", age: 30 };

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