It's a common practice in many front-end interviews to have tasks related to solving JavaScript problems.
But how many interviews place importance on HTML? After all, it is the backbone of everything built on the web and done poorly can have a substantially negative affect for people using your website or app.

HTML questions #

After doing a quick search for 'HTML interview questions', it's clear the bar is set very low. Here's a few examples from the top ranked pages:

  • How can we comment in HTML?
  • What is the difference between HTML elements and tags?
  • What is Semantic HTML?
  • How to insert a copyright symbol on a browser page?
  • What is the function of <br> tags?

Most of these questions are either too simplistic or extremely outdated (I even fround some questions about <applet>!). Searching instead for 'HTML5 interview questions' does product some better results, but it's still mostly questions about what elements are and when to use them.

  • Briefly describe the correct usage of the following HTML5 semantic elements: <header>, <article>, <section>, <footer>.
  • What is the purpose of 'nav' tag in HTML5?
  • List some of the formatting elements in HTML5.

Looking on Github, there seems to be two resources which have some good questions, although arguably many of them aren't strictly HTML questions and are most about best practices.

HTML interview Questions has the following:

  • Can you describe the difference between progressive enhancement and graceful degradation?
  • What ARIA and screenreaders are, and how to make a website accessible?
  • What are the benefits of Server Side Rendering (SSR) over Client Side Rendering (CSR)?

The Frontend Interview Handbook also has some good questions:

  • What kind of things must you be wary of when designing or developing for multilingual sites?
  • Describe the difference between a cookie, sessionStorage and localStorage.
  • Why is it generally a good idea to position CSS <link>s between <head></head> and JS <script>s just before </body>? Do you know any exceptions?

Is there a better approach #

I don't think straight questions about HTML is really a good strategy. Ideally you want a task which allows the developer to demonstrate their knowledge by applying it in a real world context.

One idea for a task might be to give someone a design mock-up and ask them to discuss how they would mark it up and the reasons behind their decisions.

The Shoptalk Show podcast did something similar, in their short series: How to Think Like a Front-End Developer. Each guest was given the same dribbble designs and were asked how they would code them up in HTML. Examples include a food lovers' landing page and a tracking dashboard.

A second idea would be to present a candidate with a page of badly-coded HTML and ask them to discuss any problems with it along with how they would make it better.

Just for fun, I've made a quick example of a badly marked-up portfolio page. If you're curious about what could be improved, here's a version with comments added to take a look at.