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 1776–1800 of 3281

Career & HR topics

By tech stack

Popular tracks

Mid PDF
How can you implement inheritance in 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: } Example…

JavaScript Read answer
Mid PDF
What are WeakMap and WeakSet?

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…

JavaScript Read answer
Mid PDF
What are media queries?

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…

JavaScript Read answer
Mid PDF
What are form controls in Bootstrap?

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…

JavaScript Read answer
Mid PDF
What are async iterators?

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…

JavaScript Read answer
Mid PDF
How can you align elements vertically in Bootstrap?

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…

JavaScript Read answer
Mid PDF
How can you align elements vertically in Bootstrap?

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…

JavaScript Read answer
Mid PDF
What are vendor prefixes?

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…

JavaScript Read answer
Mid PDF
How do closures work in JavaScript?

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…

JavaScript Read answer
Mid PDF
How do you override Bootstrap styles?

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…

JavaScript Read answer
Mid PDF
How do modules work in JavaScript?

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';…

JavaScript Read answer
Mid PDF
What are default parameters in functions?

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…

JavaScript Read answer
Mid PDF
How do closures work in 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. Real-world example (ShopNest) In ShopNest’s…

JavaScript Read answer
Mid PDF
How does Bootstrap handle flexbox layouts?

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…

JavaScript Read answer
Mid PDF
What are arrow functions’ limitations?

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…

JavaScript Read answer
Mid PDF
What are common use cases of closures?

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…

JavaScript Read answer
Mid PDF
How do you use Bootstrap utilities for spacing and alignment?

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…

JavaScript Read answer
Mid PDF
How does the “this” keyword work in different contexts?

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 Read answer
Mid PDF
What are arrow functions and how are they different from normal functions?

Short answer: Arrow functions are shorter, and they don’t have their own this, arguments, or prototype. Follow me on LinkedIn: Example code const obj = { val: 10, normal() { console.log(this.val); }, // Works arrow: () =…

JavaScript Read answer
Mid PDF
Can you create a private variable using closure?

Short answer: Yes. Variables inside the outer function cannot be accessed directly, only via inner functions. Example code See createCounter() above. Real-world example (ShopNest) In ShopNest’s cart UI, a click handler c…

JavaScript Read answer
Mid PDF
How can you use Bootstrap with React?

Short answer: Install React-Bootstrap (npm install react-bootstrap bootstrap). Import components: import { Button } from 'react-bootstrap'; <Button variant="primary">Click</Button> Real-world exampl…

JavaScript Read answer
Mid PDF
How can you handle asynchronous errors?

Short answer: Use try...catch inside async functions or .catch() for Promises. Example: async function loadData() { try { const res = await fetch('/data'); return await res.json(); } catch (err) { console.error("Err…

JavaScript Read answer
Mid PDF
How do you handle errors in JavaScript?

Short answer: Using try...catch...finally or Promise .catch(). Example: try { throw new Error("Something went wrong!"); } catch (err) { console.error(err.message); } finally { console.log("Cleanup code&quo…

JavaScript Read answer
Mid PDF
What are mixins in Bootstrap’s SCSS files?

Short answer: Reusable SCSS functions that generate CSS dynamically. Example: @include border-radius(10px); Example code Reusable SCSS functions that generate CSS dynamically. Example: @include border-radius(10px); Real-…

JavaScript Read answer
Mid PDF
How do you create an object?

Short answer: Using object literal: {} Using new Object() constructor Example: let car = { brand: "Tesla", model: "Model 3" }; let car2 = new Object(); car2.brand = "BMW"; Example code Using…

JavaScript Read answer

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

Example code

Using prototypes or classes. Example (ES6): class Animal { eat() { console.log("Eating"); } }
class Dog extends Animal { bark() { console.log("Bark!"); } 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: 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

Example code

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

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: 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 responsive design across devices.

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: Styled inputs, selects, and textareas: <input type="text" class="form-control" placeholder="Enter name">

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: 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); }

Example code

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); }

Real-world example (ShopNest)

The checkout button uses async/await to call /api/orders, shows a spinner, and catches network errors with a toast.

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

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

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: 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-radius: 10px; /* Standard */ } Key Takeaway: Vendor prefixes provide cross-browser compatibility for experimental features. Intermediate

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: 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 button keeps the correct id.

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 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, 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: 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'; 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: 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. Example: function greet(name = "Guest") { return `Hello, ${name}`;
}

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: 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 cart UI, a click handler closes over productId. Use let in loops so each button keeps the correct id.

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: 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 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: 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 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: Data privacy / encapsulation Callbacks and event handlers Memoization / caching Module pattern for structuring code Example – private counter: function createCounter() { let count = 0; // private variable

Example code

return { increment: () => ++count, decrement: () => --count }; }
const counter = createCounter(); console.log(counter.increment()); // 1 console.log(counter.decrement()); // 0

Real-world example (ShopNest)

In ShopNest’s cart UI, a click handler closes over productId. Use let in loops so each button keeps the correct id.

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 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 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: 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 = { value: 10, show: function() { console.log(this.value); } }; obj.show(); // 10

Real-world example (ShopNest)

Prefer arrow functions for React/event callbacks in ShopNest so this is not accidentally rebound.

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 shorter, and they don’t have their own this, arguments, or prototype. Follow me on LinkedIn:

Example code

const obj = { val: 10, normal() { console.log(this.val); }, // Works arrow: () => console.log(this.val), // Undefined (no own this) };

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: Yes. Variables inside the outer function cannot be accessed directly, only via inner functions.

Example code

See createCounter() above.

Real-world example (ShopNest)

In ShopNest’s cart UI, a click handler closes over productId. Use let in loops so each button keeps the correct id.

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: Install React-Bootstrap (npm install react-bootstrap bootstrap). Import components: import { Button } from 'react-bootstrap'; <Button variant="primary">Click</Button>

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 try...catch inside async functions or .catch() for Promises. Example: async function loadData() { try { const res = await fetch('/data'); return await res.json(); } catch (err) { console.error("Error:", err); } Follow me on LinkedIn: } Advanced

Example code

Use try...catch inside async functions or .catch() for Promises. Example: async function loadData() { try { const res = await fetch('/data');
return await res.json(); } catch (err) { console.error("Error:", err); } Follow me on LinkedIn: } Advanced

Real-world example (ShopNest)

The checkout button uses async/await to call /api/orders, shows a spinner, and catches network errors with a toast.

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: Using try...catch...finally or Promise .catch(). Example: try { throw new Error("Something went wrong!"); } catch (err) { console.error(err.message); } finally { console.log("Cleanup code"); } Intermediate

Example code

Using try...catch...finally or Promise .catch(). Example: try { throw new Error("Something went wrong!"); } catch (err) { console.error(err.message); } finally { console.log("Cleanup code"); }
Intermediate

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 SCSS functions that generate CSS dynamically. Example: @include border-radius(10px);

Example code

Reusable SCSS functions that generate CSS dynamically. Example: @include border-radius(10px);

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: Using object literal: {} Using new Object() constructor Example: let car = { brand: "Tesla", model: "Model 3" }; let car2 = new Object(); car2.brand = "BMW";

Example code

Using object literal: {} Using new Object() constructor Example: let car = { brand: "Tesla", model: "Model 3" };
let car2 = new Object();
car2.brand = "BMW";

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