Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4616 total questions 4516 technical 100 career & HR 4346 from PDF library

Showing 51–75 of 289

Career & HR topics

By tech stack

Mid PDF
Margin → space outside the border.?

Answer: Example: div { width: 100px; padding: 10px; border: 5px solid black; margin: 20px; Key Takeaway: Total width = content + padding + border + margin. What interviewers expect A clear definition tied to JavaScript i…

JavaScript Read answer
Junior PDF
What is the difference between inline, internal, and external CSS?

Type Scope Example Priority Inline Single element style="color:re d;" Highest Internal One page <style> inside <head> Medium External Multiple pages Linked .css file Lowest Key Takeaway: Use external CSS for…

JavaScript Read answer
Mid PDF
How can you optimize HTML for SEO?

SEO optimization starts with clean, structured, and semantic HTML. Best practices: Follow me on LinkedIn: Use meaningful tags (<header>, <article>, <footer>). Add <title>, <meta name="descripti…

JavaScript Read answer
Mid PDF
Layout & Painting:?

Answer: The browser calculates positions (layout) and then paints pixels on the screen. Key Takeaway: The DOM is built first, then styles are applied, and finally pixels are rendered — optimizing this pipeline improves p…

JavaScript Read answer
Junior PDF
What is localStorage vs sessionStorage in HTML5?

Both store data in the browser, but they differ in duration and scope. Feature localStorage sessionStorage Lifetime Until manually cleared Until the tab is closed Scope Shared across tabs Specific to one tab Capacity ~5–…

JavaScript Read answer
Junior PDF
What is the difference between <div> and <span>?

&lt;div&gt; is a block-level element (creates a full-width container). &lt;span&gt; is an inline element (used for styling small text portions). Example: &lt;div&gt;Block Section&lt;/div&gt; &lt;p&gt;This is a &lt;span s…

JavaScript Read answer
Mid PDF
What are variables in JavaScript?

Variables are containers to store data. Example: let age = 25; What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, security, cost) When you woul…

JavaScript Read answer
Mid PDF
Explain the concept of promises and async flow.

A Promise represents a value that may be available now, later, or never. It helps handle asynchronous operations in a cleaner way. Follow me on LinkedIn: Example: fetch('/data') .then(res =&gt; res.json()) .then(data =&g…

JavaScript Read answer
Mid PDF
How does the grid system work in Bootstrap?

Bootstrap uses a 12-column grid based on flexbox. You divide your layout using .row and .col-* classes. Follow me on LinkedIn: &lt;div class="row"&gt; &lt;div class="col-6"&gt;Half&lt;/div&gt; &lt;div class="col-6"&gt;Ha…

JavaScript Read answer
Junior PDF
What is prototype inheritance?

In JavaScript, every object can inherit properties from another object called its prototype. This enables object reusability. Example: const animal = { eats: true }; const dog = Object.create(animal); Follow me on Linked…

JavaScript Read answer
Mid PDF
What are functions in JavaScript?

Answer: Functions are blocks of reusable code that perform a specific task. Example: function greet(name) { return `Hello, ${name}`; } What interviewers expect A clear definition tied to JavaScript in JavaScript projects…

JavaScript Read answer
Mid PDF
!important overrides all (use sparingly).?

Answer: Example: p { color: black; } /* low */ #intro { color: blue; } /* higher */ &amp;lt;p id="intro" style="color:red;"&amp;gt;text&amp;lt;/p&amp;gt; &amp;lt;!-- highest --&amp;gt; Key Takeaway: Use balanced specific…

JavaScript Read answer
Junior PDF
What is the difference between @import and <link>?

Follow me on LinkedIn: Aspect @import &lt;link&gt; Loaded Inside CSS Inside HTML &lt;head&gt; Performance Slower (sequential) Faster (parallel) Media Queries Can include Can include Recommended ❌ Avoid ✅ Preferred Key Ta…

JavaScript Read answer
Mid PDF
How do you use position: sticky?

Makes an element toggle between relative and fixed based on scroll position. Example: header { position: sticky; top: 0; background: white; } Follow me on LinkedIn: Key Takeaway: sticky elements stay visible within their…

JavaScript Read answer
Junior PDF
What is the box model in CSS?

Every HTML element is a box made of: What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, security, cost) When you would and would not use it in…

JavaScript Read answer
Junior PDF
What is lazy loading in HTML5?

Lazy loading defers loading of non-critical images or iframes until they are visible in the viewport — improving page speed. Example: &lt;img src="photo.jpg" loading="lazy" alt="Nature view"&gt; Key Takeaway: loading="la…

JavaScript Read answer
Junior PDF
What is the <audio> and <video> tag used for?

They let you embed audio and video files directly in HTML without plugins like Flash. Example: &lt;audio controls&gt; &lt;source src="music.mp3" type="audio/mpeg"&gt; &lt;/audio&gt; &lt;video controls width="320"&gt; &lt…

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

