Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Pseudo-class: targets an element’s state. hover { color: red; } Pseudo-element: targets part of an element. p::first-line { font-weight: bold; } Follow me on LinkedIn: Key Takeaway: :hover changes behavior; ::before and…
Add the draggable="true" attribute and use drag events in JavaScript. Example: <p id="drag1" draggable="true" ondragstart="drag(event)">Drag me!</p> <script> function drag(e) { e.dataTransfer.setData("t…
Semantic elements clearly describe their purpose in the document structure. Examples include: <header>, <footer>, <article>, <nav>, <section>. Example: <article> <h2>Breaking New…
Answer: Hoisting is JavaScript’s behavior of moving variable and function declarations to the top of their scope during compilation. Example: console.log(a); // undefined var a = 5; Here, var a is hoisted but not initial…
<script> runs JavaScript. <noscript> displays content when JavaScript is disabled or not supported. Example: <script> document.write("JavaScript is enabled!"); Follow me on LinkedIn: </script> <…
Answer: Use the grid system and responsive classes: &lt;div class="col-12 col-md-6 col-lg-4"&gt;Responsive column&lt;/div&gt; What interviewers expect A clear definition tied to JavaScript in JavaScript p…
Answer: Shallow equality: Compares only top-level properties. Deep equality: Compares nested values recursively. Example: {a:1} === {a:1} // false (different refs) Use libraries like Lodash’s _.isEqual() for deep compari…
Answer: Template literals allow embedded expressions and multi-line strings using backticks (`). Example: let name = "John"; console.log(`Hello, ${name}!`); What interviewers expect A clear definition tied to JavaScript…
BEM is a naming convention for writing scalable and reusable CSS. Structure: .block__element--modifier Example: <div class="card card--featured"> <h2 class="card__title">Profile</h2> </div> Key Ta…
Use @keyframes and the animation property. Example: @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .box { nimation: fadeIn 2s ease-in-out; } Follow me on LinkedIn: Key Takeaway: @keyframes define the anima…
Answer: Using Flexbox: .parent { display: flex; justify-content: center; /* horizontal */ lign-items: center; /* vertical */ height: 100vh; } Key Takeaway: flexbox is the easiest and modern way to center elements. What i…
Semantic HTML elements (like <nav>, <main>, <form>, <button>) provide meaning to content — making it easier for assistive technologies to navigate. Example: <nav aria-label="Main navigation">…
The <head> tag contains metadata — information about the document that isn’t displayed on the page (like title, styles, or scripts). Example: <head> <title>Portfolio</title> <meta charset="UTF-…
Answer: Primitive types: stored in stack, immutable (number, string, boolean). Reference types: stored in heap, mutable (object, array, function). What interviewers expect A clear definition tied to JavaScript in JavaScr…
Answer: Specificity determines which rule wins when multiple styles target the same element. Priority order (lowest → highest): What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-…
Answer: bsolut Nearest positioned ncestor ✅ Yes Fixed Viewport ❌ No Example: div { position: absolute; top: 10px; left: 20px; } Key Takeaway: bsolute is relative to parent; fixed stays on screen. Follow me on LinkedIn: W…
Answer: Predefined classes that handle spacing, display, text, alignment, etc. Example: &lt;p class="text-center m-3 p-2"&gt;Centered text&lt;/p&gt; What interviewers expect A clear definition tied to Jav…
JS manages memory via automatic garbage collection. Memory allocation happens when objects are created, and deallocation occurs when they’re no longer reachable. Example: Creating large arrays without clearing references…
Answer: The rest operator ... collects multiple arguments into an array. Example: function sum(...nums) { return nums.reduce((a, b) =&gt; a + b); Follow me on LinkedIn: } console.log(sum(1, 2, 3)); // 6 What intervie…
Answer: Transitions animate property changes smoothly. Example: button { background: blue; transition: background 0.3s ease; } button:hover { background: red; } Key Takeaway: Transitions are great for hover effects and s…
Position Based On Moves with Page Scroll? Relative Its normal position ✅ Yes Absolut Nearest positioned ancestor ✅ Yes Fixed Viewport ❌ No Example: div { position: absolute; top: 10px; left: 20px; } Key Takeaway: Absolut…
Web Components are reusable custom elements built with: What interviewers expect A clear definition tied to JavaScript in JavaScript projects Trade-offs (performance, maintainability, security, cost) When you would and w…
Use CSS or the HTML5 srcset and sizes attributes. HTML Example: <img src="small.jpg" srcset="medium.jpg 768w, large.jpg 1200w" sizes="(max-width: 768px) 100vw, 50vw" lt="Mountain view"> CSS Example: img { max-width…
Answer: Use the &lt;img&gt; tag with the src and alt attributes. Example: &lt;img src="images/photo.jpg" alt="A sunset at the beach"&gt; Key Takeaway: The alt attribute improves accessibility and helps SE…
Answer: Values that evaluate to false in Boolean context: false, 0, "", null, undefined, NaN Example: if (!0) console.log("Falsy"); // prints "Falsy" What interviewers expect A clear definition tied to JavaScript in Java…
JavaScript JavaScript Tutorial · JavaScript
Pseudo-class: targets an element’s state.
hover { color: red; }
p::first-line { font-weight: bold; }
Key Takeaway:
:hover changes behavior; ::before and ::after insert content.
JavaScript JavaScript Tutorial · JavaScript
Add the draggable="true" attribute and use drag events in JavaScript.
Example:
<p id="drag1" draggable="true" ondragstart="drag(event)">Drag
me!</p>
<script>
function drag(e) {
e.dataTransfer.setData("text", e.target.id);
}
</script>
Key Takeaway:
Use draggable="true" plus ondragstart and ondrop to enable drag-and-drop
functionality.
JavaScript JavaScript Tutorial · JavaScript
Semantic elements clearly describe their purpose in the document structure.
Examples include: <header>, <footer>, <article>, <nav>, <section>.
Example:
<article>
<h2>Breaking News</h2>
<p>New tech trends are emerging every day.</p>
</article>
Key Takeaway:
Semantic tags improve SEO and accessibility.
JavaScript JavaScript Tutorial · JavaScript
Answer: Hoisting is JavaScript’s behavior of moving variable and function declarations to the top of their scope during compilation. Example: console.log(a); // undefined var a = 5; Here, var a is hoisted but not initialized.
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:
<script>
document.write("JavaScript is enabled!");
Follow me on LinkedIn:
</script>
<noscript>
<p>Please enable JavaScript to view this content.</p>
</noscript>
Key Takeaway:
<noscript> provides graceful fallback content.
JavaScript JavaScript Tutorial · JavaScript
Answer: Use the grid system and responsive classes: <div class="col-12 col-md-6 col-lg-4">Responsive column</div>
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: Shallow equality: Compares only top-level properties. Deep equality: Compares nested values recursively. Example: {a:1} === {a:1} // false (different refs) Use libraries like Lodash’s _.isEqual() for deep comparison. 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: Template literals allow embedded expressions and multi-line strings using backticks (`). Example: let name = "John"; console.log(`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
BEM is a naming convention for writing scalable and reusable CSS.
Structure:
.block__element--modifier
Example:
<div class="card card--featured">
<h2 class="card__title">Profile</h2>
</div>
Key Takeaway:
BEM enforces clarity:
JavaScript JavaScript Tutorial · JavaScript
Use @keyframes and the animation property.
Example:
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.box {
nimation: fadeIn 2s ease-in-out;
}
Follow me on LinkedIn:
Key Takeaway:
@keyframes define the animation steps; animation applies them.
JavaScript JavaScript Tutorial · JavaScript
Answer: Using Flexbox: .parent { display: flex; justify-content: center; /* horizontal */ lign-items: center; /* vertical */ height: 100vh; } Key Takeaway: flexbox is the easiest and modern way to center elements.
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
Semantic HTML elements (like <nav>, <main>, <form>, <button>) provide meaning to
content — making it easier for assistive technologies to navigate.
Example:
<nav aria-label="Main navigation">
<a href="#home">Home</a>
<a href="#about">About</a>
</nav>
dvantages:
Key Takeaway:
Semantics = communication between developers, browsers, and accessibility tools.
Follow me on LinkedIn:
JavaScript JavaScript Tutorial · JavaScript
The <head> tag contains metadata — information about the document that isn’t displayed
on the page (like title, styles, or scripts).
Example:
<head>
<title>Portfolio</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
</head>
Follow me on LinkedIn:
Key Takeaway:
Think of <head> as your page’s control room.
JavaScript JavaScript Tutorial · JavaScript
Answer: Primitive types: stored in stack, immutable (number, string, boolean). Reference types: stored in heap, mutable (object, array, function).
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: Specificity determines which rule wins when multiple styles target the same element. Priority order (lowest → highest):
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: bsolut Nearest positioned ncestor ✅ Yes Fixed Viewport ❌ No Example: div { position: absolute; top: 10px; left: 20px; } Key Takeaway: bsolute is relative to parent; fixed stays on screen. 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: Predefined classes that handle spacing, display, text, alignment, etc. Example: <p class="text-center m-3 p-2">Centered text</p>
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
JS manages memory via automatic garbage collection.
Memory allocation happens when objects are created, and deallocation occurs when they’re
no longer reachable.
Example:
Creating large arrays without clearing references may cause memory leaks.
JavaScript JavaScript Tutorial · JavaScript
Answer: The rest operator ... collects multiple arguments into an array. Example: function sum(...nums) { return nums.reduce((a, b) => a + b); Follow me on LinkedIn: } console.log(sum(1, 2, 3)); // 6
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: Transitions animate property changes smoothly. Example: button { background: blue; transition: background 0.3s ease; } button:hover { background: red; } Key Takeaway: Transitions are great for hover effects and simple UI feedback.
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
Position Based On Moves with Page
Scroll?
Relative Its normal position ✅ Yes
Absolut
Nearest positioned
ancestor
✅ Yes
Fixed Viewport ❌ No
Example:
div { position: absolute; top: 10px; left: 20px; }
Key Takeaway:
Absolute is relative to parent; fixed stays on screen.
Follow me on LinkedIn:
JavaScript JavaScript Tutorial · JavaScript
Web Components are reusable custom elements built with:
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
Use CSS or the HTML5 srcset and sizes attributes.
HTML Example:
<img
src="small.jpg"
srcset="medium.jpg 768w, large.jpg 1200w"
sizes="(max-width: 768px) 100vw, 50vw"
lt="Mountain view">
CSS Example:
img {
max-width: 100%;
height: auto;
}
Key Takeaway:
Responsive images adjust to different screen sizes for faster load and better UX.
JavaScript JavaScript Tutorial · JavaScript
Answer: Use the <img> tag with the src and alt attributes. Example: <img src="images/photo.jpg" alt="A sunset at the beach"> Key Takeaway: The alt attribute improves accessibility and helps SEO.
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: Values that evaluate to false in Boolean context: false, 0, "", null, undefined, NaN Example: if (!0) console.log("Falsy"); // prints "Falsy"
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.