How does the event loop work? Microtasks vs macrotasks
How does the JavaScript event loop work, and what's the difference between microtasks and macrotasks?
The 20 theoretical questions asked most often today. Open a question to read the full answer.
How does the JavaScript event loop work, and what's the difference between microtasks and macrotasks?
What is a closure, and where do you use one in practice?
What's the difference between var, let and const? Explain hoisting and the temporal dead zone.
this determined?How is the value of this determined in JavaScript? Where do call, apply, bind and arrow functions fit in?
How does prototypal inheritance work in JavaScript, and what does class do under the hood?
What's the difference between value and reference types in JavaScript, and between a shallow and a deep copy?
How do Promises and async/await handle errors, and when do you use Promise.all vs Promise.allSettled?
What's the difference between debounce and throttle, and when do you use each?
What are event bubbling and capturing, and what is event delegation?
What happens when the browser renders a page? What's the difference between reflow and repaint?
What's the difference between Flexbox and CSS Grid, and when do you use each?
key matter?What is the Virtual DOM, how does React's reconciliation work, and why does the key prop matter?
How does useEffect work? Explain the dependency array, cleanup, and when you shouldn't use it.
When does a React component re-render, and when do you actually need useMemo, useCallback and React.memo?
How do you choose between local state, Context, a global store (Redux, Zustand) and server state (TanStack Query)?
What's the difference between React Server Components and Client Components, and how do you decide which to use?
What's the difference between CSR, SSR, SSG and ISR, and how do you choose?
What are Core Web Vitals, and how do you improve each one?
What's the difference between XSS and CSRF, how do you prevent each, and what does CORS actually do?
In TypeScript, what's the difference between interface and type, what are generics for, and why prefer unknown over any?