Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short answer: They allow you to store extra data on HTML elements — useful for scripts or dynamic behavior. Example code <button data-user-id="101" data-role="admin">View Profile</button>…
Short answer: Block-level elements start on a new line and take full width (e.g., <div>, <p>, <section>). Inline elements stay within a line (e.g., <span>, <a>, <strong>). Example code…
Short answer: Override variables using SCSS. Use Bootstrap’s Theme Customizer or utility API. Or override styles in a custom CSS file. Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch A…
Short answer: Promises handle asynchronous operations. They represent a value that may be available now, later, or never. Example code let promise = new Promise((resolve, reject) => { resolve("Success!"); })…
Short answer: Use .navbar and .navbar-expand-* classes: Follow me on LinkedIn: <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">Brand&…
Short 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`); } Example code class Ex…
Short answer: Define a variable with --name and access it with var(). Example code :root { -main-color: #007bff; -padding: 10px; } button { background: var(--main-color); padding: var(--padding); } Follow me on LinkedIn:…
Short 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: } Example…
Short 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 = nul…
Short answer: Media queries apply styles based on device conditions (width, orientation, etc.). Example code @media (max-width: 768px) { body { background-color: lightgray; } } Key Takeaway: Media queries enable responsi…
Short answer: Styled inputs, selects, and textareas: <input type="text" class="form-control" placeholder="Enter name"> Real-world example (ShopNest) ShopNest’s browser cart uses modern…
Short answer: Async iterators allow looping over asynchronous data sources. Example: async function* fetchItems() { yield await fetch('/item1'); yield await fetch('/item2'); } for await (let item of fetchItems()) { conso…
Short answer: 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…
Short answer: Use Flexbox utilities: <div class="d-flex align-items-center" style="height:200px;"> <p>Vertically centered</p> </div> Advanced What is the difference between ord…
Short answer: Prefixes ensure CSS works across browsers before full support. Example code Follow me on LinkedIn: .box { webkit-border-radius: 10px; /* Chrome, Safari */ moz-border-radius: 10px; /* Firefox */ border-radiu…
Short answer: llowing access to outer function variables even after the outer function finishes. Real-world example (ShopNest) In ShopNest’s cart UI, a click handler closes over productId . Use let in loops so each butto…
Short answer: Use a custom CSS file loaded after Bootstrap. Or customize variables via SCSS before compilation. Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, m…
Short answer: Modules are separate files that export code and import it elsewhere, ensuring encapsulation and reusability. Example code // export.js export const PI = 3.14; // import.js import { PI } from './export.js';…
Short answer: They provide default values when no argument is passed. Example: function greet(name = "Guest") { return `Hello, ${name}`; } Example code They provide default values when no argument is passed. Ex…
Short 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. Real-world example (ShopNest) In ShopNest’s…
Short answer: Bootstrap 5 uses Flexbox by default for its grid system and utilities (.d-flex, .justify-content-*, .align-items-*). Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs…
Short answer: No own this No arguments object Cannot be used as constructors No super or new.target Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and…
Short answer: Data privacy / encapsulation Callbacks and event handlers Memoization / caching Module pattern for structuring code Example – private counter: function createCounter() { let count = 0; // private variable E…
Short answer: Use margin (m-*) and padding (p-*) utilities: <div class="p-3 m-2 text-center"></div> Real-world example (ShopNest) ShopNest’s browser cart uses modern JavaScript: fetch APIs with asyn…
Short answer: Context this Refers To Follow me on LinkedIn: Global window or global Method The object owning the method Constructor The new instance Arrow function Lexical (surrounding) scope Example code const obj = { v…
JavaScript JavaScript Tutorial · JavaScript
Short answer: They allow you to store extra data on HTML elements — useful for scripts or dynamic behavior.
<button data-user-id="101" data-role="admin">View Profile</button> <script> const btn = document.querySelector("button"); console.log(btn.dataset.userId); // 101 console.log(btn.dataset.role); // admin </script> Key Takeaway: data-* attributes are perfect for embedding small pieces of custom data without affecting layout. Follow me on LinkedIn: Advanced
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Block-level elements start on a new line and take full width (e.g., <div>, <p>, <section>). Inline elements stay within a line (e.g., <span>, <a>, <strong>).
<div>Block</div> <span>Inline</span> Key Takeaway: Block = structure; Inline = styling or small content.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Override variables using SCSS. Use Bootstrap’s Theme Customizer or utility API. Or override styles in a custom CSS file.
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Promises handle asynchronous operations. They represent a value that may be available now, later, or never.
let promise = new Promise((resolve, reject) => { resolve("Success!"); }); promise.then(res => console.log(res));
The checkout button uses async/await to call /api/orders, shows a spinner, and catches network errors with a toast.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Use .navbar and .navbar-expand-* classes: Follow me on LinkedIn: <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">Brand</a> </nav>
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short 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() {} }
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Define a variable with --name and access it with var().
:root { -main-color: #007bff; -padding: 10px; } button { background: var(--main-color); padding: var(--padding); } Follow me on LinkedIn: Key Takeaway: CSS variables make styles dynamic and reusable.
In ShopNest’s cart UI, a click handler closes over productId. Use let in loops so each button keeps the correct id.
JavaScript JavaScript Tutorial · JavaScript
Short 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: }
Using prototypes or classes. Example (ES6): class Animal { eat() { console.log("Eating"); } }
class Dog extends Animal { bark() { console.log("Bark!"); } Follow me on LinkedIn: }
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short 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
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
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Media queries apply styles based on device conditions (width, orientation, etc.).
@media (max-width: 768px) { body { background-color: lightgray; } } Key Takeaway: Media queries enable responsive design across devices.
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Styled inputs, selects, and textareas: <input type="text" class="form-control" placeholder="Enter name">
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Async iterators allow looping over asynchronous data sources. Example: async function* fetchItems() { yield await fetch('/item1'); yield await fetch('/item2'); } for await (let item of fetchItems()) { console.log(item); }
Async iterators allow looping over asynchronous data sources. Example: async function* fetchItems() { yield await fetch('/item1'); yield await fetch('/item2'); }
for await (let item of fetchItems()) { console.log(item); }
The checkout button uses async/await to call /api/orders, shows a spinner, and catches network errors with a toast.
JavaScript JavaScript Tutorial · JavaScript
Short answer: 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> Follow me on LinkedIn:
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: 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-*: Changes element order in flex containers. .offset-*: Adds left margin space in grids. <div class="col-md-4 order-2 offset-md-1"></div> Follow me on LinkedIn:
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Prefixes ensure CSS works across browsers before full support.
Follow me on LinkedIn: .box { webkit-border-radius: 10px; /* Chrome, Safari */ moz-border-radius: 10px; /* Firefox */ border-radius: 10px; /* Standard */ } Key Takeaway: Vendor prefixes provide cross-browser compatibility for experimental features. Intermediate
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: llowing access to outer function variables even after the outer function finishes.
In ShopNest’s cart UI, a click handler closes over productId. Use let in loops so each button keeps the correct id.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Use a custom CSS file loaded after Bootstrap. Or customize variables via SCSS before compilation.
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Modules are separate files that export code and import it elsewhere, ensuring encapsulation and reusability.
// export.js export const PI = 3.14; // import.js import { PI } from './export.js'; Follow me on LinkedIn:
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: They provide default values when no argument is passed. Example: function greet(name = "Guest") { return `Hello, ${name}`; }
They provide default values when no argument is passed. Example: function greet(name = "Guest") { return `Hello, ${name}`;
}
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short 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 ShopNest’s cart UI, a click handler closes over productId. Use let in loops so each button keeps the correct id.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Bootstrap 5 uses Flexbox by default for its grid system and utilities (.d-flex, .justify-content-*, .align-items-*).
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: No own this No arguments object Cannot be used as constructors No super or new.target
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: 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 { increment: () => ++count, decrement: () => --count }; }
const counter = createCounter(); console.log(counter.increment()); // 1 console.log(counter.decrement()); // 0
In ShopNest’s cart UI, a click handler closes over productId. Use let in loops so each button keeps the correct id.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Use margin (m-*) and padding (p-*) utilities: <div class="p-3 m-2 text-center"></div>
ShopNest’s browser cart uses modern JavaScript: fetch APIs with async/await, modules, and clear error handling.
JavaScript JavaScript Tutorial · JavaScript
Short answer: Context this Refers To Follow me on LinkedIn: Global window or global Method The object owning the method Constructor The new instance Arrow function Lexical (surrounding) scope
const obj = { value: 10, show: function() { console.log(this.value); } }; obj.show(); // 10
Prefer arrow functions for React/event callbacks in ShopNest so this is not accidentally rebound.
Install Toolliyo like an app Free
Home-screen access to tutorials, coding practice & career tools — no app store needed.
On iPhone/iPad: tap Share then Add to Home Screen.