Skip to content

Commit 126e04b

Browse files
feat: add jaw-dropping JS interview questions
1 parent 09e31a5 commit 126e04b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

jaw-dropping-questions.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
cat > jaw-dropping-questions.md << 'EOF'
2+
3+
cat > jaw-dropping-questions.md << 'EOF'
4+
# Jaw-Dropping JavaScript Interview Questions
5+
6+
Here are some advanced and surprising JavaScript interview questions I recently encountered.
7+
8+
## 1. Why does [] == ![] evaluate to true?
9+
Answer: Because [] becomes "", ![] becomes false → "" == false → true.
10+
11+
## 2. What is event loop starvation?
12+
Answer: When microtasks continuously run and block macrotasks from executing.
13+
14+
## 3. Difference between microtask queue and macrotask queue?
15+
Answer: Microtasks run immediately after current execution; macrotasks run in next event loop step.
16+
17+
## 4. Why is typeof null === "object"?
18+
Answer: Legacy bug from the first JS implementation; null was represented as a null pointer.
19+
20+
## 5. What happens when you delete an array index?
21+
Answer: It leaves a hole (empty slot), does NOT reindex the array.
22+
23+
## 6. Explain Temporal Dead Zone with an example.
24+
Answer: A period between variable creation and initialization where using `let`/`const` throws ReferenceError.

0 commit comments

Comments
 (0)