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 1–25 of 128

Career & HR topics

By tech stack

Junior PDF
What is Bootstrap?

Answer: Follow me on LinkedIn: Bootstrap is a popular front-end framework for building responsive, mobile-first web pages using HTML, CSS, and JavaScript components. What interviewers expect A clear definition tied to Ja…

JavaScript Read answer
Junior PDF
What is reflow and repaint in CSS?

They are part of the browser’s rendering process when the DOM or styles change. Reflow (Layout): Happens when the structure or geometry of the page changes (like changing size, position, or adding elements). → Expensive…

JavaScript Read answer
Junior PDF
What is the difference between inline-block and block?

block elements take full width and start on a new line. inline-block behaves like inline (stays in the same line) but allows setting width, height, margin, and padding. Example: .block { display: block; width: 100px; } .…

JavaScript Read answer
Junior PDF
What is JavaScript?

Answer: JavaScript is a high-level, interpreted, dynamic programming language used to make web pages interactive and dynamic. It runs in browsers and also on servers (using Node.js). What interviewers expect A clear defi…

JavaScript Read answer
Junior PDF
What is the event loop in JavaScript?

The event loop manages asynchronous operations in JavaScript. It continuously checks the call stack and callback queue — executing queued tasks once the stack is empty. Example: console.log("A"); setTimeout(() => cons…

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

Flexbox (Flexible Box Layout) is a one-dimensional layout system for aligning items horizontally or vertically. Example: .container { display: flex; justify-content: center; lign-items: center; } Why use it: Centers elem…

JavaScript Read answer
Junior PDF
What is the purpose of the <!DOCTYPE html> declaration?

The &lt;!DOCTYPE html&gt; declaration tells the browser which version of HTML the page uses. In modern websites, it triggers HTML5 standards mode, ensuring consistent rendering cross browsers. Example: &lt;!DOCTYPE html&…

JavaScript Read answer
Junior PDF
What is the difference between Grid and Flexbox? Feature Flexbox Grid Layout One-dimensional (row or column) Two-dimensional (rows and columns) Use Case Aligning items in a line Building full-page layouts

lignment Easier for single direction Easier for full layout structure Example: /* Flexbox */ display: flex; /* Grid */ Follow me on LinkedIn: display: grid; grid-template-columns: repeat(3, 1fr); Key Takeaway: Use Flexbo…

JavaScript Read answer
Junior PDF
What is the difference between Bootstrap 4 and 5?

Answer: Feature Bootstrap 4 Bootstrap 5 jQuery Required Removed Grid 5 breakpoints 6 (added xxl) Forms Legacy Redesigned Icons None Separate Bootstrap Icons Utility API Limited Expanded and customizable What interviewers…

JavaScript Read answer
Junior PDF
What is garbage collection?

Garbage collection automatically frees memory that’s no longer referenced. The V8 engine uses the mark-and-sweep algorithm: “Mark” reachable objects from the root. “Sweep” and delete unreachable ones. Example: let user =…

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

Feature Flexbox Grid Layout One-dimensional (row or column) Two-dimensional (rows and columns) Use Case Aligning items in a line Building full-page layouts Alignment Easier for single direction Easier for full layout str…

JavaScript Read answer
Junior PDF
HTML Templates — define markup for reuse.?

Example: &lt;user-card&gt;&lt;/user-card&gt; &lt;template id="user-template"&gt; &lt;p&gt;Hello, &lt;span id="name"&gt;&lt;/span&gt;&lt;/p&gt; &lt;/template&gt; &lt;script&gt; class UserCard extends HTMLElement { connect…

JavaScript Read answer
Junior PDF
What is the Shadow DOM?

The Shadow DOM is a web component feature that encapsulates a section of the DOM — meaning styles and markup inside it don’t leak out or get affected by the rest of the page. Example: &lt;custom-card&gt;&lt;/custom-card&…

JavaScript Read answer
Junior PDF
What is the purpose of the <canvas> element?

The &lt;canvas&gt; element is used to draw graphics, animations, charts, or games using JavaScript. Example: &lt;canvas id="myCanvas" width="200" height="100"&gt;&lt;/canvas&gt; &lt;script&gt; const canvas = document.get…

JavaScript Read answer
Junior PDF
What is the difference between call(), apply(), and bind()? Metho d Purpose Arguments Invokes Immediately? call( ) Call a function with a specific this Comma-separat ed ✅ Yes

pply () Same as call(), but takes array Array ✅ Yes bind( Returns a new function with fixed this Comma-separat ed ❌ No Example: function greet(greeting) { console.log(`${greeting}, ${this.name}`); } const user = { name:…

JavaScript Read answer
Junior PDF
What is a container in Bootstrap?

Answer: container wraps page content and provides horizontal padding. &amp;lt;div class="container"&amp;gt;Content&amp;lt;/div&amp;gt; &amp;lt;div class="container-fluid"&amp;gt;Full width&amp;lt;/div&amp;gt; What interv…

JavaScript Read answer
Junior PDF
What is a service worker?

A service worker is a background script that runs independently of the web page. It enables offline caching, push notifications, and background sync. Example: navigator.serviceWorker.register('/sw.js'); ✅ Used in Progres…

JavaScript Read answer
Junior PDF
What is the difference between call(), apply(), and bind()?

Metho Purpose Arguments Invokes Immediately? call( Call a function with a specific this Comma-separat ✅ Yes apply Same as call(), but takes array Array ✅ Yes bind( Returns a new function with fixed this Comma-separat ❌ N…

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 &lt;style&gt; inside &lt;head&gt; Medium External Multiple pages Linked .css file Lowest Key Takeaway: Use external CSS for…

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

JavaScript JavaScript Tutorial · JavaScript

Answer: Follow me on LinkedIn: Bootstrap is a popular front-end framework for building responsive, mobile-first web pages using HTML, CSS, and JavaScript components.

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

They are part of the browser’s rendering process when the DOM or styles change.

  • Reflow (Layout): Happens when the structure or geometry of the page changes (like

changing size, position, or adding elements).

→ Expensive operation since it recalculates layout.

Follow me on LinkedIn:

  • Repaint: Happens when visual appearance (like color or background) changes

without affecting layout.

Example:

div.style.width = "200px"; /* triggers reflow + repaint */
div.style.background = "red"; /* triggers repaint only */

Key Takeaway:

Minimize layout changes; batch DOM updates to improve performance.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

  • block elements take full width and start on a new line.
  • inline-block behaves like inline (stays in the same line) but allows setting width,

height, margin, and padding.

Example:

.block {

display: block;

width: 100px;

}

.inline-block {

display: inline-block;

width: 100px;

}

Key Takeaway:

inline-block combines the flow of inline with the flexibility of block.

Follow me on LinkedIn:

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: JavaScript is a high-level, interpreted, dynamic programming language used to make web pages interactive and dynamic. It runs in browsers and also on servers (using Node.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

The event loop manages asynchronous operations in JavaScript.

It continuously checks the call stack and callback queue — executing queued tasks once

the stack is empty.

Example:

console.log("A");

setTimeout(() => console.log("B"), 0);

console.log("C");

// Output: A, C, B

Even though setTimeout is 0ms, it runs after the main thread finishes due to the event

loop.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Flexbox (Flexible Box Layout) is a one-dimensional layout system for aligning items

horizontally or vertically.

Example:

.container {

display: flex;

justify-content: center;

lign-items: center;

}

Why use it:

  • Centers elements easily.
  • Handles spacing and alignment dynamically.
  • Makes layouts responsive.

Key Takeaway:

Flexbox simplifies alignment and space distribution in one direction.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

The <!DOCTYPE html> declaration tells the browser which version of HTML the page

uses.

In modern websites, it triggers HTML5 standards mode, ensuring consistent rendering

cross browsers.

Example:

<!DOCTYPE html>

<html>

...

</html>

Key Takeaway:

lways include <!DOCTYPE html> at the top of every HTML file.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

lignment Easier for single direction Easier for full layout structure

Example:

/* Flexbox */

display: flex;

/* Grid */

Follow me on LinkedIn:

display: grid;

grid-template-columns: repeat(3, 1fr);

Key Takeaway:

Use Flexbox for alignment; Grid for complete layouts.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: Feature Bootstrap 4 Bootstrap 5 jQuery Required Removed Grid 5 breakpoints 6 (added xxl) Forms Legacy Redesigned Icons None Separate Bootstrap Icons Utility API Limited Expanded and customizable

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

Garbage collection automatically frees memory that’s no longer referenced.

The V8 engine uses the mark-and-sweep algorithm:

  • “Mark” reachable objects from the root.
  • “Sweep” and delete unreachable ones.

Example:

let user = { name: "John" };
user = null; // eligible for garbage collection
Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Feature Flexbox Grid

Layout One-dimensional (row or column) Two-dimensional (rows and columns)

Use Case Aligning items in a line Building full-page layouts

Alignment Easier for single direction Easier for full layout structure

Example:

/* Flexbox */

display: flex;

/* Grid */

Follow me on LinkedIn:

display: grid;

grid-template-columns: repeat(3, 1fr);

Key Takeaway:

Use Flexbox for alignment; Grid for complete layouts.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Example:

<user-card></user-card>

<template id="user-template">

<p>Hello, <span id="name"></span></p>

</template>

<script>

class UserCard extends HTMLElement {

connectedCallback() {

const tmpl = document.getElementById("user-template");
const content = tmpl.content.cloneNode(true);
content.querySelector("#name").textContent = "Sandeep";

this.appendChild(content);

}
}

customElements.define("user-card", UserCard);

</script>

Key Takeaway:

Web Components = reusable, encapsulated building blocks for modern web apps.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

The Shadow DOM is a web component feature that encapsulates a section of the DOM —

meaning styles and markup inside it don’t leak out or get affected by the rest of the page.

Example:

<custom-card></custom-card>

<script>

class CustomCard extends HTMLElement {

constructor() {

super();

const shadow = this.attachShadow({ mode: 'open' });
shadow.innerHTML = `<style>p { color: blue; }</style><p>Hello

Shadow!</p>`;

}
}

customElements.define('custom-card', CustomCard);

</script>

Key Takeaway:

Shadow DOM = style and structure isolation for reusable, predictable components.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

The <canvas> element is used to draw graphics, animations, charts, or games using

JavaScript.

Example:

<canvas id="myCanvas" width="200" height="100"></canvas>

<script>

const canvas = document.getElementById("myCanvas");
const ctx = canvas.getContext("2d");
ctx.fillStyle = "blue";

ctx.fillRect(10, 10, 180, 80);

</script>

Follow me on LinkedIn:

Key Takeaway:

<canvas> gives you a pixel-based drawing area inside HTML — perfect for dynamic

graphics.

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

pply

()

Same as call(), but takes array Array ✅ Yes

bind(

Returns a new function with fixed

this

Comma-separat

ed

❌ No

Example:

function greet(greeting) {

console.log(`${greeting}, ${this.name}`);

}
const user = { name: "John" };

greet.call(user, "Hi");

greet.apply(user, ["Hello"]);

const bound = greet.bind(user, "Hey");

bound();

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Answer: container wraps page content and provides horizontal padding. &lt;div class="container"&gt;Content&lt;/div&gt; &lt;div class="container-fluid"&gt;Full width&lt;/div&gt;

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 service worker is a background script that runs independently of the web page.

It enables offline caching, push notifications, and background sync.

Example:

navigator.serviceWorker.register('/sw.js');

✅ Used in Progressive Web Apps (PWAs).

Permalink & share

JavaScript JavaScript Tutorial · JavaScript

Metho

Purpose Arguments Invokes

Immediately?

call(

Call a function with a specific this Comma-separat

✅ Yes

apply

Same as call(), but takes array Array ✅ Yes

bind(

Returns a new function with fixed

this

Comma-separat

❌ No

Example:

function greet(greeting) {

console.log(`${greeting}, ${this.name}`);

const user = { name: "John" };

greet.call(user, "Hi");

greet.apply(user, ["Hello"]);

const bound = greet.bind(user, "Hey");

bound();

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

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

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

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

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