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
- Senior Frontend/Fullstack Software Engineer, Social GraphRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 12 hours ago
- Senior Software Engineer, Frontend (App Foundations)Roblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 12 hours ago
- Director, Product Management, Consumer FrontendRoblox · San Mateo, CA, United StatesonsiteleadQuick applyPosted 12 hours ago
- Senior Data Scientist - Consumer FrontendRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 12 hours ago
- Principal Frontend Software Engineer - DiscoveryRoblox · San Mateo, CA, United StatesonsiteleadQuick applyPosted 12 hours ago
- Senior Frontend/Fullstack Software Engineer, SharingRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 12 hours ago
- Senior Frontend Engineer, Discovery UXRoblox · San Mateo, CA, United StatesonsiteseniorQuick applyPosted 12 hours ago
- Software Engineer, Frontend - EconomyRoblox · San Mateo, CA, United StatesonsitemidQuick applyPosted 13 hours ago
- Sr. Front End Engineer, AWS SolutionsAmazon · Seattle, Washington, USAonsiteseniorPosted 20 hours ago
- Part Time Front End SupervisorTJX Companies · Beaver Dam, WI 53916onsitemidPosted 2 days 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