Interview prep
JavaScript Interview Questions
JavaScript interviews test the event loop, closures and asynchronous control flow before any framework specifics.
Questions and answers
01Explain the event loop.
The call stack runs synchronously; completed async work queues callbacks. Microtasks (promises) drain fully after each task, before the next macrotask (timers, IO), which is why a promise chain runs before a setTimeout(0).
02What is a closure and where does it bite you?
A closure captures variables from its defining scope. The classic bug is capturing a loop variable declared with var — every callback sees the final value; let creates a fresh binding per iteration.
03Difference between == and ===?
== applies type coercion before comparing; === compares type and value. Use === unless you deliberately want null and undefined to compare equal.
04How does prototypal inheritance work?
Objects hold a link to a prototype object; property lookup walks that chain until it finds a match. class syntax is sugar over the same mechanism.
05What is the difference between debounce and throttle?
Debounce delays execution until activity stops — good for search input. Throttle guarantees at most one call per interval — good for scroll and resize handlers.
How to answer these well
Interviewers are not grading recall — they are checking whether you've hit the failure mode the question describes. Anchor every answer to something you actually shipped or debugged with JavaScript.
Say the trade-off out loud. "I'd use X here, but it costs Y under Z conditions" scores higher than a clean textbook definition every time.
Roles asking for JavaScript
- Pharmacy Technician Front EndCVS · NY - Ballston SpaonsitemidPosted 32 mins ago
- Frontend Software EngineerAnduril · Costa Mesa, California, United StatesonsitemidQuick applyPosted 3 hours ago
- Senior Front End Software Engineer, ReactAnduril · Arlington, Virginia, United StatesonsiteseniorQuick applyPosted 4 hours ago
- Senior Front End Software Engineer, ReactAnduril · Seattle, Washington, United StatesonsiteseniorQuick applyPosted 4 hours ago
- Senior Front End Software Engineer, ReactAnduril · Washington, District of Columbia, United StatesonsiteseniorQuick applyPosted 4 hours ago
- Architect, Front-End/Client EngineeringRoku · San Jose, CaliforniahybridstaffQuick applyPosted 7 hours ago
- Senior Frontend Software Engineer, Ads User ExperienceRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 8 hours ago
- Senior Frontend/Fullstack Software Engineer, Social GraphRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 8 hours ago
- Senior Software Engineer, Frontend (App Foundations)Roblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 8 hours ago
- Director, Product Management, Consumer FrontendRoblox · San Mateo, CA, United StatesonsiteleadQuick applyPosted 8 hours ago
Related prep
- Frontend Engineer jobs
- Frontend Engineer career guide
- Full Stack Engineer jobs
- Full Stack Engineer career guide
- Python interview questions
- Java interview questions
- React interview questions
- AWS interview questions
- Azure interview questions
- Kubernetes interview questions
- Docker interview questions
- Terraform interview questions