Interview Insights · JavaScript
Why JavaScript Questions Reveal More Than Any Resume Line
Quick summary — JavaScript depth
A resume line says you have met JavaScript; a question shows how well you know it. Skills sections all look alike, because candidates copy the same keywords from job posts. Interviewers know this, so they use small, targeted questions to turn each keyword into evidence. A question about sorting numbers reveals whether you have hit real bugs. A question about click handlers on a long list reveals whether you understand event bubbling. This page shows which questions reveal the most, what they tell the interviewer, and how to answer in a way that reveals your real depth.
In this guide you will learn:
- Why resume skill lines carry so little weight on their own
- Small JavaScript questions that reveal real experience, with code
- What each answer level tells the interviewer
- How to attach evidence to every answer you give
- A practice sheet to turn your skills list into stories
SECTION 01What a resume line cannot tell an interviewer
When I read 'JavaScript, ES6, DOM manipulation, async programming', I learn which words you know. I do not learn whether you have built anything with them, whether you have debugged a real problem, or whether you understand why the code works. Two candidates with identical skill lines can be months apart in real ability.
So the interview becomes a translation exercise. I take each keyword and ask a question small enough to answer quickly but specific enough that only real use produces a good answer. In Uncodemy mock interviews, this is often the first exercise we do: pick a keyword from the student's own resume and ask one question about it.
| Resume line | What it claims | What it hides | A question that reveals it |
|---|---|---|---|
| ES6+ | Modern syntax knowledge | Whether you know the behaviour behind it | What does [10, 9, 1].sort() return? |
| DOM manipulation | You can change the page | Whether you understand events | How would you handle clicks on 1000 list items? |
| Async programming | You use promises | Whether you handle failures | How do you catch errors with async/await? |
| OOP in JavaScript | You write classes | Whether you know prototypes | What does class compile down to, conceptually? |
const nums = [10, 9, 1, 25];
console.log(nums.sort());
// [ 1, 10, 25, 9 ] - default sort compares as strings
console.log(nums.sort((a, b) => a - b));
// [ 1, 9, 10, 25 ] - numeric comparator
console.log(nums);
// [ 1, 9, 10, 25 ] - sort changed the original array
const sortedCopy = [...nums].sort((a, b) => b - a);
// or nums.toSorted((a, b) => b - a) in newer enginesLevel 1: "It returns 1, 9, 10, 25."
-> Has not hit this in real code.
Level 2: "It sorts as strings, so 10 comes before 9.
You pass (a, b) => a - b."
-> Has used sort with numbers.
Level 3: Level 2 plus "and sort mutates the array,
so I copy it first if the original is used
elsewhere, like React state."
-> Has debugged a real bug caused by mutation.
One question, three clearly different candidates.
The third level is what I hope to hear. Mentioning that sort mutates the array, and why that matters for something like React state, connects a language detail to a real consequence. No resume line can show that.
SECTION 02Small questions that reveal real JavaScript experience
The best revealing questions are small. They do not need a long coding exercise. They target a behaviour that people who have built things have run into, and people who have only read about it usually have not. Event handling on lists, error handling with async/await and the prototype chain are three I use often.
For each question below, the code shows what a strong answer looks like. Notice that strong answers mention why and where, not just what.
| Question | Weak answer | Strong answer | What the strong answer reveals |
|---|---|---|---|
| Clicks on 1000 list items? | Add a listener to each item | One listener on the parent, check event.target | Understands bubbling and memory cost |
| Errors with async/await? | Use .catch | try/catch around await, plus a finally for loading state | Has built real loading and error UI |
| What is a prototype? | It is like a class | Objects delegate missing properties up the prototype chain | Knows what class syntax sits on |
| map vs forEach? | Both loop | map returns a new array; forEach returns undefined | Writes functional transformations |
// One listener for the whole list, including items added later
const list = document.querySelector("#todo-list");
list.addEventListener("click", (event) => {
const item = event.target.closest("li");
if (!item || !list.contains(item)) return;
if (event.target.matches(".delete-btn")) {
item.remove();
} else {
item.classList.toggle("done");
}
});
// Spoken:
// "Clicks bubble up from the button to the li to the ul.
// I listen once on the ul and use closest() to find the
// li that was clicked. New items work automatically,
// and I avoid a thousand separate listeners."async function loadOrders(showSpinner, render, showError) {
showSpinner(true);
try {
const res = await fetch("/api/orders");
if (!res.ok) throw new Error("HTTP " + res.status);
const orders = await res.json();
render(orders);
} catch (err) {
showError("Could not load orders. Please retry.");
console.error(err);
} finally {
showSpinner(false); // runs on success AND failure
}
}
// The detail that reveals experience: finally.
// Without it, a failed request leaves the spinner
// spinning forever.
For the prototype question, a short demonstration works well: class Dog { bark() {} } puts bark on Dog.prototype, not on each dog. So new Dog().hasOwnProperty('bark') is false, but 'bark' in new Dog() is true, because the lookup walks up the chain. That one line shows you know what the class syntax is doing underneath.
SECTION 03How to answer so your depth shows
If questions are how interviewers see past your resume, then your answers are your chance to show what the resume could not. The trick is to attach evidence to each answer: a place you used the idea, a bug you hit, or a reason you chose one approach over another.
You do not need a long story every time. One sentence of evidence after the technical answer is enough. 'I ran into this when my sorted product list changed the original array in state' turns a correct answer into a believable one.
| Answer part | Purpose | Example for map vs forEach | Length |
|---|---|---|---|
| Direct answer | Answer the exact question | map returns a new array, forEach returns undefined | One sentence |
| Reason | Show you understand why | map is for transforming data, forEach for side effects | One sentence |
| Evidence | Show you have used it | I used map to turn API data into card props | One sentence |
| Edge or pitfall | Show depth | Using map without return gives an array of undefined | Optional, one sentence |
Q: What is the difference between map and forEach?
A: map returns a new array and forEach does not.
(Correct. But it sounds read, not lived.
The interviewer still has no evidence.)Q: What is the difference between map and forEach?
A: map returns a new array of transformed values;
forEach just runs a function and returns undefined.
I use map for things like turning API results into
the shape my components need:
const cards = products.map((p) => ({
id: p.id,
title: p.name,
price: "Rs " + p.price.toFixed(2)
}));
One mistake I made early was using curly braces in
the arrow function without return, which gave me an
array of undefined.
The evidence sentence is what makes the answer stick. Interviewers meet many candidates in a hiring cycle. The one who mentioned a real mistake and how they fixed it is the one they remember when writing feedback.
SECTION 04Practice sheet: turn your skills list into evidence
Take the JavaScript line from your own resume and work through these sheets. By the end, every keyword should have a question you can answer, a reason and a piece of evidence.
KEYWORD TO QUESTION
For each keyword on your resume, write the question
an interviewer would most likely ask:
ES6+ -> ______________________
DOM -> ______________________
Async / fetch -> ______________________
Array methods -> ______________________
Closures -> ______________________
Local storage -> ______________________
Now answer each one aloud in under 60 seconds.
If you cannot, the keyword needs practice or removal.EVIDENCE BANK
Keyword: ______________
Where I used it (project + feature):
________________________________
A bug or surprise it caused:
________________________________
How I fixed or handled it:
________________________________
One-sentence evidence line:
________________________________
Fill one card per keyword. Read them the morning
of the interview, not the night before.DEPTH LADDER (test yourself)
Pick one topic, then answer each rung aloud:
Rung 1: What does it do?
Rung 2: Why does it behave that way?
Rung 3: Where have I used it?
Rung 4: What can go wrong?
Rung 5: How would I explain it to a junior?
Example topic: event delegation
1. One listener on a parent handles child events
2. Events bubble from target up to ancestors
3. Todo list delete buttons
4. Clicks on nested elements: use closest()
5. "Like one receptionist handling a whole floor"
SECTION 05Habits that make every JavaScript answer count
These habits help each answer reveal your real level instead of hiding it behind a definition.
- Trim your skills section — List only the JavaScript topics you can answer a follow-up on. A shorter honest list makes every question land on solid ground.
- Lead with the direct answer — Answer the question in the first sentence, then add the reason and evidence. Interviewers should never wait for the point.
- Mention mutation and side effects — Details like sort changing the original array show that you think about how code behaves in a real app.
- Show, then tell — A three-line snippet often explains more than a paragraph. Offer to write it when the topic allows.
- Keep project code handy — Being able to open your own project and point to where you used a technique is the strongest evidence there is.
SECTION 06Interview Q&A — JavaScript depth
Q1Why does [10, 9, 1].sort() not sort numbers correctly?
Without a comparator, sort converts elements to strings and compares them in UTF-16 code unit order. As strings, '10' comes before '9' because '1' comes before '9'. Pass a comparator like (a, b) => a - b for numeric order. Also note that sort mutates the array in place.
Q2What is event delegation and why use it?
Event delegation means adding one listener to a parent element instead of many listeners to its children. Events bubble up from the clicked element, so the parent can check event.target, often with closest(), to see which child was clicked. It uses less memory and works automatically for children added later.
Q3How do you handle errors with async/await?
Wrap the awaited calls in try/catch. Check response.ok for fetch, because HTTP errors do not reject. Use finally for cleanup that must happen either way, such as hiding a loading spinner.
Q4Are JavaScript classes the same as classes in Java?
Not really. JavaScript classes are mostly a clearer syntax over prototypes. Methods defined in a class are placed on the constructor's prototype, and instances look them up through the prototype chain. There is no separate class blueprint in the same sense as Java.
Q5When would you use forEach instead of map?
Use forEach when you only want side effects, like logging or updating something outside, and do not need a new array. Use map when you want to transform each element into a new value and keep the results.
SECTION 07Test yourself — JavaScript depth quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
Do interviewers read the skills section on a resume?
Yes, but mostly to decide what to ask. Skills lines look similar across candidates, so interviewers use questions to check which listed skills are real and how deep they go.
What JavaScript questions show real experience?
Small behaviour questions work best: default sort on numbers, event delegation, error handling with async/await and finally, map versus forEach, and the prototype chain. Real use produces noticeably better answers.
Should I list every JavaScript topic I know on my resume?
List only the topics you can answer a follow-up on. Every listed skill may be questioned, so a shorter, honest list is safer and more convincing.
How do I show depth in a JavaScript interview answer?
Give the direct answer, then the reason, then a short piece of evidence from your own work, such as where you used it or a bug it caused. Mention an edge case if there is time.
Why does JavaScript sort change the original array?
Array.prototype.sort sorts in place by design and returns the same array. To keep the original, copy it first with the spread syntax or use toSorted in engines that support it.
Is there a course that covers JavaScript interview questions?
Yes. Uncodemy's Frontend Development Training Course in Noida (classroom and online) includes live projects, one-to-one mock interviews and resume reviews, so you practise JavaScript interview questions with trainer feedback before the real interview. You can book a free demo class from this page to see how the sessions work.
SECTION 09Related reads
Classroom & online · Noida
Turn your JavaScript keywords into evidence
Our Frontend Development Training Course covers core JavaScript, the DOM, async patterns and React through projects, so every skill on your resume has a story behind it.
Talk to a counsellor for current fees- Core JavaScript and DOM
- Project-based practice
- Resume and answer review
- Weekday & weekend batches