Back
Web Fundamentals

Core Web Vitals: LCP, INP & CLS

Web Fundamentals
Build & Deployment: Monorepo, CI/CD, Strategies & Release SafetyState Management: Choosing the Right SolutionRedux: Predictable State Container (RTK + RTK Query)React Query (TanStack Query): Server State CachingData Fetching Patterns: REST, GraphQL, tRPC & Real-timeGraphQL Fundamentals for Frontend: Shape, Caching, and TradeoffsgRPC-Web Fundamentals: Browser Constraints and Proxy ModelCaching Strategies: Client, Server & EdgeData Normalization: Organizing State for PerformanceAPI Design Best Practices: Pagination, Errors, Versioning & Type SafetyAPI Versioning Strategies for Frontend CompatibilityPagination: Offset vs Cursor-BasedRate Limiting & API Resilience: Retries, Backoff, Jitter, IdempotencyHow Frontend Developers Can Handle Millions of API Requests Without Crashing EverythingBrowser Storage: Cookies, SessionStorage, LocalStorage, IndexedDBReal-time Communication: WebSockets, SSE & PollingWebRTC: Real-Time Communication in the BrowserCore Web Vitals: LCP, INP & CLSPerformance Optimization Trade-offsCritical Resource Prioritization: Optimize Loading OrderCode Splitting: Optimize Bundle Size with Dynamic ImportsTree Shaking: Eliminate Dead Code from Your BundleLazy Loading: Load Resources On-DemandResource Hints: Preload, Prefetch & PreconnectText Compression: Gzip and BrotliImage & Video Optimization: Modern Formats & TechniquesAdaptive Loading: Optimize for Device & NetworkList Virtualization: Render Large Lists EfficientlyWeb Workers vs Main Thread: Offloading Heavy WorkMemory Leaks in Frontend Apps: Detection & PreventionManaging Third-Party Scripts: Optimization StrategiesHow CDNs Work: Edge Delivery, Caching & PerformanceHTTP Caching Deep Dive: Cache-Control, ETag & RevalidationService Workers & Offline Strategy: Cache First, Network First & Update LifecyclePWA Fundamentals: Manifest, Installability & Offline UXCritical Rendering PathScript Loading: async vs deferEvent Loop: Understanding JavaScript Execution ModelJavaScript Module Systems: CJS vs ESM vs UMDDynamic Module Loading: import() FunctionImport on Interaction: Load When User InteractsImport on Visibility: Lazy Loading with IntersectionObserverBrowser Rendering Pipeline & Layout ThrashingRendering Strategies: CSR vs SSR vs SSG vs ISRStreaming SSR: Progressive HTML StreamingIslands Architecture: Independent Component HydrationReact Server Components: Zero-JS Server RenderingFramework Reactivity: React, Vue, Svelte & SolidHTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC) for Frontend PerformanceDNS Resolution: Path, TTL, Caching & Frontend ImpactCross-Site Scripting (XSS) AttacksCross-Site Request Forgery (CSRF) AttacksCORS Explained: Cross-Origin Resource SharingCORS Preflight in Practice: Credentials, Simple Requests & MisconfigurationsContent Security Policy (CSP)Why is HTTPS Secure? Understanding TLS/SSLAuthorization Best PracticesCookie Security & Session Hardening: SameSite, HttpOnly, Secure
mediumPerformance

Core Web Vitals: LCP, INP & CLS

TL;DRLCP < 2.5s • INP < 200ms • CLS < 0.1. Optimize loading, interactivity, and visual stability.
Very High Signal
Google
Meta
Netflix
Agoda
30-Second Answerstart every interview with this

Core Web Vitals are real-user metrics that measure loading performance (LCP), interactivity (INP), and visual stability (CLS). They directly impact SEO rankings and user experience. Understanding thresholds and optimization techniques is essential for modern frontend performance work.

