Top 10 CSS and HTML questions to ask interviewee?
- What is the CSS box model?
- What is the difference between quirks mode, standards mode and almost standards mode?
- Tell me about hasLayout.
- What would be the most appropriate markup for: a navigation menu; a picture gallery; a blog post. (Why? Can you think of some alternatives? Might be good to draw these up on a whiteboard or something)
- What's the difference between <p class="main_header">Foo</p> and <h1 class="main_header">Foo</h1>?
- Why is this a bad idea?: <span class="red">Bar</span>
- Describe how to set opacity and how will it appear in Gecko, WebKit and IE.
- How can you set few properties on to textboxes as default?
- A design calls for png files with alpha transparency, what issues might you encounter?
Some of these are the same as zoul's questions except from a slightly different angle - I was aiming for questions that would lead to a bit of a discussion.
Apart from HTML/CSS/JS specific or problem-solving questions, I would also ask what sort of tools she/he is using to get a task done. It often gives good insights about 'how' someone works and gives good/relaxed room for discussion. Good developers always have good and sharp tools.
No amount of questions in a short interview would establish a person's skill level. And there is the question of innovative qualities of a person which may not reveal itself in an interview. Some people may be introverted and shy or suffer from interview jitters others may be smooth talkers with little substance. There is also the challenge of asking objective questions not opinions.
If I show up for an audition to join a symphonic orchestra and tell them I have been playing the violin for 20 years they will not ask me about the construction of the bridge or the best material for bow strings. They give me a music score and ask me to play.
I suggest creating a simple web page that requires the techniques mentioned in the answers above, showing it to the candidate and asking the candidate to re-produce it in 30 minutes using the notepad. This will sort out the experienced from the novice.
- Why is it a good idea to split HTML and CSS?
- What is the difference between inline and block elements?
- What is a doctype good for?
- What is the difference between classes and ids?
- What is the difference between margin and padding?
These should be more than plenty to see how much candidate knows about browsers, standards and the reasoning behind HTML and CSS. Maybe you could throw in some floats, positioning and similar stuff if you want to test detailed CSS knowledge.
Update: The point is the kind of answer you are going to get, of course. If you ask about margin and padding and you get a clean drawing of box content, added padding, border line and margin, possibly collapsing against another box, you know the guy knows what he is talking about. Same goes for all the other questions.