All 49 questions

  1. What is semantic HTML, and how do you choose appropriate elements instead of generic divs?

    Asked in 7 of 157 interviews · last asked Sep 22 · Concept · Junior

    Show answer

    Semantic HTML uses elements that describe the meaning of content, not just its appearance. I choose elements by their purpose: nav for major navigation, main for the main content, and button for an action. I use div when no meaningful element fits. This gives browsers and assistive tools useful information about the page.

    • Choose elements by meaning, not by their default appearance; use CSS for styling.
    • Use links for navigation and buttons for actions.
    • Use article for self-contained content and section for a distinct topic, usually with a heading.
    • Semantic elements support accessibility, but do not make a page accessible on their own.

    What the interviewer checks: The interviewer checks whether you can match content and behavior to suitable HTML elements and explain their accessibility value.

    Other ways it was asked
    • “What are semantic HTML elements, and why are they useful?”
    • “What is semantic HTML, and why is it important?”
    • “What are semantic HTML elements, and why do we even need them if we can build the UI without them?”
  2. What is HTML?

    Asked in 3 of 157 interviews · last asked Oct 19 · Concept · Junior

    Show answer

    HTML stands for HyperText Markup Language. It is the standard markup language used to structure content on web pages. It uses elements to describe content such as headings, paragraphs, links, and images.

    • HTML is a markup language, not a programming language.
    • Elements give content structure and meaning.
    • CSS controls presentation, while JavaScript adds behavior.

    What the interviewer checks: The interviewer is checking whether you understand HTML’s role and how it differs from CSS and JavaScript.

  3. What is the DOCTYPE declaration?

    Asked in 3 of 157 interviews · last asked Aug 27 · Concept · Junior

    Show answer

    The DOCTYPE declaration tells the browser how to render an HTML document. In modern HTML, `<!DOCTYPE html>` selects standards mode, so the browser follows modern HTML and CSS rules. Without it, the browser may use quirks mode, which applies older layout rules.

    • Place `<!DOCTYPE html>` at the start of the document, before the `<html>` element.
    • It is a declaration, not an HTML element.
    • Standards mode helps avoid unexpected layout differences caused by quirks mode.

    What the interviewer checks: The interviewer checks whether you understand how DOCTYPE affects browser rendering.

    Other ways it was asked
    • “Why do we use a DOCTYPE declaration?”
    • “What does the doctype declaration do in an HTML document?”
    • “What does a DOCTYPE declaration tell the browser?”
  4. How would you structure a semantic card component, including headings and choosing article, section, or div?

    Asked in 2 of 157 interviews · last asked Jul 26 · Concept · Mid-level

    Show answer

    Use `article` for a self-contained card, such as a blog post preview. Use `section` for a distinct topic in the page, usually with a heading. Use `div` when you only need a layout wrapper. Give the card a heading level that fits the page hierarchy, not its visual size.

    • Choose the element by the content’s meaning, not the card’s appearance.
    • An article or section does not automatically reset heading levels.
    • Let reusable cards accept a heading level that matches their placement.
    • Use CSS to style headings without changing their semantic level.
    Code
    <section>
      <h2>Latest posts</h2>
      <article>
        <h3><a href="/posts/semantic-html">Semantic HTML</a></h3>
        <p>Learn how to choose meaningful HTML elements.</p>
      </article>
    </section>

    What the interviewer checks: The interviewer is checking whether you choose meaningful elements and keep a clear heading hierarchy when reusing cards.

    Other ways it was asked
    • “When would you wrap a blog post card in an article element versus using a section or a div?”
    • “How do you structure semantic HTML for a reusable card component, including its heading hierarchy and when to use a section versus an article?”
  5. What is an iframe?

    Asked in 2 of 157 interviews · last asked Jun 18 · Concept · Junior

    Show answer

    An `<iframe>` is an HTML element that embeds another web page inside the current page. The embedded page has its own document and browsing context. Common uses include videos, maps, and external widgets.

    • The src attribute sets the page to load.
    • Use a clear title attribute to describe the frame for screen reader users.
    • The sandbox attribute can restrict what the embedded page can do.
    • The same-origin policy limits script access between the parent page and a frame from another origin.

    What the interviewer checks: The interviewer is checking whether you understand embedded pages and their separation from the parent page.

    Other ways it was asked
    • “What is the iframe tag?”
  6. What is the purpose of the head section in HTML?

    Asked in 2 of 157 interviews · last asked Oct 19 · Concept · Junior

    Show answer

    The <head> section holds information about the page and links to resources, rather than the main content shown on the page. It can include the page title, metadata, styles, and scripts. Browsers and search engines use this information to process and understand the page.

    • The <title> sets the page title shown in the browser tab.
    • Metadata can define the character encoding, page description, and viewport settings.
    • The <head> can link stylesheets and include scripts; visible page content belongs in <body>.

    What the interviewer checks: The interviewer is checking whether you understand the difference between page information in <head> and page content in <body>.

  7. What are HTML attributes, and how are they used?

    Asked in 2 of 157 interviews · last asked Sep 2 · Concept · Junior

    Other ways it was asked
    • “What are HTML data attributes, and how are they used?”
  8. How do you add a comment in HTML?

    Asked in 2 of 157 interviews · last asked Oct 19 · Concept · Junior

    Other ways it was asked
    • “Could you specify the exact syntax or tags used to add a comment in HTML?”
    • “What are the exact delimiters used to add a comment in HTML?”
  9. What is the purpose of the meta tag in HTML?

    Asked in 2 of 157 interviews · last asked Aug 25 · Concept · Junior

    Other ways it was asked
    • “What are HTML meta tags, and what are they used for?”
  10. When uploading a file through a form, what attributes are needed on the form tag?

    Asked once · last asked May 9 · Concept · Junior

  11. What are some of the new features introduced in HTML5 that enhance web application development?

    Asked once · last asked May 23 · Concept · Junior

  12. Can you elaborate on how you would use the Canvas element in a real-world project, and what kinds of applications could benefit from it?

    Asked once · last asked May 23 · Tooling · Junior

  13. What is the difference between the HTML <b> and <strong> tags?

    Asked once · last asked Nov 21 · Concept · Junior

    Other ways it was asked
    • “What is the difference between the bold and strong tags?”
  14. What content is typically placed in the HTML <head>, and what role does it serve, including metadata and CSS or JavaScript references?

    Asked once · last asked Jul 27 · Concept · Junior

  15. How do you render HTML and insert a variable into a Thymeleaf template?

    Asked once · last asked Aug 7 · Tooling · Junior

  16. What HTML form fields would you use to collect information for a career guidance tool?

    Asked once · last asked Sep 19 · Tooling · Junior

  17. How would you represent books in a reading application, including page numbers, text, and content formatting such as HTML?

    Asked once · last asked Oct 22 · Design · Mid-level

    Other ways it was asked
    • “How should the books be represented? Are they just strings, or do they include page numbers and text? How should the content be formatted—for example, as HTML?”
  18. How would you structure an icon, a heading, and a paragraph within a card using HTML?

    Asked once · last asked Mar 20 · Scenario · Junior

    Other ways it was asked
    • “How would you use CSS to space an icon, a heading, and a paragraph within a card?”
  19. What is a div tag, and what is it used for?

    Asked once · last asked Aug 4 · Concept · Junior

    Other ways it was asked
    • “What is a div tag?”
  20. Can you create a restaurant website using HTML, CSS, and JavaScript?

    Asked once · last asked Feb 2 · Write code · Junior

  21. What are HTML and CSS, and what roles do they play in web development?

    Asked once · last asked Mar 7 · Concept · Junior

  22. Why do we use HTML and CSS?

    Asked once · last asked Apr 1 · Concept · Junior

  23. Since we’re just starting to scale our business and only need a landing page, what can we start with?

    Asked once · last asked Apr 11 · Scenario · Mid-level

  24. What are some new tags in HTML?

    Asked once · last asked May 9 · Concept · Junior

  25. What is the purpose of the embed tag?

    Asked once · last asked May 9 · Concept · Junior

  26. Tell me about a web development topic you learned and still remember, and teach it to me now.

    Asked once · last asked May 16 · Concept · Junior

  27. How would you explain your rule for choosing semantic HTML elements, with a concrete page example?

    Asked once · last asked Jun 7 · Concept · Junior

  28. What factors determine which semantic HTML element you use for a particular part of a page?

    Asked once · last asked Jun 7 · Concept · Junior

  29. What is the HTML `<embed>` tag?

    Asked once · last asked Jun 18 · Concept · Junior

  30. What does the HTML script element do?

    Asked once · last asked Nov 21 · Concept · Junior

  31. What are semantic tags?

    Asked once · last asked Nov 21 · Concept · Junior

  32. How do you insert an image in HTML?

    Asked once · last asked Jul 27 · Concept · Junior

  33. Which attributes and other details are important when inserting an image in HTML?

    Asked once · last asked Jul 27 · Concept · Junior

  34. What is an element in HTML?

    Asked once · last asked Jul 27 · Concept · Junior

  35. What is the difference between a p tag and a div tag?

    Asked once · last asked Aug 4 · Concept · Junior

  36. What is XML?

    Asked once · last asked Aug 13 · Concept · Junior

  37. What are HTML tags?

    Asked once · last asked Aug 13 · Concept · Junior

  38. What is the difference between a website and a web application?

    Asked once · last asked Aug 18 · Concept · Junior

  39. What is a doctype?

    Asked once · last asked Sep 2 · Concept · Junior

  40. How would you build a static landing page that requires no server-side processing?

    Asked once · last asked Oct 2 · Scenario · Mid-level

  41. How would you build a website, and what tools would you use?

    Asked once · last asked Oct 7 · Tooling · Mid-level

  42. Which container element can you use to embed a Tableau visualization in a web page?

    Asked once · last asked Oct 9 · Tooling · Mid-level

  43. In pure HTML, what is the input type for uploading a file?

    Asked once · last asked Oct 12 · Concept · Junior

  44. In HTML, how would you allow users to upload multiple files?

    Asked once · last asked Oct 12 · Tooling · Junior

  45. What is a hyperlink in HTML?

    Asked once · last asked Oct 19 · Concept · Junior

  46. Can you clarify exactly what a hyperlink is and what it does in HTML, without jumping to examples?

    Asked once · last asked Oct 19 · Concept · Junior

  47. What role does the anchor element play in HTML?

    Asked once · last asked Oct 19 · Concept · Junior

    Other ways it was asked
    • “What role does the anchor element actually play?”
  48. What is the body tag section used for in HTML?

    Asked once · last asked Oct 19 · Concept · Junior

  49. Are page metadata and the document title part of the HTML <body> section, or where do they belong?

    Asked once · last asked Oct 19 · Concept · Junior

More HTML and CSS interview questions

How this list is made

Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.

Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.

The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every HTML and CSS interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.

157 interviews, 125 candidates, Oct 2025 to Oct 2026. Updated every month with new interviews.