ProAdvancedInterview prep

HTML Interview Questions

What interviewers ask about markup and what the honest answer is: the accessibility tree against the DOM tree, constraint validation, parser error recovery, resource loading order, and the perennial "what does this render".

Questions90
Topics10
Answering time68 minutes
At five a day18 days
LevelAdvanced

Who it is for

Preparing, and short of time.

For someone confident in the language who wants the traps, the edge cases and the interview questions.

You will get the most out of it if you have written HTML recently enough to read it without effort, and have been surprised by it at least once. If you are picking the language up for the first time, start with HTML Essentials and come back to this one.

It is also built for interview preparation: the questions are the ones that get asked because they separate people who have read the documentation from people who have hit the behaviour in production.

How long it takes

90 graded questions at roughly 45 seconds each is about 68 minutes of answering in total.

At the default five questions a day, and because the session mixes in your other courses, expect around 18 days — call it 3 weeks — to see everything once, plus a few weeks of thinning reviews after that before it is all mastered.

A question is mastered on the third correct answer, once the gap between reviews has grown past a week — so a course cannot be finished in a weekend however long you sit with it.

Question mix

  • 60 multiple choice
  • 10 concept cards
  • 10 predict the output
  • 10 put it in order
  • 10 matching questions

Syllabus

What you will be asked about

  1. 01

    Semantics That Actually Change Behaviour

    Say what a semantic element buys you at runtime, and which semantic claims are folklore.

  2. 02

    The Accessibility Tree

    Predict what assistive technology receives from a piece of markup, and where it diverges from the DOM.

  3. 03

    Forms & Constraint Validation

    Predict what a form submits and what the browser validates, before any script runs.

  4. 04

    How The Parser Recovers

    Predict the DOM an HTML parser builds from markup that is wrong, since it never refuses to build one.

  5. 05

    Resource Loading & Performance

    Say when each resource is fetched, when it executes, and what it blocks in between.

  6. 06

    Head Metadata & The SEO Facts

    Separate the metadata that changes browser or crawler behaviour from the folklore that does not.

  7. 07

    Sandboxing, rel Tokens & Embedding

    Reason about what a piece of markup grants to code you do not control.

  8. 08

    Responsive Images & Media

    Choose between srcset, sizes and picture, and say what the browser is allowed to do with each.

  9. 09

    What Does This Actually Render?

    Read a fragment and say what the user sees, what is in the DOM, and why those differ.

  10. 10

    Attributes, Properties & The DOM

    Tell an attribute from a property, and predict which one the browser and your code are reading.

8 more topics, and all 90 questions

HTML Interview Questions is a Pro course. One subscription opens it and every other course in the catalogue, including the ones still being written.

See pricing Find a free course

A question from this course

Semantics That Actually Change Behaviour

Which of these two controls still falls short of a real button?

<div role="button" tabindex="0">Save</div>
<button>Save</button>
  • AThe div: role and tabindex give it a name and focus, but not Enter/Space activation or the disabled state
  • BNeither: role plus tabindex is the complete recipe
  • CThe button: a native button needs an explicit role to be announced
  • DThe div, because role="button" is not a valid ARIA role on a div
Show the answer

A The div: role and tabindex give it a name and focus, but not Enter/Space activation or the disabled state

You may have been taught that role plus tabindex makes a div equivalent, because it exposes the right role and takes focus. It does not: keyboard activation is still yours to write, Enter and Space behave differently, and there is no disabled state, no form submission and no forced-colours styling. The ARIA rule is the shorter answer in an interview - if a native element exists, use it.

The rest of the track

HTML at every depth

Start HTML Interview Questions
in tomorrow’s session.

Enrol and this course joins your daily five, mixed in with everything else you are studying — 90 questions spread over about 18 days rather than dropped on you at once.

Browse the catalogue