Web API & Performance
151) What is the DOM in one practical sentence?
152) DOM vs HTML string â why not just edit innerHTML everywhere?
innerHTML everywhere?153) What is âreflowâ (layout) and why should you care?
154) What is ârepaintâ and how is it different from reflow?
155) What causes layout thrashing?
156) How do you avoid layout thrashing?
157) Whatâs the difference between querySelector and getElementById?
querySelector and getElementById?158) NodeList vs HTMLCollection â why does it matter?
NodeList vs HTMLCollection â why does it matter?159) Why is documentFragment useful?
documentFragment useful?160) How does event bubbling work?
161) What is event capturing?
162) What is event delegation and why is it powerful?
163) When does delegation fail?
164) Whatâs the difference between e.target and e.currentTarget?
e.target and e.currentTarget?165) Why should you care about passive event listeners?
166) What is debouncing (in human terms)?
167) What is throttling (in human terms)?
168) Debounce vs Throttle â when do you choose which?
169) Why is requestAnimationFrame often better than setTimeout for UI?
requestAnimationFrame often better than setTimeout for UI?170) What is the critical rendering path?
171) What are âlong tasksâ and why do they hurt UX?
172) Whatâs a Web Worker and when should you use it?
173) Why canât Web Workers access the DOM?
174) Whatâs the difference between localStorage and sessionStorage?
localStorage and sessionStorage?175) Why is localStorage considered bad for performance-sensitive code?
localStorage considered bad for performance-sensitive code?176) What is IndexedDB in one line?
177) What is a memory leak in the browser world?
178) Name 3 common causes of memory leaks in frontend apps.
179) How does an event listener cause a memory leak?
180) Why can setInterval be dangerous?
setInterval be dangerous?181) What is a detached DOM node?
182) What is the fastest way to reduce unnecessary DOM updates?
183) What is list virtualization and why is it important?
184) What is XSS in simple terms?
185) Whatâs the #1 cause of XSS in frontend code?
186) How do you prevent XSS properly?
187) Why is textContent safer than innerHTML?
textContent safer than innerHTML?188) What is CORS and what problem does it solve?
189) Is CORS a security feature for your server?
190) What is a preflight request and why does it happen?
191) What makes a request âsimpleâ vs ânon-simpleâ in CORS terms?
192) What is CSRF and how is it different from XSS?
193) How do SameSite cookies help against CSRF?
194) What is clickjacking?
195) What is a Content Security Policy (CSP) and why is it powerful?
196) What is âperformance budgetâ in frontend work?
197) Whatâs the difference between defer and async on script tags?
defer and async on script tags?198) Why can third-party scripts kill performance?
199) What is caching (HTTP) and why does it help?
200) If a page feels slow, whatâs a practical debugging approach?
Last updated