Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
It applies visual effects (like blur, brightness, or contrast) to the area behind an element. Example: .blur-bg { backdrop-filter: blur(10px); background: rgba(255, 255, 255, 0.3); } Key Takeaway: Used for modern UI effe…
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…
They allow you to store extra data on HTML elements — useful for scripts or dynamic behavior. Example: <button data-user-id="101" data-role="admin">View Profile</button> <script> const btn = document.qu…
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: <div>Block&…
Answer: Override variables using SCSS. Use Bootstrap’s Theme Customizer or utility API. Or override styles in a custom CSS file. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade…
Answer: Promises handle asynchronous operations. They represent a value that may be vailable now, later, or never. Example: let promise = new Promise((resolve, reject) =&gt; { resolve("Success!"); }); promise.then(re…
Answer: Use .navbar and .navbar-expand-* classes: Follow me on LinkedIn: &lt;nav class="navbar navbar-expand-lg navbar-light bg-light"&gt; &lt;a class="navbar-brand" href="#"&gt;Brand&lt;/a&gt; &a…
Answer: Decorators modify classes or methods at runtime. Common in TypeScript and frameworks like Angular. Example (TypeScript): function log(target, key) { console.log(`${key} was called`); } class Example { @log test()…
Define a variable with --name and access it with var(). Example: :root { -main-color: #007bff; -padding: 10px; } button { background: var(--main-color); padding: var(--padding); } Follow me on LinkedIn: Key Takeaway: CSS…
Answer: Using prototypes or classes. Example (ES6): class Animal { eat() { console.log("Eating"); } } class Dog extends Animal { bark() { console.log("Bark!"); } Follow me on LinkedIn: } What interviewers expect A clear…
Answer: They are collections that hold weak references to objects — allowing garbage collection if no other reference exists. Example: let obj = {}; let wm = new WeakMap(); wm.set(obj, "value"); obj = null; // entry remo…
Answer: Media queries apply styles based on device conditions (width, orientation, etc.). Example: @media (max-width: 768px) { body { background-color: lightgray; } } Key Takeaway: Media queries enable responsive design…
Answer: Styled inputs, selects, and textareas: &lt;input type="text" class="form-control" placeholder="Enter name"&gt; What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-o…
Answer: Async iterators allow looping over asynchronous data sources. Example: sync function* fetchItems() { yield await fetch('/item1'); yield await fetch('/item2'); } for await (let item of fetchItems()) { console.log(…
dvanced What is the difference between order and offset classes? .order-*: Changes element order in flex containers. .offset-*: Adds left margin space in grids. <div class="col-md-4 order-2 offset-md-1"></div>…
Use Flexbox utilities: <div class="d-flex align-items-center" style="height:200px;"> <p>Vertically centered</p> </div> Advanced What is the difference between order and offset classes? .order-*: C…
Prefixes ensure CSS works across browsers before full support. Example: Follow me on LinkedIn: .box { webkit-border-radius: 10px; /* Chrome, Safari */ moz-border-radius: 10px; /* Firefox */ border-radius: 10px; /* Standa…
Answer: llowing access to outer function variables even after the outer function finishes. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, s…
Answer: Use a custom CSS file loaded after Bootstrap. Or customize variables via SCSS before compilation. What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, mai…
Answer: Modules are separate files that export code and import it elsewhere, ensuring encapsulation and reusability. Example: // export.js export const PI = 3.14; // import.js import { PI } from './export.js'; Follow me…
Answer: They provide default values when no argument is passed. Example: function greet(name = "Guest") { return `Hello, ${name}`; } What interviewers expect A clear definition tied to JavaScript in JavaScript projects T…
Answer: Closures work because functions remember the scope in which they were created, allowing access to outer function variables even after the outer function finishes. What interviewers expect A clear definition tied…
Answer: Bootstrap 5 uses Flexbox by default for its grid system and utilities (.d-flex, .justify-content-*, .align-items-*). What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-off…
Answer: No own this No arguments object Cannot be used as constructors No super or new.target What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability…
Data privacy / encapsulation Callbacks and event handlers Memoization / caching Module pattern for structuring code Example – private counter: function createCounter() { let count = 0; // private variable return { increm…
JavaScript JavaScript Tutorial · JavaScript
It applies visual effects (like blur, brightness, or contrast) to the area behind an element.
Example:
.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
JavaScript JavaScript Tutorial · JavaScript
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.
dvanced
JavaScript JavaScript Tutorial · JavaScript
They allow you to store extra data on HTML elements — useful for scripts or dynamic
behavior.
Example:
<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:
dvanced
JavaScript JavaScript Tutorial · JavaScript
<section>).
Example:
<div>Block</div>
<span>Inline</span>
Key Takeaway:
Block = structure; Inline = styling or small content.JavaScript JavaScript Tutorial · JavaScript
Answer: Override variables using SCSS. Use Bootstrap’s Theme Customizer or utility API. Or override styles in a custom CSS file.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Promises handle asynchronous operations. They represent a value that may be vailable now, later, or never. Example: let promise = new Promise((resolve, reject) => { resolve("Success!"); }); promise.then(res => console.log(res));
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
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>
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Decorators modify classes or methods at runtime. Common in TypeScript and frameworks like Angular. Example (TypeScript): function log(target, key) { console.log(`${key} was called`); } class Example { @log test() {} }
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Define a variable with --name and access it with var().
Example:
:root {
}
button {
background: var(--main-color);
padding: var(--padding);
}
Follow me on LinkedIn:
Key Takeaway:
CSS variables make styles dynamic and reusable.
JavaScript JavaScript Tutorial · JavaScript
Answer: Using prototypes or classes. Example (ES6): class Animal { eat() { console.log("Eating"); } } class Dog extends Animal { bark() { console.log("Bark!"); } Follow me on LinkedIn: }
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: They are collections that hold weak references to objects — allowing garbage collection if no other reference exists. Example: let obj = {}; let wm = new WeakMap(); wm.set(obj, "value"); obj = null; // entry removed automatically
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Media queries apply styles based on device conditions (width, orientation, etc.). Example: @media (max-width: 768px) { body { background-color: lightgray; } } Key Takeaway: Media queries enable responsive design across devices.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Styled inputs, selects, and textareas: <input type="text" class="form-control" placeholder="Enter name">
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Async iterators allow looping over asynchronous data sources. Example: sync function* fetchItems() { yield await fetch('/item1'); yield await fetch('/item2'); } for await (let item of fetchItems()) { console.log(item); }
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
dvanced
What is the difference between order and offset classes?
<div class="col-md-4 order-2 offset-md-1"></div>
Follow me on LinkedIn:
JavaScript JavaScript Tutorial · JavaScript
Use Flexbox utilities:
<div class="d-flex align-items-center" style="height:200px;">
<p>Vertically centered</p>
</div>
Advanced
What is the difference between order and offset classes?
<div class="col-md-4 order-2 offset-md-1"></div>
Follow me on LinkedIn:
JavaScript JavaScript Tutorial · JavaScript
Prefixes ensure CSS works across browsers before full support.
Example:
Follow me on LinkedIn:
.box {
border-radius: 10px; /* Standard */
}
Key Takeaway:
Vendor prefixes provide cross-browser compatibility for experimental features.
IntermediateJavaScript JavaScript Tutorial · JavaScript
Answer: llowing access to outer function variables even after the outer function finishes.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Use a custom CSS file loaded after Bootstrap. Or customize variables via SCSS before compilation.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Modules are separate files that export code and import it elsewhere, ensuring encapsulation and reusability. Example: // export.js export const PI = 3.14; // import.js import { PI } from './export.js'; Follow me on LinkedIn:
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: They provide default values when no argument is passed. Example: function greet(name = "Guest") { return `Hello, ${name}`; }
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Closures work because functions remember the scope in which they were created, allowing access to outer function variables even after the outer function finishes.
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: Bootstrap 5 uses Flexbox by default for its grid system and utilities (.d-flex, .justify-content-*, .align-items-*).
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Answer: No own this No arguments object Cannot be used as constructors No super or new.target
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.
Tip: Practice aloud on Toolliyo mock interview or the Interview Q&A section before your real interview.
JavaScript JavaScript Tutorial · JavaScript
Example – private counter:
function createCounter() {
let count = 0; // private variable
return {
increment: () => ++count,
decrement: () => --count
};
}
const counter = createCounter();
console.log(counter.increment()); // 1
console.log(counter.decrement()); // 0