InterviewStack.io LogoInterviewStack.io

Frontend Performance Optimization Questions

Comprehensive techniques and trade offs for improving client side performance in web applications and single page applications. Candidates should understand the browser rendering pipeline and critical rendering path including parsing, style calculation, layout, paint, and compositing, and how layout and paint costs produce reflow and repaint. They should know how component design and code patterns affect rendering and how to avoid layout thrashing and unnecessary re rendering. Candidates must be able to diagnose and mitigate JavaScript execution bottlenecks and long tasks that block the main thread using browser developer tools and performance application programming interfaces. Key topics include bundling and module strategies such as code splitting, lazy loading, tree shaking, and bundle size reduction; image optimization and responsive image techniques; network optimization including resource prioritization, compression, and caching strategies; service workers for offline capabilities and advanced caching patterns; and use of web workers to offload computation. Advanced considerations include virtual scrolling for large lists, progressive enhancement, server side rendering and client side rendering trade offs and hydration cost for universal applications, browser memory management and garbage collection implications, and how frontend decisions interact with backend constraints and overall system architecture. Candidates should also be familiar with measuring user experience using Core Web Vitals such as Largest Contentful Paint, First Input Delay, and Cumulative Layout Shift, with real user monitoring and synthetic testing, and with establishing performance budgets and continuous performance monitoring.

EasyTechnical
104 practiced
Explain the Core Web Vitals relevant to frontend developers: Largest Contentful Paint (LCP), First Input Delay (FID) / Interaction to Next Paint (INP), and Cumulative Layout Shift (CLS). For each metric describe what it measures, common frontend causes for poor scores in SPAs, and at least two practical techniques you would use to improve each metric.
MediumTechnical
85 practiced
In plain JavaScript (no framework), implement a simplified virtual scroller for a list with a very large number of fixed-height items. The component should: accept `containerHeight`, `itemHeight`, and `totalCount`, render only the visible items into a scrollable container with a correctly sized spacer element, and update rendered items on `scroll`. Focus on correctness, not styling. Provide the implementation in ES6.
HardTechnical
57 practiced
Explain advanced compositing and layer management techniques to reduce paint cost: how properties like `transform`, `opacity`, and `will-change` create compositing layers, the role of CSS containment (`contain`), when to use `translateZ(0)` or `will-change` to promote layers, and the trade-offs (memory usage, rasterization cost) of overusing layers. Describe how you'd debug layer and paint issues using DevTools.
MediumTechnical
76 practiced
Design a service worker caching strategy for a news web application that must deliver the freshest headlines on load but also allow users to read previously viewed articles while offline. Explain which caching strategies (network-first, cache-first, stale-while-revalidate) you would use for: the homepage/headlines, article pages, article images/assets, and API responses for search. Mention how you would handle cache invalidation and offline analytics/events.
MediumTechnical
111 practiced
Describe practical tree-shaking gotchas when using mixed module types and bundler configurations: why CommonJS and dynamic `require()` hamper dead-code elimination, how `package.json` `sideEffects` affects bundling, and examples of source code patterns (mutated exports, dynamic property lookups) that prevent optimizers from removing unused code. Suggest fixes or mitigation steps.

Unlock Full Question Bank

Get access to hundreds of Frontend Performance Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.