Skip to main content
InterviewHubPRO
Section Overview
Q15

Question 15 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

30%
HTML5 & Web APIs (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

What are Resource Hints (`preload`, `prefetch`, `preconnect`, `dns-prefetch`)?

senior LevelCode ExampleSystem DesignRabbitMQHTTP & REST APIs

In Simple Words: Informs the browser's network stack about resources before the HTML parser discovers them:

  1. rel="preconnect": Initiates early DNS lookup, TCP handshake, and TLS negotiation to an external origin (e.g., Google Fonts or Cloudinary CDN):
    html
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    
  2. rel="preload": Tells the browser to download a critical resource needed for the current page immediately with high priority (hero images, critical fonts, main JS bundle):
    html
    <link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin />
    
  3. rel="prefetch": Low-priority background download of resources likely needed for the next page navigation (e.g. checkout bundle while on cart page).