Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Answer: A style where functions are pure, stateless, and composable. Example: const double = x => x * 2; const square = x => x * x; const result = square(double(3)); // 36 What interviewers expect A clear d…
Type Description Shallow Copy Copies top-level properties only Deep Copy Copies all nested objects too Follow me on LinkedIn: Example: const obj = { a: { b: 1 } }; const shallow = { ...obj }; // same reference const deep…
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(re…
Unit Relative To Example em Parent’s font size 2em = 2 × parent font-size rem Root (<html>) font size 2rem = 2 × root font-size Example: html { font-size: 16px; } p { font-size: 2rem; } /* = 32px */ Key Takeaway: U…
The alt attribute provides alternative text when an image fails to load and is read by screen readers. Example: Follow me on LinkedIn: <img src="team.jpg" alt="Our development team"> Key Takeaway: lways include mea…
Answer: function that accepts another function as a parameter or returns a function. Example: function multiplyBy(factor) { return x =&gt; x * factor; } const double = multiplyBy(2); console.log(double(5)); // 10 Wha…
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()…
Answer: Promise chaining allows multiple async tasks to run sequentially. Example: fetch('/data') .then(res =&gt; res.json()) .then(data =&gt; console.log(data)) .catch(err =&gt; console.error(err)); What int…
Answer: DOM (Document Object Model) represents the structure of an HTML document as a tree of objects, allowing JavaScript to access and manipulate elements dynamically. Follow me on LinkedIn: What interviewers expect A…
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…
<b> only makes text bold visually. <strong> adds semantic meaning (important text). Example: <b>Warning:</b> Incorrect password.<br> <strong>Warning:</strong> Incorrect password.…
Answer: function passed as an argument to another function to be executed later. Example: function greet(name, callback) { console.log(`Hello, ${name}`); callback(); } greet("Sandeep", () =&gt; console.log("Callback…
Answer: Provides consistent button styling: &lt;button class="btn btn-primary"&gt;Click&lt;/button&gt; What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (per…
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: JSON (JavaScript Object Notation) is a lightweight format for storing and transferring data. Example: let obj = { name: "Bob" }; let json = JSON.stringify(obj); // Convert to JSON string What interviewers expect…
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…
<i> makes text italic for style only. <em> gives emphasis that can change meaning. Example: <i>Book titles</i> are italicized. Please <em>do not</em> touch that. Follow me on LinkedIn:…
Answer: function that: Always returns the same output for the same input Has no side effects (doesn’t modify external variables) Example: function sum(a, b) { return a + b; } What interviewers expect A clear definition t…
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(…
Answer: Method Mutates Original? Purpose slice(start, end) ❌ No Extracts portion Follow me on LinkedIn: splice(start, count, ...items) ✅ Yes Adds/removes items What interviewers expect A clear definition tied to JavaScri…
Answer: localStorage stores key-value pairs in the browser permanently (until cleared). Example: localStorage.setItem("user", "Alice"); console.log(localStorage.getItem("user")); // Alice What interviewers expect A clear…
Answer: float moves elements to the left or right — allowing text and inline elements to wrap round. Example: img { float: right; margin: 10px; } Key Takeaway: Used for text wrapping, but Flexbox/Grid is better for layou…
JavaScript JavaScript Tutorial · JavaScript
Answer: A style where functions are pure, stateless, and composable. Example: const double = x => x * 2; const square = x => x * x; const result = square(double(3)); // 36
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
Type Description
Shallow
Copy
Copies top-level properties only
Deep Copy Copies all nested objects too
Follow me on LinkedIn:
Example:
const obj = { a: { b: 1 } };
const shallow = { ...obj }; // same reference
const deep = JSON.parse(JSON.stringify(obj)); // new copyJavaScript 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
Unit Relative To Example
em Parent’s font size 2em = 2 × parent
font-size
rem Root (<html>) font
size
2rem = 2 × root font-size
Example:
html { font-size: 16px; }
p { font-size: 2rem; } /* = 32px */
Key Takeaway:
Use rem for consistent sizing across the document.
JavaScript JavaScript Tutorial · JavaScript
The alt attribute provides alternative text when an image fails to load and is read by
screen readers.
Example:
Follow me on LinkedIn:
<img src="team.jpg" alt="Our development team">
Key Takeaway:
lways include meaningful alt text — it’s good for accessibility and SEO.
JavaScript JavaScript Tutorial · JavaScript
Answer: function that accepts another function as a parameter or returns a function. Example: function multiplyBy(factor) { return x => x * factor; } const double = multiplyBy(2); console.log(double(5)); // 10
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
Answer: Promise chaining allows multiple async tasks to run sequentially. Example: fetch('/data') .then(res => res.json()) .then(data => console.log(data)) .catch(err => console.error(err));
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: DOM (Document Object Model) represents the structure of an HTML document as a tree of objects, allowing JavaScript to access and manipulate elements dynamically. 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
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
Example:
<b>Warning:</b> Incorrect password.<br>
<strong>Warning:</strong> Incorrect password.
Key Takeaway:
Use <strong> for emphasis that affects meaning.
JavaScript JavaScript Tutorial · JavaScript
Answer: function passed as an argument to another function to be executed later. Example: function greet(name, callback) { console.log(`Hello, ${name}`); callback(); } greet("Sandeep", () => console.log("Callback executed"));
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: Provides consistent button styling: <button class="btn btn-primary">Click</button>
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: 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: JSON (JavaScript Object Notation) is a lightweight format for storing and transferring data. Example: let obj = { name: "Bob" }; let json = JSON.stringify(obj); // Convert to JSON string
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
Example:
<i>Book titles</i> are italicized.
Please <em>do not</em> touch that.
Follow me on LinkedIn:
Key Takeaway:
<em> adds importance — <i> adds style.
JavaScript JavaScript Tutorial · JavaScript
Answer: function that: Always returns the same output for the same input Has no side effects (doesn’t modify external variables) Example: function sum(a, b) { return a + b; }
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
Answer: Method Mutates Original? Purpose slice(start, end) ❌ No Extracts portion Follow me on LinkedIn: splice(start, count, ...items) ✅ Yes Adds/removes 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: localStorage stores key-value pairs in the browser permanently (until cleared). Example: localStorage.setItem("user", "Alice"); console.log(localStorage.getItem("user")); // Alice
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: float moves elements to the left or right — allowing text and inline elements to wrap round. Example: img { float: right; margin: 10px; } Key Takeaway: Used for text wrapping, but Flexbox/Grid is better for layout today.
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.