From 126e04bb9fb1515f64c4a15935c422dbac2cda2f Mon Sep 17 00:00:00 2001 From: manivardhanreddythalla2007 Date: Thu, 20 Nov 2025 18:47:02 +0530 Subject: [PATCH 1/2] feat: add jaw-dropping JS interview questions --- jaw-dropping-questions.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 jaw-dropping-questions.md diff --git a/jaw-dropping-questions.md b/jaw-dropping-questions.md new file mode 100644 index 00000000..544d788f --- /dev/null +++ b/jaw-dropping-questions.md @@ -0,0 +1,24 @@ +cat > jaw-dropping-questions.md << 'EOF' + +cat > jaw-dropping-questions.md << 'EOF' +# Jaw-Dropping JavaScript Interview Questions + +Here are some advanced and surprising JavaScript interview questions I recently encountered. + +## 1. Why does [] == ![] evaluate to true? +Answer: Because [] becomes "", ![] becomes false → "" == false → true. + +## 2. What is event loop starvation? +Answer: When microtasks continuously run and block macrotasks from executing. + +## 3. Difference between microtask queue and macrotask queue? +Answer: Microtasks run immediately after current execution; macrotasks run in next event loop step. + +## 4. Why is typeof null === "object"? +Answer: Legacy bug from the first JS implementation; null was represented as a null pointer. + +## 5. What happens when you delete an array index? +Answer: It leaves a hole (empty slot), does NOT reindex the array. + +## 6. Explain Temporal Dead Zone with an example. +Answer: A period between variable creation and initialization where using `let`/`const` throws ReferenceError. From 35337035c6aaaf5feb1c9cb47a420c3b2e6720f0 Mon Sep 17 00:00:00 2001 From: manivardhanreddythalla2007 Date: Sun, 23 Nov 2025 18:54:58 +0530 Subject: [PATCH 2/2] Add jaw-dropping JavaScript interview questions --- jaw-dropping-questions.md | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/jaw-dropping-questions.md b/jaw-dropping-questions.md index 544d788f..916b9a79 100644 --- a/jaw-dropping-questions.md +++ b/jaw-dropping-questions.md @@ -1,24 +1,9 @@ -cat > jaw-dropping-questions.md << 'EOF' +# Jaw-dropping JavaScript Interview Questions -cat > jaw-dropping-questions.md << 'EOF' -# Jaw-Dropping JavaScript Interview Questions +## Q1 — Example placeholder +**A:** Replace with real questions. -Here are some advanced and surprising JavaScript interview questions I recently encountered. +## Q2 — Example placeholder +**A:** Replace with real questions. -## 1. Why does [] == ![] evaluate to true? -Answer: Because [] becomes "", ![] becomes false → "" == false → true. - -## 2. What is event loop starvation? -Answer: When microtasks continuously run and block macrotasks from executing. - -## 3. Difference between microtask queue and macrotask queue? -Answer: Microtasks run immediately after current execution; macrotasks run in next event loop step. - -## 4. Why is typeof null === "object"? -Answer: Legacy bug from the first JS implementation; null was represented as a null pointer. - -## 5. What happens when you delete an array index? -Answer: It leaves a hole (empty slot), does NOT reindex the array. - -## 6. Explain Temporal Dead Zone with an example. -Answer: A period between variable creation and initialization where using `let`/`const` throws ReferenceError. +