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
- Frontend Full Stack Staff Software Engineer, AI Platform ExperiencesGusto · San Francisco, CA;New York, NYhybridstaffQuick applyPosted 4 hours ago
- Staff Frontend Engineer - UI Platform - SeattleDatabricks · Seattle, WashingtononsitestaffQuick applyPosted 5 hours ago
- Senior Frontend Software Engineer, Ads ExperienceRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 5 hours ago
- Director, Product Management, Consumer FrontendRoblox · San Mateo, CA, United StatesonsiteleadQuick applyPosted 5 hours ago
- Senior Frontend Software Engineer - MarketplaceRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 5 hours ago
- Senior Frontend Engineer, Voice CommunicationRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 5 hours ago
- Senior Data Scientist - Consumer FrontendRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 5 hours ago
- Architect, Front-End/Client EngineeringRoku · San Jose, CaliforniahybridstaffQuick applyPosted 5 hours ago
- Principal Frontend Software Engineer, ConnectionsRoblox · San Mateo, CA, United StatesonsiteleadQuick applyPosted 5 hours ago
- Frontend Engineer, ExpansionStripe · N/AonsitemidQuick applyPosted 7 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