Menu
CoddyTech

HTML SEO and Meta Tags Interview Questions

Title, description, viewport, charset, canonical, Open Graph, robots, hreflang and structured data.

10 questions
  1. Which HTML tags matter most for SEO?

    The <title> and meta description first, then a clear heading structure, descriptive link text, alt text, a canonical URL and the viewport tag.

    <head>
      <title>HTML Interview Questions and Answers | Coddy</title>
      <meta name="description" content="HTML questions with answers and live examples.">
      <link rel="canonical" href="https://example.com/html-interview-questions">
      <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    

    In the body, use one <h1> on the topic, headings in order, and real <a href> links whose text says where they go. See the title tag page.

  2. What does the viewport meta tag do?

    <meta name="viewport" content="width=device-width, initial-scale=1"> tells mobile browsers to lay the page out at the screen's width. Without it, phones use a desktop width (often 980px) and zoom out, so text is tiny and media queries misfire.

    Do not add maximum-scale=1 or user-scalable=no: blocking pinch zoom stops low vision users from enlarging text, which WCAG resize text asks to work up to 200%. See the viewport page.

  3. Do the meta description and meta keywords tags affect ranking?

    Not directly. Google ignores <meta name="keywords">, and the description is not a ranking factor, but it is often shown as the snippet under your title, so a good one earns clicks.

    <title>Learn HTML Forms with Examples</title>
    <meta name="description" content="Build forms with labels, input types and validation. Every example runs in the browser.">
    

    Write a unique description for each page; Google may shorten or rewrite it. The <title> does affect ranking.

  4. Why do you need <meta charset="utf-8">, and where does it go?

    It tells the browser how to decode the page's bytes into characters; with the wrong encoding Café shows up as Café. The spec requires it within the first 1024 bytes, so put it first in <head>. A Content-Type HTTP header with a charset takes priority over it, so the two should agree.

  5. What are Open Graph tags?

    Open Graph tags (<meta property="og:...">) control the preview card when a link is shared on social media and chat apps: its title, description and image.

    <meta property="og:title" content="HTML Interview Questions">
    <meta property="og:description" content="Answers with live examples.">
    <meta property="og:image" content="https://example.com/og/html.png">
    <meta name="twitter:card" content="summary_large_image">
    

    Use an absolute image URL. Most scrapers do not run JavaScript, so the tags must be in the HTML the server sends.

  6. What is the difference between the robots meta tag and robots.txt?

    robots.txt controls crawling (which URLs a crawler may fetch); the robots meta tag controls indexing of a page that was fetched.

    <meta name="robots" content="noindex, follow">
    

    The trap: a page blocked in robots.txt is never fetched, so its noindex is never seen, and the URL can still be indexed from links. To keep a page out, allow crawling and use noindex.

  7. What is hreflang, and how do you use it for a multilingual site?

    hreflang links tell search engines which URL serves which language or region, so searchers get their own language.

    <link rel="alternate" hreflang="en" href="https://example.com/pricing">
    <link rel="alternate" hreflang="hi" href="https://example.com/hi/pricing">
    <link rel="alternate" hreflang="de" href="https://example.com/de/pricing">
    <link rel="alternate" hreflang="x-default" href="https://example.com/pricing">
    

    Every version lists all versions including itself, links must be reciprocal, and x-default is the fallback. Each version keeps its own self-referencing canonical; pointing them all at the English page drops the translations.

  8. What is structured data, and how do you add it to a page?

    Structured data describes the page's content in the schema.org vocabulary, so search engines know it is a product, an article or a recipe. Google recommends JSON-LD in a script tag.

    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Article",
      "headline": "HTML Interview Questions",
      "datePublished": "2026-03-14",
      "author": { "@type": "Organization", "name": "Coddy" }
    }
    </script>
    

    It can make a page eligible for rich results but is not a ranking boost, and it must match the visible content.

  9. What is the difference between rel="nofollow", rel="ugc" and rel="sponsored"?

    All three tell search engines that a link is not your editorial endorsement. sponsored marks paid links, ads and affiliate links; ugc marks links in user-generated content such as comments and forum posts; nofollow covers any other link you do not vouch for. They can be combined: rel="ugc nofollow". Google has treated them as hints rather than rules since 2019, and paid links without sponsored or nofollow can bring a manual action.

Coddy programming languages illustration

Learn to code with Coddy

Get started