JavaScript Core ⚡ Recently updatedUpdated on Jun 30, 2026 — this content may still be evolving.
JavaScript Core: Mock Interview (45 Minutes)
Use with a friend. One interviewer, one candidate. Switch roles after.
Rules:
- Candidate answers out loud — no reading notes
- Interviewer asks 2+ follow-ups per question
- Section 4 requires writing code on paper or editor
Section 1: Warm-up (5 min)
- “Tell me about a project where JavaScript was central.”
- “What was the hardest bug you fixed in JS?”
- “Which JS concept took you longest to understand?”
Interviewer: Note if they mention async, closures, or debugging process.
Section 2: Fundamentals (10 min)
- “Explain the difference between
var,let, andconst.”- Follow-up: “What is the temporal dead zone?”
- “What is a closure? Give a real use case.”
- Follow-up: “Why does
varin a loop with setTimeout print 3 three times?”
- Follow-up: “Why does
- “Explain
==vs===with an example that behaves differently.”
Section 3: this & Prototypes (8 min)
- “How does
thiswork in JavaScript?”- Follow-up: “What’s different about arrow functions and
this?”
- Follow-up: “What’s different about arrow functions and
- “What is the prototype chain?”
- Follow-up: “How does
instanceofwork?”
- Follow-up: “How does
- “What do
call,apply, andbinddo?”
Section 4: Live Coding (12 min)
Pick ONE:
Option A: Implement debounce
“Write a debounce function. Explain when you’d use it.”
Evaluation: Correct timer logic, mentions search/resize use case.
Option B: Flatten array
“Flatten a nested array one level deep without
.flat().”
function flatten(arr) {
return arr.reduce((acc, val) =>
acc.concat(Array.isArray(val) ? val : [val]), []);
}
Option C: Promise.all polyfill
“Implement a basic
Promise.all.”
Follow-ups:
- “What happens if one promise rejects?”
- “Does order of results match input order?”
Section 5: Async & Event Loop (5 min)
- Output question: “What prints and in what order?”
console.log('A');
setTimeout(() => console.log('B'), 0);
Promise.resolve().then(() => console.log('C'));
console.log('D');
Answer: A, D, C, B
- “Explain the difference between microtasks and macrotasks.”
- Follow-up: “Where does
async/awaitfit in?”
- Follow-up: “Where does
Section 6: Tricky & Project (5 min)
Pick 2:
- “What is
0.1 + 0.2 === 0.3? Why?” - “Shallow vs deep copy — how do you do each?”
- “Walk me through how
fetchworks in your project.” - “What would you use: debounce or throttle for infinite scroll?”
Project connection:
- “Show me one async flow in your codebase.”
- “If you refactored one JS file, what would you improve?”
Evaluation Rubric
| Area | 1 (Weak) | 3 (Good) | 5 (Strong) |
|---|---|---|---|
| Closures/scope | Vague definition | Correct with example | Explains loop fix + use cases |
this | Always global | Knows rules | Arrow vs regular + fixes |
| Async | ”Promises are async” | Event loop order | Micro/macrotask + error handling |
| Live coding | Can’t start | Working with hints | Clean, explains edge cases |
| Communication | Memorized defs | Clear examples | Tradeoffs + project links |
Debrief (5 min)
Candidate asks:
- Which topics felt shaky?
- Did I explain my code while writing?
- Was I honest when I didn’t know something?
Homework: Redo missed sections from interview-questions.md + one polyfill from polyfills.md blind.