Use the &lt;a&gt; tag with the href attribute. Example: &lt;a href=" target="_blank"&gt;Visit Google&lt;/a&gt; Explanation: Follow me on LinkedIn: href specifies the link URL. target="_blank" opens it in a new tab. Key T…

JavaScript Read answer
Junior PDF
What is the difference between var, let, and const?

Keyword Scope Re-declar Re-assig Hoisted? var Functio ✅ Yes ✅ Yes ✅ Yes (undefined) let Block ❌ No ✅ Yes 🚫 Temporarily dead zone const Block ❌ No ❌ No 🚫 Temporarily dead zone Example: Follow me on LinkedIn: let x = 10;…

JavaScript Read answer
Mid PDF
Explain the srcset and sizes attributes for <img>.

They help browsers pick the best image for the user’s device and screen size. Follow me on LinkedIn: Example: &lt;img src="small.jpg" srcset="medium.jpg 768w, large.jpg 1200w" sizes="(max-width: 768px) 100vw, 50vw" lt="L…

JavaScript Read answer
Mid PDF
What are breakpoints in Bootstrap?

Answer: Breakpoints define responsive screen widths: Breakpoint Prefix Size Extra small none &amp;lt;576px Small sm ≥576px Medium md ≥768px Large lg ≥992px Extra large xl ≥1200px XXL xxl ≥1400px What interviewers expect…

JavaScript Read answer
Mid PDF
What are web workers?

Answer: Web Workers allow JavaScript to run code in background threads, keeping the UI responsive. Example: // main.js const worker = new Worker('worker.js'); worker.postMessage('Start'); // worker.js onmessage = e =&amp…

JavaScript Read answer
Mid PDF
What are ES6 modules?

Answer: ES6 introduced modules for code reusability and organization. They use export and import keywords. Example: // math.js export function add(a, b) { return a + b; } // main.js import { add } from './math.js'; What…

JavaScript Read answer
Mid PDF
How do you handle browser compatibility issues in CSS?

✅ Common techniques: Use Autoprefixer for vendor prefixes. Use feature queries: @supports (display: grid) { .container { display: grid; } } Provide fallbacks for older browsers: background: #000; background: linear-gradi…

JavaScript Read answer
Junior PDF
What is the difference between min-width and max-width?

Answer: Property Description min-wid th Element won’t shrink below this width max-wid th Element won’t grow beyond this width Example: div { min-width: 200px; max-width: 600px; } Key Takeaway: Use both for responsive, co…

JavaScript Read answer

JavaScript JavaScript Tutorial · JavaScript

