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 526–550 of 963

Career & HR topics

By tech stack

Popular tracks

Junior PDF
What is the difference between map() and forEach()?

Short answer: Method Returns Chainable Use Case forEach () undefin ed ❌ No Iteration map() New array ✅ Yes Transformation Example: [1,2,3].map(x => x*2); // [2,4,6] Example code Method Returns Chainable Use Case forEa…

JavaScript Read answer
Junior PDF
What is an arrow function?

Short answer: Arrow functions are a shorter syntax for writing functions. They don’t have their own this. Example: const sum = (a, b) => a + b; Follow me on LinkedIn: Example code Arrow functions are a shorter syntax…

JavaScript Read answer
Junior PDF
What is the will-change property?

Short answer: It hints the browser that an element will soon change, so the browser can optimize rendering ahead of time. Example code .box { will-change: transform, opacity; } Key Takeaway: Improves animation performanc…

JavaScript Read answer
Junior PDF
What is the purpose of z-index?

Short answer: z-index controls stacking order of overlapping elements. Example code .box1 { z-index: 1; } .box2 { z-index: 10; } Higher values appear on top. Key Takeaway: Only works on positioned elements (position ≠ st…

JavaScript Read answer
Junior PDF
What is the use of the <data> tag?

Short answer: It links human-readable text with a machine-readable value — useful for analytics or scripts. Follow me on LinkedIn: Example code &lt;p&gt;Price: &lt;data value=&quot;499&quot;&gt;₹499&lt;/data&gt;&lt;/p&gt…

JavaScript Read answer
Junior PDF
What is the difference between <ol>, <ul>, and <dl>?

Short answer: &lt;ol&gt; = Ordered List (numbered) &lt;ul&gt; = Unordered List (bulleted) &lt;dl&gt; = Description List (term–definition pairs) Example: &lt;ol&gt; &lt;li&gt;HTML&lt;/li&gt; &lt;li&gt;CSS&lt;/li&gt; &lt;/…

JavaScript Read answer
Junior PDF
What is typeof operator?

Short answer: Returns the type of a variable. Example: typeof &quot;hello&quot;; // &quot;string&quot; typeof 42; // &quot;number&quot; Example code Returns the type of a variable. Example: typeof &quot;hello&quot;; // &…

JavaScript Read answer
Junior PDF
What is the event delegation pattern?

Short answer: Instead of attaching listeners to every element, attach one listener to a parent — it captures events from its children using bubbling. Example code document.querySelector('#list').addEventListener('click',…

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

Short answer: == : Equality operator (converts type before comparing) === : Strict equality (no type conversion, checks type + value) Example: 5 == '5'; // true 5 === '5'; // false Example code == : Equality operator (co…

JavaScript Read answer
Junior PDF
What is CSS containment?

Short answer: contain tells the browser which aspects of an element’s rendering are independent from the rest of the document — reducing reflows and repaints. Example code .card { Follow me on LinkedIn: contain: layout p…

JavaScript Read answer
Junior PDF
What is the difference between id and class attributes?

Short answer: id is unique and used for a single element. class can be used for multiple elements. Example code &lt;div id=&quot;main-header&quot;&gt;&lt;/div&gt; &lt;div class=&quot;card&quot;&gt;&lt;/div&gt; &lt;div cl…

JavaScript Read answer
Junior PDF
What is the difference between .container and .container-fluid?

Short answer: .container: Fixed width, adjusts at each breakpoint. .container-fluid: Always spans 100% width. Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, mod…

JavaScript Read answer
Junior PDF
What is the difference between logical and physical properties?

Short answer: Logical properties adapt layouts for different writing directions (LTR, RTL, vertical text). Physical Logical margin-le ft margin-inline-s tart padding-t op padding-block-s tart Example code p { padding-inl…

JavaScript Read answer
Junior PDF
What is a function in JavaScript?

Short answer: A function is a block of reusable code that performs a task or returns a value. Example: function greet(name) { return `Hello, ${name}!`; } console.log(greet(&quot;Sandeep&quot;)); Example code A function i…

JavaScript Read answer
Junior PDF
What is the difference between new Object() and object literal {}?

Short answer: Both create objects, but: {} is simpler and faster. new Object() is less common and can be overridden. Example: const a = {}; // Preferred const b = new Object(); // Not preferred Example code Both create o…

JavaScript Read answer
Junior PDF
What is an event listener?

Short answer: An event listener waits for user actions (like clicks or keypresses) and runs a function when the event occurs. Example code button.addEventListener(&quot;click&quot;, () =&gt; alert(&quot;Clicked!&quot;));…

JavaScript Read answer
Junior PDF
What is overflow in CSS?

Short answer: Controls what happens when content exceeds the container’s size. Values: visible (default) hidden scroll auto Example code div { overflow: auto; } Key Takeaway: overflow: auto adds scrollbars only when need…

JavaScript Read answer
Junior PDF
What is the role of the <form> tag?

Short answer: It collects user input and sends it to a server or script for processing. Example code &lt;form action=&quot;/submit&quot; method=&quot;POST&quot;&gt; &lt;input type=&quot;text&quot; name=&quot;username&quo…

JavaScript Read answer
Junior PDF
What is function scope?

Short answer: Variables declared inside a function are accessible only within that function. Example code function demo() { let x = 10; console.log(x); // 10 } console.log(x); // ReferenceError Real-world example (ShopNe…

JavaScript Read answer
Junior PDF
What is the difference between null and undefined?

Short answer: ssigned 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 Define…

JavaScript Read answer
Junior PDF
What is the difference between null and undefined?

Short answer: Type Meaning null Intentional absence of value undefin ed Variable declared but not assigned Follow me on LinkedIn: Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs w…

JavaScript Read answer
Junior PDF
What is the difference between padding and margin?

Short answer: Property Location Affects Background? Padding Inside border ✅ Yes Margin Outside border ❌ No Example code div { Follow me on LinkedIn: margin: 10px; padding: 20px; } Key Takeaway: Padding = inner spacing, M…

JavaScript Read answer
Junior PDF
What is the purpose of the <picture> tag?

Short answer: &lt;picture&gt; allows serving different image versions depending on device, screen size, or media type. Example code &lt;picture&gt; &lt;source srcset=&quot;photo-large.jpg&quot; media=&quot;(min-width: 80…

JavaScript Read answer
Junior PDF
What is the difference between <header> and <head>?

Short answer: &lt;head&gt; holds metadata (title, styles, scripts). &lt;header&gt; defines the visible top section of the page (logo, navigation, heading). Example code &lt;head&gt; &lt;title&gt;My Portfolio&lt;/title&gt…

JavaScript Read answer
Junior PDF
What is block scope?

Short answer: Variables declared with let or const inside curly braces {} are accessible only within that block. Example: if (true) { let y = 20; const z = 30; } // console.log(y, z); // ReferenceError Example code Varia…

JavaScript Read answer

JavaScript JavaScript Tutorial · JavaScript

Short answer: Method Returns Chainable Use Case forEach () undefin ed ❌ No Iteration map() New array ✅ Yes Transformation Example: [1,2,3].map(x => x*2); // [2,4,6]

Example code

Method Returns Chainable Use Case forEach () undefin ed ❌ No Iteration map() New array ✅ Yes Transformation Example: [1,2,3].map(x => x*2); // [2,4,6]

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: Arrow functions are a shorter syntax for writing functions. They don’t have their own this. Example: const sum = (a, b) => a + b; Follow me on LinkedIn:

Example code

Arrow functions are a shorter syntax for writing functions. They don’t have their own this. Example: const sum = (a, b) => a + b; 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: It hints the browser that an element will soon change, so the browser can optimize rendering ahead of time.

Example code

.box { will-change: transform, opacity; } Key Takeaway: Improves animation performance but use carefully — too many can waste memory.

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: z-index controls stacking order of overlapping elements.

Example code

.box1 { z-index: 1; } .box2 { z-index: 10; } Higher values appear on top. Key Takeaway: Only works on positioned elements (position ≠ static).

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: It links human-readable text with a machine-readable value — useful for analytics or scripts. Follow me on LinkedIn:

Example code

<p>Price: <data value="499">₹499</data></p> Key Takeaway: <data> helps embed structured data inside readable content.

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: <ol> = Ordered List (numbered) <ul> = Unordered List (bulleted) <dl> = Description List (term–definition pairs) Example: <ol> <li>HTML</li> <li>CSS</li> </ol> <ul> <li>Apple</li> <li>Banana</li> </ul> Follow me on LinkedIn: <dl> <dt>HTML</dt> <dd>HyperText Markup Language</dd> </dl> Key Takeaway: Choose list type based on how you want to present data.

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: Returns the type of a variable. Example: typeof "hello"; // "string" typeof 42; // "number"

Example code

Returns the type of a variable. Example: typeof "hello"; // "string" typeof 42; // "number"

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: Instead of attaching listeners to every element, attach one listener to a parent — it captures events from its children using bubbling.

Example code

document.querySelector('#list').addEventListener('click', e => { if (e.target.tagName === 'LI') console.log(e.target.textContent); }); Follow me on LinkedIn: ✅ Improves performance and memory usage.

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: == : Equality operator (converts type before comparing) === : Strict equality (no type conversion, checks type + value) Example: 5 == '5'; // true 5 === '5'; // false

Example code

== : Equality operator (converts type before comparing) === : Strict equality (no type conversion, checks type + value) Example: 5 == '5'; // true
5 === '5'; // false

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: contain tells the browser which aspects of an element’s rendering are independent from the rest of the document — reducing reflows and repaints.

Example code

.card { Follow me on LinkedIn: contain: layout paint; } Key Takeaway: Containment isolates elements for performance optimization.

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: id is unique and used for a single element. class can be used for multiple elements.

Example code

<div id="main-header"></div> <div class="card"></div> <div class="card"></div> Key Takeaway: Use id for specific targeting; class for grouping and styling.

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: .container: Fixed width, adjusts at each breakpoint. .container-fluid: Always spans 100% width.

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: Logical properties adapt layouts for different writing directions (LTR, RTL, vertical text). Physical Logical margin-le ft margin-inline-s tart padding-t op padding-block-s tart

Example code

p { padding-inline-start: 10px; /* Works for both LTR and RTL */ } Key Takeaway: Logical properties make designs multilingual and direction-aware.

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 is a block of reusable code that performs a task or returns a value. Example: function greet(name) { return `Hello, ${name}!`; } console.log(greet("Sandeep"));

Example code

A function is a block of reusable code that performs a task or returns a value. Example: function greet(name) { return `Hello, ${name}!`;
} console.log(greet("Sandeep"));

Real-world example (ShopNest)

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

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Short answer: Both create objects, but: {} is simpler and faster. new Object() is less common and can be overridden. Example: const a = {}; // Preferred const b = new Object(); // Not preferred

Example code

Both create objects, but: {} is simpler and faster. new Object() is less common and can be overridden. Example: const a = {}; // Preferred
const b = new Object(); // Not preferred

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: An event listener waits for user actions (like clicks or keypresses) and runs a function when the event occurs.

Example code

button.addEventListener("click", () => alert("Clicked!"));

Real-world example (ShopNest)

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

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Short answer: Controls what happens when content exceeds the container’s size. Values: visible (default) hidden scroll auto

Example code

div { overflow: auto; } Key Takeaway: overflow: auto adds scrollbars only when needed.

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: It collects user input and sends it to a server or script for processing.

Example code

<form action="/submit" method="POST"> <input type="text" name="username"> <button type="submit">Submit</button> </form> Key Takeaway: Forms are the foundation of user interaction on the web.

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: Variables declared inside a function are accessible only within that function.

Example code

function demo() { let x = 10; console.log(x); // 10 } console.log(x); // ReferenceError

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: ssigned 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 Meaning null Intentional absence of value undefin ed Variable declared but not assigned 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: Property Location Affects Background? Padding Inside border ✅ Yes Margin Outside border ❌ No

Example code

div { Follow me on LinkedIn: margin: 10px; padding: 20px; } Key Takeaway: Padding = inner spacing, Margin = outer spacing.

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: <picture> allows serving different image versions depending on device, screen size, or media type.

Example code

<picture> <source srcset="photo-large.jpg" media="(min-width: 800px)"> <source srcset="photo-small.jpg" media="(max-width: 799px)"> <img src="photo-default.jpg" alt="Beautiful landscape"> </picture> Key Takeaway: Use <picture> for art direction — showing different images per device or context.

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: <head> holds metadata (title, styles, scripts). <header> defines the visible top section of the page (logo, navigation, heading).

Example code

<head> <title>My Portfolio</title> </head> <header> <h1>Welcome to My Portfolio</h1> </header> Follow me on LinkedIn: Key Takeaway: <head> = document info; <header> = visible header area.

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: Variables declared with let or const inside curly braces {} are accessible only within that block. Example: if (true) { let y = 20; const z = 30; } // console.log(y, z); // ReferenceError

Example code

Variables declared with let or const inside curly braces {} are accessible only within that block. Example: if (true) {
let y = 20;
const z = 30;
} // console.log(y, z); // ReferenceError

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