TGViewer
Web Development - HTML, CSS & JavaScript Web Development - HTML, CSS & JavaScript @javascript_courses · 55.7K subscribers
Post #3462 1.82K
Coding interview questions with concise answers for software roles:

1️⃣ What happens when you type a URL and hit Enter?
Answer:
- DNS Lookup → IP address
- Browser sends HTTP/HTTPS request
- Server responds with HTML/CSS/JS
- Browser builds DOM, applies styles (CSSOM), runs JS
- Page is rendered


2️⃣ Difference between var, let, and const?
Answer:
- var: function-scoped, hoisted
- let: block-scoped, not hoisted
- const: block-scoped, can’t be reassigned


3️⃣ Reverse a String in JavaScript
function reverseString(str) {
return str.split('').reverse().join('');
}

4️⃣ Find the max number in an array
const max = Math.max(...arr);

5️⃣ Write a function to check if a number is prime
function isPrime(n) {
if (n < 2) return false;
for (let i = 2; i <= Math.sqrt(n); i++) {
if (n % i === 0) return false;
}
return true;
}

6️⃣ What is closure in JavaScript?
Answer:
A function that remembers variables from its outer scope even after the outer function has returned.

7️⃣ What is event delegation?
Answer:
Attaching a single event listener to a parent element to manage events on its children using event.target.

8️⃣ Difference between == and ===
Answer:
- == checks value (with type coercion)
- === checks value + type (strict comparison)

9️⃣ What is the Virtual DOM?
Answer:
A lightweight copy of the real DOM used in React. React updates the virtual DOM first and then applies only the changes to the real DOM for efficiency.

🔟 Write code to remove duplicates from an array
const uniqueArr = [...new Set(arr)];

React ❤️ for more
  • ❤ 4
  • 👍 4
  • 🥰 3
More from @javascript_courses
  1. Oct 8, 2026🎓 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝘄𝗶𝘁𝗵 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗲𝘀! 🚀🔥 Upgr…
  2. Oct 7, 2026🚀𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 | 𝗕𝗲𝗰𝗼𝗺𝗲 𝗮 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰…
  3. Oct 7, 2026𝗠𝗮𝘀𝘁𝗲𝗿 𝗣𝗼𝘄𝗲𝗿 𝗕𝗜 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘! 🔥 Learn Power BI through these FREE learnin…
  4. Oct 4, 2026DSA Handwritten Notes
  5. Sep 28, 2026To learn web design and development from basic to advanced levels, you can follow these st…
  6. Sep 27, 202610 Websites Every Developer & AI Enthusiast Should Bookmark ✅ roadmap.sh – Step-by-step le…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →