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 2401–2425 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
How can CSS be used for accessibility improvements?

Short answer: ✅ Use CSS to improve readability and focus visibility: Follow me on LinkedIn: Maintain sufficient color contrast: body { color: #111; background: #fff; } Use :focus styles for keyboard users: button:focus {…

JavaScript Read answer
Junior PDF
What is object-fit in CSS?

Short answer: Defines how images or videos resize within their container. Follow me on LinkedIn: Example code img { width: 100%; height: 300px; object-fit: cover; } Key Takeaway: cover fills the box; contain fits the who…

JavaScript Read answer
Mid PDF
What are CSS combinators?

Short answer: Combinators define relationships between selectors. Combinator Description Example Descendant ( ) Any nested element div p Child (>) Direct child only div > Adjacent sibling (+) Immediately next eleme…

JavaScript Read answer
Mid PDF
How can you make HTML pages load faster?

Short answer: Minimize HTML, CSS, and JS files. Use lazy loading for images. Use defer or async for scripts. Compress images and enable caching. Reduce DOM size. Example code Follow me on LinkedIn: <script src="m…

JavaScript Read answer
Mid PDF
How do you specify a language for an HTML page?

Short answer: Add the lang attribute in the <html> tag. Example code <html lang="en"> Key Takeaway: Helps screen readers and search engines understand the page’s language. Real-world example (ShopNe…

JavaScript Read answer
Mid PDF
What are arrow functions?

Short answer: Arrow functions are a shorter syntax for writing functions and do not have their own this. Example: const add = (a, b) => a + b; console.log(add(2, 3)); // 5 Example code Arrow functions are a shorter sy…

JavaScript Read answer
Mid PDF
Explain how iframes impact performance and SEO.

Short answer: Performance: Iframes load as separate browsing contexts, adding extra network requests and increasing page load time. SEO: Content inside iframes isn’t fully indexed by search engines. Links and text inside…

JavaScript Read answer
Mid PDF
What are responsive images in Bootstrap?

Short answer: Images that automatically scale with the parent container using .img-fluid: <img src="..." class="img-fluid" alt="Responsive image"> Real-world example (ShopNest) ShopNes…

JavaScript Read answer
Junior PDF
What is the difference between call stack and task queue?

Short answer: Call stack: Where function execution happens (synchronous). Task queue: Holds async callbacks (processed after stack is empty). Example code console.log("1"); setTimeout(() => console.log(&quot…

JavaScript Read answer
Junior PDF
What is the typeof operator?

Short answer: Used to find the type of a variable. typeof "Hello"; // "string" typeof 10; // "number" typeof null; // "object" (bug) Example code Used to find the type of a variabl…

JavaScript Read answer
Mid PDF
How does backdrop-filter work?

Short answer: It applies visual effects (like blur, brightness, or contrast) to the area behind an element. Example code .blur-bg { backdrop-filter: blur(10px); background: rgba(255, 255, 255, 0.3); } Key Takeaway: Used…

JavaScript Read answer
Mid PDF
How do you use nth-child() selector?

Short answer: Selects elements based on their order within a parent. Examples: li:nth-child(2) { color: red; } /* 2nd item */ li:nth-child(odd) { background: #eee; } /* odd items */ li:nth-child(3n) { font-weight: bold;…

JavaScript Read answer
Junior PDF
What is a CSS class selector?

Short answer: Targets elements with a specific class attribute. Example code .card { background-color: lightgray; } <div class="card">Profile</div> Follow me on LinkedIn: Key Takeaway: Classes are r…

JavaScript Read answer
Mid PDF
What are custom data attributes (data-*)?

Short answer: They allow you to store extra data on HTML elements — useful for scripts or dynamic behavior. Example code <button data-user-id="101" data-role="admin">View Profile</button>…

JavaScript Read answer
Mid PDF
What are block-level and inline elements?

Short answer: Block-level elements start on a new line and take full width (e.g., <div>, <p>, <section>). Inline elements stay within a line (e.g., <span>, <a>, <strong>). Example code…

JavaScript Read answer
Junior PDF
What is event bubbling and capturing?

Short answer: When an event occurs in a nested element: Bubbling: Event moves upward (child → parent). Capturing: Event moves downward (parent → child). Example code element.addEventListener('click', handler, true); // c…

JavaScript Read answer
Junior PDF
What is the difference between regular function and arrow function?

Short answer: Feature Regular Function Arrow Function this Dynamic Lexical (inherits from parent) Syntax function f(){} (a,b)=>a+b Can be used as constructor ✅ ❌ Example code Feature Regular Function Arrow Function th…

JavaScript Read answer
Mid PDF
How can you customize Bootstrap themes?

Short answer: Override variables using SCSS. Use Bootstrap’s Theme Customizer or utility API. Or override styles in a custom CSS file. Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch A…

JavaScript Read answer
Junior PDF
What is functional programming in JavaScript?

Short answer: A style where functions are pure, stateless, and composable. Example: const double = x => x * 2; const square = x => x * x; const result = square(double(3)); // 36 Example code A style where functions…

JavaScript Read answer
Junior PDF
What is the difference between shallow copy and deep copy?

Short answer: Type Description Shallow Copy Copies top-level properties only Deep Copy Copies all nested objects too Follow me on LinkedIn: Example: const obj = { a: { b: 1 } }; Example code const shallow = { ...obj }; /…

JavaScript Read answer
Mid PDF
What are promises in JavaScript?

Short answer: Promises handle asynchronous operations. They represent a value that may be available now, later, or never. Example code let promise = new Promise((resolve, reject) => { resolve("Success!"); })…

JavaScript Read answer
Junior PDF
What is the difference between em and rem units?

Short answer: Unit Relative To Example em Parent’s font size 2em = 2 × parent font-size rem Root (<html>) font size 2rem = 2 × root font-size Example code html { font-size: 16px; } p { font-size: 2rem; } /* = 32px…

JavaScript Read answer
Junior PDF
What is the use of the alt attribute in images?

Short answer: The alt attribute provides alternative text when an image fails to load and is read by screen readers. Example code Follow me on LinkedIn: <img src="team.jpg" alt="Our development team&quo…

JavaScript Read answer
Junior PDF
What is a higher-order function?

Short answer: A function that accepts another function as a parameter or returns a function. Example: function multiplyBy(factor) { return x => x * factor; } const double = multiplyBy(2); console.log(double(5)); // 10…

JavaScript Read answer
Mid PDF
How do you create navigation bars?

Short answer: Use .navbar and .navbar-expand-* classes: Follow me on LinkedIn: <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">Brand&…

JavaScript Read answer

JavaScript JavaScript Tutorial · JavaScript

Short answer: ✅ Use CSS to improve readability and focus visibility: Follow me on LinkedIn: Maintain sufficient color contrast: body { color: #111; background: #fff; } Use :focus styles for keyboard users: button:focus { outline: 2px solid #005fcc; } ● Avoid hiding content with display: none; if screen readers need it.

Explain a bit more

Respect user preferences: @media (prefers-reduced-motion: reduce) { * { animation: none; } } Key Takeaway: Accessible CSS ensures inclusivity for all users — especially keyboard and screen-reader users.

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: Defines how images or videos resize within their container. Follow me on LinkedIn:

Example code

img { width: 100%; height: 300px; object-fit: cover; } Key Takeaway: cover fills the box; contain fits the whole image inside.

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: Combinators define relationships between selectors. Combinator Description Example Descendant ( ) Any nested element div p Child (>) Direct child only div > Adjacent sibling (+) Immediately next element h1 + p General sibling (~) All next siblings h1 ~ p Key Takeaway: Combinators refine selector targeting.

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: Minimize HTML, CSS, and JS files. Use lazy loading for images. Use defer or async for scripts. Compress images and enable caching. Reduce DOM size.

Example code

Follow me on LinkedIn: <script src="main.js" defer></script> <img src="hero.jpg" loading="lazy" alt="Hero image"> Key Takeaway: Speed = smaller files, fewer requests, smarter loading.

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: Add the lang attribute in the <html> tag.

Example code

<html lang="en"> Key Takeaway: Helps screen readers and search engines understand the page’s language.

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: Arrow functions are a shorter syntax for writing functions and do not have their own this. Example: const add = (a, b) => a + b; console.log(add(2, 3)); // 5

Example code

Arrow functions are a shorter syntax for writing functions and do not have their own this. Example: const add = (a, b) => a + b; console.log(add(2, 3)); // 5

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: Performance: Iframes load as separate browsing contexts, adding extra network requests and increasing page load time. SEO: Content inside iframes isn’t fully indexed by search engines. Links and text inside may not count toward the parent page’s SEO. Best Practice: Use iframes only when necessary (e.g., embedding maps or videos). Add title attributes for accessibility.

Example code

<iframe src=" title="Location Map"></iframe> Key Takeaway: Iframes isolate content — great for embedding, but can slow pages and weaken SEO. Follow me on LinkedIn: CSS Interview Questions

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: Images that automatically scale with the parent container using .img-fluid: <img src="..." class="img-fluid" alt="Responsive image">

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: Call stack: Where function execution happens (synchronous). Task queue: Holds async callbacks (processed after stack is empty).

Example code

console.log("1"); setTimeout(() => console.log("2"), 0); console.log("3"); // Output: 1, 3, 2 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: Used to find the type of a variable. typeof "Hello"; // "string" typeof 10; // "number" typeof null; // "object" (bug)

Example code

Used to find the type of a variable. typeof "Hello"; // "string" typeof 10; // "number" typeof null; // "object" (bug)

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 applies visual effects (like blur, brightness, or contrast) to the area behind an element.

Example code

.blur-bg { backdrop-filter: blur(10px); background: rgba(255, 255, 255, 0.3); } Key Takeaway: Used for modern UI effects (like frosted glass) — supported in modern browsers only. Follow me on LinkedIn: JavaScript Interview Questions

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: Selects elements based on their order within a parent. Examples: li:nth-child(2) { color: red; } /* 2nd item */ li:nth-child(odd) { background: #eee; } /* odd items */ li:nth-child(3n) { font-weight: bold; } /* every 3rd item */ Key Takeaway: nth-child() gives you precise control over repeating patterns in lists or grids. Advanced

Example code

Selects elements based on their order within a parent. Examples: li:nth-child(2) { color: red; } /* 2nd item */ li:nth-child(odd) { background: #eee; } /* odd items */ li:nth-child(3n) { font-weight: bold; } /* every 3rd item */ Key Takeaway: nth-child() gives you precise control over repeating patterns in lists or grids. Advanced

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: Targets elements with a specific class attribute.

Example code

.card { background-color: lightgray; } <div class="card">Profile</div> Follow me on LinkedIn: Key Takeaway: Classes are reusable; use them for consistent styling across elements.

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 allow you to store extra data on HTML elements — useful for scripts or dynamic behavior.

Example code

<button data-user-id="101" data-role="admin">View Profile</button> <script> const btn = document.querySelector("button"); console.log(btn.dataset.userId); // 101 console.log(btn.dataset.role); // admin </script> Key Takeaway: data-* attributes are perfect for embedding small pieces of custom data without affecting layout. Follow me on LinkedIn: Advanced

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: Block-level elements start on a new line and take full width (e.g., <div>, <p>, <section>). Inline elements stay within a line (e.g., <span>, <a>, <strong>).

Example code

<div>Block</div> <span>Inline</span> Key Takeaway: Block = structure; Inline = styling or small content.

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: When an event occurs in a nested element: Bubbling: Event moves upward (child → parent). Capturing: Event moves downward (parent → child).

Example code

element.addEventListener('click', handler, true); // capturing element.addEventListener('click', handler, false); // bubbling

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: Feature Regular Function Arrow Function this Dynamic Lexical (inherits from parent) Syntax function f(){} (a,b)=>a+b Can be used as constructor ✅ ❌

Example code

Feature Regular Function Arrow Function this Dynamic Lexical (inherits from parent) Syntax function f(){} (a,b)=>a+b Can be used as constructor ✅ ❌

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: Override variables using SCSS. Use Bootstrap’s Theme Customizer or utility API. Or override styles in a custom CSS file.

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 style where functions are pure, stateless, and composable. Example: const double = x => x * 2; const square = x => x * x; const result = square(double(3)); // 36

Example code

A style where functions are pure, stateless, and composable. Example: const double = x => x * 2;
const square = x => x * x;
const result = square(double(3)); // 36

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 Description Shallow Copy Copies top-level properties only Deep Copy Copies all nested objects too Follow me on LinkedIn: Example: const obj = { a: { b: 1 } };

Example code

const shallow = { ...obj }; // same reference
const deep = JSON.parse(JSON.stringify(obj)); // new copy

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: Promises handle asynchronous operations. They represent a value that may be available now, later, or never.

Example code

let promise = new Promise((resolve, reject) => { resolve("Success!"); }); promise.then(res => console.log(res));

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: Unit Relative To Example em Parent’s font size 2em = 2 × parent font-size rem Root (<html>) font size 2rem = 2 × root font-size

Example code

html { font-size: 16px; } p { font-size: 2rem; } /* = 32px */ Key Takeaway: Use rem for consistent sizing across the document.

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: The alt attribute provides alternative text when an image fails to load and is read by screen readers.

Example code

Follow me on LinkedIn: <img src="team.jpg" alt="Our development team"> Key Takeaway: Always include meaningful alt text — it’s good for accessibility and SEO.

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 accepts another function as a parameter or returns a function. Example: function multiplyBy(factor) { return x => x * factor; } const double = multiplyBy(2); console.log(double(5)); // 10

Example code

A function that accepts another function as a parameter or returns a function. Example: function multiplyBy(factor) { return x => x * factor;
}
const double = multiplyBy(2); console.log(double(5)); // 10

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 .navbar and .navbar-expand-* classes: Follow me on LinkedIn: <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">Brand</a> </nav>

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