Intermediate
JavaScript & web – interview notes
1. What is a closure?
A function that remembers variables from the scope where it was created, even after that scope has finished.
2. Explain the event loop.
JavaScript runs one task at a time. Async callbacks wait in queues; microtasks (promises) run before the next macrotask (timers, I/O).
3. == vs ===?
=== compares value and type without coercion; prefer it.
4. What happens when you type a URL?
DNS lookup → TCP/TLS connection → HTTP request → HTML parsed into the DOM, CSS into the CSSOM → layout → paint.
Feedback & comments (2)
Priya Nair
Helpful, thanks. Please write a follow-up on the advanced topics.
Aarav Sharma
Great summary. It would be nice to add one more example with real data.