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 76–100 of 160

Popular tracks

Mid PDF
What are template literals in HTML using <template> tag?

Short answer: The &lt;template&gt; tag defines reusable HTML that isn’t rendered until you activate it via JavaScript. Explain a bit more Example: &lt;template id=&quot;card-template&quot;&gt; &lt;div class=&quot;card&qu…

JavaScript Read answer
Mid PDF
How does the <iframe> element work?

Short answer: &lt;iframe&gt; embeds another HTML page inside the current page. Example code &lt;iframe src=&quot; width=&quot;500&quot; height=&quot;300&quot;&gt;&lt;/iframe&gt; Key Takeaway: Use iframes to display exter…

JavaScript Read answer
Mid PDF
How do you create a table in HTML?

Short answer: Use &lt;table&gt;, &lt;tr&gt; (row), &lt;th&gt; (header cell), and &lt;td&gt; (data cell). Example code &lt;table border=&quot;1&quot;&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Role&lt;/th&gt; &lt;…

JavaScript Read answer
Mid PDF
What are cards in Bootstrap?

Short answer: Cards are flexible content containers for images, text, and links. &lt;div class=&quot;card&quot; style=&quot;width:18rem;&quot;&gt; &lt;img src=&quot;...&quot; class=&quot;card-img-top&quot;&gt; &lt;div cl…

JavaScript Read answer
Mid PDF
What are IIFEs (Immediately Invoked Function Expressions)?