Answer: Example: div { width: 100px; padding: 10px; border: 5px solid black; margin: 20px; Key Takeaway: Total width = content + padding + border + margin.

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Type Scope Example Priority

Inline Single element style="color:re

d;"

Highest

Internal One page 	<style> inside

<head>

Medium

External Multiple pages Linked .css file Lowest

Key Takeaway:

Use external CSS for maintainable, large-scale projects.

Follow me on LinkedIn:

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

SEO optimization starts with clean, structured, and semantic HTML.

Best practices:

Follow me on LinkedIn:

  • Use meaningful tags (<header>, <article>, <footer>).
  • Add <title>, <meta name="description">, and proper heading hierarchy

(<h1> → <h6>).

  • Use descriptive alt text for images.
  • Ensure mobile-friendly and fast-loading pages.
  • Include internal linking and structured data.

Example:

<meta name="description" content="Learn web development step-by-step

with examples.">

<h1>HTML Interview Questions</h1>

Key Takeaway:

SEO-friendly HTML = clear structure + accurate metadata + accessible content.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: The browser calculates positions (layout) and then paints pixels on the screen. Key Takeaway: The DOM is built first, then styles are applied, and finally pixels are rendered — optimizing this pipeline improves page performance.

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Both store data in the browser, but they differ in duration and scope.

Feature localStorage sessionStorage

Lifetime Until manually cleared Until the tab is closed

Scope Shared across tabs Specific to one tab

Capacity ~5–10MB ~5MB

Example:

localStorage.setItem("username", "Sandeep");

sessionStorage.setItem("theme", "dark");

Key Takeaway:

Use localStorage for long-term data; sessionStorage for temporary, tab-specific data.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

  • <div> is a block-level element (creates a full-width container).
  • <span> is an inline element (used for styling small text portions).

Example:

<div>Block Section</div>

<p>This is a <span style="color: red;">red word</span> in a

sentence.</p>

Key Takeaway:

Use <div> for layout; <span> for inline styling.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Variables are containers to store data. Example: let age = 25;

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

A Promise represents a value that may be available now, later, or never.

It helps handle asynchronous operations in a cleaner way.

Follow me on LinkedIn:

Example:

fetch('/data')

.then(res => res.json())

.then(data => console.log(data))

.catch(err => console.error(err));

✅ async/await simplifies promise syntax.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Bootstrap uses a 12-column grid based on flexbox.

You divide your layout using .row and .col-* classes.

Follow me on LinkedIn:

<div class="row">

<div class="col-6">Half</div>

<div class="col-6">Half</div>

</div>

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

In JavaScript, every object can inherit properties from another object called its prototype.

This enables object reusability.

Example:

const animal = { eats: true };
const dog = Object.create(animal);

Follow me on LinkedIn:

dog.barks = true;

console.log(dog.eats); // true (inherited)

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Functions are blocks of reusable code that perform a specific task. Example: function greet(name) { return `Hello, ${name}`; }

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Example: p { color: black; } /* low */ #intro { color: blue; } /* higher */ &lt;p id="intro" style="color:red;"&gt;text&lt;/p&gt; &lt;!-- highest --&gt; Key Takeaway: Use balanced specificity; avoid overuse of !important.

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Follow me on LinkedIn:

Aspect @import <link>

Loaded Inside CSS Inside HTML

<head>

Performance Slower (sequential) Faster (parallel)

Media Queries Can include Can include

Recommended

❌ Avoid ✅ Preferred

Key Takeaway:

Use <link> — it loads faster and supports preloading and caching better.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Makes an element toggle between relative and fixed based on scroll position.

Example:

header {

position: sticky;

top: 0;

background: white;

}

Follow me on LinkedIn:

Key Takeaway:

sticky elements stay visible within their parent container while scrolling.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Every HTML element is a box made of:

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Lazy loading defers loading of non-critical images or iframes until they are visible in the

viewport — improving page speed.

Example:

<img src="photo.jpg" loading="lazy" alt="Nature view">

Key Takeaway:

loading="lazy" helps reduce initial load time and saves bandwidth.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

They let you embed audio and video files directly in HTML without plugins like Flash.

Example:

<audio controls>

<source src="music.mp3" type="audio/mpeg">

</audio>

<video controls width="320">

<source src="movie.mp4" type="video/mp4">

</video>

Follow me on LinkedIn:

Key Takeaway:

HTML5 makes multimedia playback native, fast, and accessible.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Use the <a> tag with the href attribute.

Example:

<a href="

target="_blank">Visit Google</a>

Explanation:

Follow me on LinkedIn:

  • href specifies the link URL.
  • target="_blank" opens it in a new tab.

Key Takeaway:

lways add descriptive link text for accessibility.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Keyword Scope Re-declar

Re-assig

Hoisted?

var 	Functio

✅ Yes ✅ Yes ✅ Yes (undefined)

let Block ❌ No ✅ Yes 🚫 Temporarily dead

zone

const Block ❌ No ❌ No 🚫 Temporarily dead

zone

Example:

Follow me on LinkedIn:

let x = 10; const y = 20; var z = 30;
Permalink & share

JavaScript JavaScript Tutorial · JavaScript

They help browsers pick the best image for the user’s device and screen size.

Follow me on LinkedIn:

Example:

<img

src="small.jpg"

srcset="medium.jpg 768w, large.jpg 1200w"

sizes="(max-width: 768px) 100vw, 50vw"

lt="Landscape">

  • srcset defines available image files and their widths.
  • sizes tells the browser how much space the image will take on different screens.

Key Takeaway:

srcset + sizes = responsive images that load efficiently across devices.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Breakpoints define responsive screen widths: Breakpoint Prefix Size Extra small none &lt;576px Small sm ≥576px Medium md ≥768px Large lg ≥992px Extra large xl ≥1200px XXL xxl ≥1400px

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Web Workers allow JavaScript to run code in background threads, keeping the UI responsive. Example: // main.js const worker = new Worker('worker.js'); worker.postMessage('Start'); // worker.js onmessage = e =&gt; postMessage('Task done');

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: ES6 introduced modules for code reusability and organization. They use export and import keywords. Example: // math.js export function add(a, b) { return a + b; } // main.js import { add } from './math.js';

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

✅ Common techniques:

  • Use Autoprefixer for vendor prefixes.

Use feature queries:

@supports (display: grid) {

.container { display: grid; }

}
  • Provide fallbacks for older browsers:

background: #000;

background: linear-gradient(to right, #000, #333);

  • ● Test with tools like BrowserStack.

Key Takeaway:

Graceful degradation and progressive enhancement keep CSS cross-browser safe.

Follow me on LinkedIn:

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Property Description min-wid th Element won’t shrink below this width max-wid th Element won’t grow beyond this width Example: div { min-width: 200px; max-width: 600px; } Key Takeaway: Use both for responsive, constrained resizing.

What interviewers expect

  • A clear definition tied to JavaScript in JavaScript projects
  • Trade-offs (performance, maintainability, security, cost)
  • When you would and would not use it in production

Real-world example

In a production JavaScript application, teams apply this when handling user-facing features or integration boundaries. For example, you might use it during a sprint where reliability and observability matter—logging metrics, validating edge cases, and documenting the decision in an ADR so future developers understand why the approach was chosen.

How to explain in the interview

  1. Define the concept in one or two sentences.
  2. Context — where it fits in JavaScript architecture.
  3. Example — a specific project, bug, or performance win.
  4. Trade-off — what you gain vs what you sacrifice.

Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.

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