JS Interview Prep
JavaScript interviews recycle a small set of topics. Master these and you'll handle 80% of what gets asked — for the rest, talking through your reasoning matters more than knowing the answer cold.
The questions you'll hear most
| Question | Topic to revise |
|---|---|
Difference between var, let, and const. | let + const |
| What is hoisting? When does it bite? | hoisting |
How does this behave? | this + invocation |
| What is a closure? | closures |
| How do promises work? Async/await? | promises + async/await |
| Explain the event loop in 30 seconds. | async |
Difference between == and ===. | comparisons |
| Shallow vs. deep clone an object. | spread / structuredClone |
| Map vs. Object — when to use which? | maps |
| Event delegation — why and how? | event listener |
| Debounce vs throttle. | timing + closures |
| What is prototype inheritance? | prototypes |
The "FizzBuzz-ish" coding warmup
JS
for (let i = 1; i <= 100; i++) {
let out = "";
if (i % 3 === 0) out += "Fizz";
if (i % 5 === 0) out += "Buzz";
console.log(out || i);
}
Interview habits
- Talk through your reasoning — interviewers listen for the why, not just the what.
- Write a small failing test first; pass it; refactor.
- If you don't know, say so — then explain how you'd find out.
- Mention trade-offs (readability vs. performance, ECMA support vs. polyfills) — shows seniority.
Tip: Practice live-coding small components (debounce, deep clone, simple promise) in 5 minutes each. Interviewers reuse these prompts constantly.
Example
Example
<!DOCTYPE html>
<html>
<body>
<p id="out"></p>
<script>
document.getElementById("out").textContent = "Hello from JS Interview Prep!";
</script>
</body>
</html>
Try it Yourself »
Exercise
A frequently-asked interview question is "Explain the difference between var, let, and …".
Answer:
Five letters.
Discussion
Loading…