Short answer: Functions that execute immediately after being defined. Example code (function() { console.log(&quot;Runs instantly!&quot;); })(); Used to create private scopes before let and const. Real-world example (Sho…

JavaScript Read answer
Mid PDF
How does hardware acceleration work in CSS?

Short answer: GPU acceleration is triggered when you use transform, opacity, or will-change. It moves rendering to the GPU, making animations smoother. Example code .box { transform: translateZ(0); Follow me on LinkedIn:…

JavaScript Read answer
Mid PDF
How does the browser handle malformed HTML?

Short answer: Browsers are forgiving — they use an HTML parser that tries to fix mistakes automatically. For example, missing closing tags are inferred. Example: &lt;p&gt;This is valid Follow me on LinkedIn: &lt;p&gt;Thi…

JavaScript Read answer
Mid PDF
How can you embed a YouTube video in HTML?

Short answer: YouTube provides an embed link using &lt;iframe&gt;. Example code &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot; allowfullscreen&gt; &lt;/iframe&gt; Key Takeaway: Always use the /embed/…

JavaScript Read answer
Mid PDF
How do you create modals using Bootstrap?

Short answer: Modals are created using the .modal class and toggled with JS or data attributes. &lt;button data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#myModal&quot;&gt;Open&lt;/button&gt; &lt;div class=&quot;m…

JavaScript Read answer
Mid PDF
How can you polyfill a feature in JavaScript?

Short answer: A polyfill is a piece of code that adds a feature missing in older browsers. Follow me on LinkedIn: Example code if (!Array.prototype.includes) { Array.prototype.includes = function(item) { return this.inde…

JavaScript Read answer
Mid PDF
What are pure functions?

Short answer: Functions that: Return the same output for the same input. Have no side effects. Example: function add(a, b) { return a + b; // pure } Example code Functions that: Return the same output for the same input.…

JavaScript Read answer
Mid PDF
What are CSS Houdini APIs?

Short answer: CSS Houdini is a set of APIs that let developers extend CSS by writing code that hooks directly into the CSS engine. Explain a bit more Examples: Paint API → Custom background drawing. Layout API → Define c…

JavaScript Read answer
Mid PDF
How can you make text overflow with ellipsis?

Short answer: Use the following combination: p { width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } Key Takeaway: Truncates long text with “…” when it exceeds container width. Real-world exam…

JavaScript Read answer
Mid PDF
What are HTML entities?

Short answer: Entities display reserved characters (like &lt;, &gt;, &amp;) or symbols not on the keyboard. Example code &lt;p&gt;Use &lt;div&gt; for containers and &amp;amp; for ampersands.&lt;/p&gt; Key Takeaway: Entit…

JavaScript Read answer
Mid PDF
How do you comment in HTML?

Short answer: Follow me on LinkedIn: Comments are added using: &lt;!-- This is a comment --&gt; Example: &lt;!-- TODO: Add footer here --&gt; Key Takeaway: Comments help others understand your code — they don’t appear on…

JavaScript Read answer
Mid PDF
What are Bootstrap components?

Short answer: Reusable UI blocks like buttons, modals, navbars, forms, alerts, etc., that Bootstrap’s design standards. Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/…

JavaScript Read answer
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
Mid PDF
What are CSS combinators?

Short answer: Combinators define relationships between selectors. Combinator Description Example Descendant ( ) Any nested element div p Child (&gt;) Direct child only div &gt; 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: &lt;script src=&quot;m…

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

Short answer: Add the lang attribute in the &lt;html&gt; tag. Example code &lt;html lang=&quot;en&quot;&gt; 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) =&gt; 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: &lt;img src=&quot;...&quot; class=&quot;img-fluid&quot; alt=&quot;Responsive image&quot;&gt; Real-world example (ShopNest) ShopNes…

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

JavaScript JavaScript Tutorial · JavaScript

Short answer: The <template> tag defines reusable HTML that isn’t rendered until you activate it via JavaScript.

Explain a bit more

Example: <template id="card-template"> <div class="card"> <h3></h3> <p></p> </div> </template> <script> const tmpl = document.getElementById("card-template"); clone.querySelector("p").textContent = "Use semantic tags for SEO."; document.body.appendChild(clone); </script> Key Takeaway: <template> = invisible HTML blueprint ready to be cloned dynamically.

Example code

const clone = tmpl.content.cloneNode(true);
clone.querySelector("h3").textContent = "HTML Tips";

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: <iframe> embeds another HTML page inside the current page.

Example code

<iframe src=" width="500" height="300"></iframe> Key Takeaway: Use iframes to display external content, but avoid excessive use for performance and SEO reasons. 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 <table>, <tr> (row), <th> (header cell), and <td> (data cell).

Example code

<table border="1"> <tr> <th>Name</th> <th>Role</th> </tr> <tr> <td>Sandeep</td> Follow me on LinkedIn: <td>Developer</td> </tr> </table> Key Takeaway: Tables are for data — not for layout.

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: Cards are flexible content containers for images, text, and links. <div class="card" style="width:18rem;"> <img src="..." class="card-img-top"> <div class="card-body">...</div> </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: Functions that execute immediately after being defined.

Example code

(function() { console.log("Runs instantly!"); })(); Used to create private scopes before let and const.

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: GPU acceleration is triggered when you use transform, opacity, or will-change. It moves rendering to the GPU, making animations smoother.

Example code

.box { transform: translateZ(0); Follow me on LinkedIn: } Key Takeaway: Use GPU-friendly properties for smoother transitions; avoid triggering layout changes.

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: Browsers are forgiving — they use an HTML parser that tries to fix mistakes automatically. For example, missing closing tags are inferred. Example: <p>This is valid Follow me on LinkedIn: <p>This is auto-closed by browser</p> Key Takeaway: Browsers recover from errors, but writing valid HTML ensures consistent rendering.

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: YouTube provides an embed link using <iframe>.

Example code

<iframe width="560" height="315" src=" allowfullscreen> </iframe> Key Takeaway: Always use the /embed/ URL format for proper YouTube embedding.

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: Modals are created using the .modal class and toggled with JS or data attributes. <button data-bs-toggle="modal" data-bs-target="#myModal">Open</button> <div class="modal fade" id="myModal"> <div class="modal-dialog"><div class="modal-content">...</div></div> </div>

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 polyfill is a piece of code that adds a feature missing in older browsers. Follow me on LinkedIn:

Example code

if (!Array.prototype.includes) { Array.prototype.includes = function(item) { return this.indexOf(item) !== -1; }; }

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: Functions that: Return the same output for the same input. Have no side effects. Example: function add(a, b) { return a + b; // pure }

Example code

Functions that: Return the same output for the same input. Have no side effects. Example: function add(a, b) { return a + b; // pure
}

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: CSS Houdini is a set of APIs that let developers extend CSS by writing code that hooks directly into the CSS engine.

Explain a bit more

Examples: Paint API → Custom background drawing. Layout API → Define custom layout logic. Properties & Values API → Register custom CSS properties. Example (Paint API): registerPaint('dots', class { paint(ctx, size) { ctx.fillStyle = 'red'; ctx.arc(50, 50, 10, 0, 2 * Math.PI); ctx.fill(); } }); Key Takeaway: Houdini gives developers low-level control over how CSS works under the hood.

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 the following combination: p { width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } Key Takeaway: Truncates long text with “…” when it exceeds container 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: Entities display reserved characters (like <, >, &) or symbols not on the keyboard.

Example code

<p>Use <div> for containers and &amp; for ampersands.</p> Key Takeaway: Entities prevent HTML from confusing symbols with code.

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: Follow me on LinkedIn: Comments are added using: <!-- This is a comment --> Example: <!-- TODO: Add footer here --> Key Takeaway: Comments help others understand your code — they don’t appear on the page.

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: Reusable UI blocks like buttons, modals, navbars, forms, alerts, etc., that Bootstrap’s design standards.

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