LCP = How fast does the main content appear? INP = How responsive does the page feel when I interact? CLS = Does the page jump around annoyingly while I'm reading? Good scores mean happy users and better search rankings.

Page Load
LCP: Largest content visible
INP: Smooth interactions
CLS: Stable layout throughout

1Largest Contentful Paint (LCP)

Measures when the largest visible element (usually hero image or main text) finishes rendering. Target: < 2.5s.

lcp-optimization.htmlhtml
<link rel="preload" as="image" href="hero.webp">
<picture>
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" width="1200" height="600" alt="Hero">
</picture>

2Interaction to Next Paint (INP)

Measures the latency of user interactions (click, tap, keypress). Target: < 200ms. Replaces FID. Focus on breaking long tasks and minimizing main-thread work.

3Cumulative Layout Shift (CLS)

Measures unexpected layout shifts. Target: < 0.1. Prevent by reserving space for images, ads, and dynamic content.

PropertyLCPINPCLS
MetricLoading performanceInteractivity / responsivenessVisual stability
Target< 2.5s< 200ms< 0.1
Fix FocusImage optimization, CDN, critical resource preloadingCode splitting, Web Workers, task chunkingExplicit dimensions, reserved space, font-display
Main CausesSlow server, large images, render-blocking resourcesLong JS tasks, heavy event handlers, third-party scriptsUnsized images, dynamic content insertion, font swaps

LCP

Metric

Loading performance

Target

< 2.5s

Fix Focus

Image optimization, CDN, critical resource preloading

Main Causes

Slow server, large images, render-blocking resources

INP

Metric

Interactivity / responsiveness

Target

< 200ms

Fix Focus

Code splitting, Web Workers, task chunking

Main Causes

Long JS tasks, heavy event handlers, third-party scripts

CLS

Metric

Visual stability

Target

< 0.1

Fix Focus

Explicit dimensions, reserved space, font-display

Main Causes

Unsized images, dynamic content insertion, font swaps

Common questions

  • ›“What are Core Web Vitals and why do they matter?”
  • ›“How do you improve LCP / INP / CLS?”
  • ›“Explain how you would debug poor Core Web Vitals in production.”
  • ›“What is the relationship between Core Web Vitals and SEO?”

What interviewers look for

  • Knowledge of the three metrics and their targets
  • Practical, specific optimization techniques
  • Understanding of real-user monitoring (RUM) vs lab data
  • Connection to broader performance architecture (rendering, JS, images)

Short answer (60 sec)

Core Web Vitals are LCP (loading), INP (interactivity), and CLS (stability). Good thresholds: LCP < 2.5s, INP < 200ms, CLS < 0.1. Optimize images/CDN for LCP, break long tasks for INP, and reserve space for CLS.

Detailed answer (senior level)

Core Web Vitals are Google's user-centric metrics used for ranking. LCP focuses on perceived load speed, INP on responsiveness to input, and CLS on layout stability. In production, use the web-vitals library with Real User Monitoring. Lab tools like Lighthouse give directional signals, but CrUX and RUM data reflect actual user experience. Strong answers connect optimizations back to the rendering pipeline and browser behavior.

  • Optimizing only Lighthouse scores instead of real-user metrics
  • Forgetting to set explicit width/height on images
  • Running heavy work in main-thread event handlers
  • Not reserving space for dynamic ads or injected content
  • Ignoring font loading strategies (FOIT/FOUT)
Key Takeaways
  • ✓LCP < 2.5s, INP < 200ms, CLS < 0.1 are the targets
  • ✓Optimize images, use CDN, and preload critical resources for LCP
  • ✓Break long tasks, defer JS, and use Web Workers for INP
  • ✓Reserve space with dimensions and placeholders for CLS
  • ✓Measure real users with web-vitals library + RUM
  • ✓Core Web Vitals directly influence SEO rankings and user satisfaction
Previous TopicWebRTC: Real-Time Communication in the BrowserNext Topic Performance Optimization Trade-offs

On this page