Writing HTML that loads fast: critical resources, lazy loading and avoiding layout shift.
Page speed starts with how HTML is written. Render-blocking resources like CSS in the head and synchronous scripts delay the first paint, so scripts should use defer or async, critical CSS can be prioritized, and resource hints such as preload, preconnect and dns-prefetch help the browser fetch important things earlier. Images are usually the heaviest assets, so modern formats, correct sizing, srcset and loading="lazy" for offscreen content make a significant difference.
Interviewers frequently tie performance to Core Web Vitals: Largest Contentful Paint (loading), Interaction to Next Paint (responsiveness) and Cumulative Layout Shift (visual stability). Setting explicit width and height on images and media prevents layout shifts, while keeping the DOM small and avoiding deeply nested markup reduces rendering cost. The most important point is to measure with tools like Lighthouse rather than guess at what is slow.
What you'll walk away knowing