Web Performance Hard technical 1 views 1 min read

What is INP and how do you reduce it?

Peer-reviewed by HireXTech Technical Panel • Updated for 2025/2026 hiring • Editorial standards
Practise this track
Interviewer Expectations for this Question
01
Core Competency

Assesses fundamental understanding of Web Performance conventions, runtime behavior, and memory/performance considerations.

02
Evaluation Criteria

Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.

Comprehensive Model Answer Verified Solution

Interaction to Next Paint measures the time from a user interaction such as a click, tap or key press until the browser paints the next frame, across the whole visit, reporting roughly the worst interaction. A long INP means the page felt laggy. It is driven by long tasks that block the main thread: heavy event handlers, large synchronous renders, layout thrashing and third-party scripts. Diagnose with the Performance panel's interactions track and the web-vitals library with attribution.

Improvements: break up long tasks with scheduler.yield() or setTimeout(0) and yield to the browser. Keep event handlers short and debounce high-frequency events. Avoid reading layout properties such as offsetHeight immediately after writes, which forces reflow. Reduce hydration cost and re-render less with fine-grained reactivity or memoisation. Defer and lazy-load non-critical third-party scripts, and move heavy work to Web Workers.

INP is about perceived responsiveness, so optimise the few interactions users actually perform.

Candidate Response Strategy & Interview Tips

  1. Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
  2. Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
  3. Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
  4. Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.
Spotted an error or have an alternative solution?