Hacker News new | past | comments | ask | show | jobs | submit login
Explain the first 10 lines of Twitter's source code to me (css-tricks.com)
260 points by ohjeez on Feb 25, 2022 | hide | past | favorite | 290 comments



I'm sorry but if a place I was interviewing for asked me this I'd end the interview and move on. This is about as useful as knowing how to write C boilerplate on paper from memory (something a college professor had us do for an exam), which is to say it's completely useless.

> The first line of every document’s source code is perfect for this interview because how much a candidate knows about the DOCTYPE declaration closely resembles how many years of experience they have.

This just screams "I have some esoteric knowledge and I'm going to lord it over you", sure I remember vaguely when the html doctype first came out but knowing what that does doesn't make me a better programmer. I write that line 1 time max in a project and then never think about it again. Why would you ever harp on that? Especially when most frameworks your are going to be using handle that all for you or it's in the default header block/index.html?

Talk to me about how I'd solve a problem or how I'd architect something but don't quiz me stuff I rarely need to know. Even PHP argument order (a near-useless skill) is more useful than this list. Give me 5 minutes on google and I'll tell you what every single one of the tags mean/do (the ones I might not know off the top of my head), that's a way more important skill then being able to spout off what they are from memory.


I'm sorry but if you don't understand most of the first ten lines of twitter.com (or any website) you're just not a senior frontend web developer. He's not asking you to recite them from the top of your head, he's asking you to have a simple conversation about them.

Who cares if you can architect Twitter. Any college graduate can make a half hearted attempt at architecting some bullshit. What needs to be tested is how well do you know your domain. If you claim to have ten years of experience as a web developer, how much did you actually learn in those ten years?

You can't be serious that you couldn't explain what UTF-8 is, or why text direction might matter, or why we put social media links in our headers if you claim to be a senior frontend web developer.


> I'm sorry but if you don't understand most of the first ten lines of twitter.com (or any website) you're just not a senior frontend web developer.

cough No true Scotsman cough

I'm loving the way you are putting words in my mouth about what I do/don't know from those headers. I can explain most all of them but that doesn't stop it from being a stupid exercise. If you start a potential working relationship with me by asking me to explain 10 lines of HTML head tags then that tells me you focus on all the wrong things. By the way, I am a senior frontend web developer and I've been quite successful at it, thank you very much.


I don't think it's a great question, partially because there are a lot of meta tags there and it feels a bit redundant and slow, and partially because the phrase "first ten lines of Twitter's source code" makes me since - but, I don't see the problem with it. It's a basic question asking you to talk through some stuff. Test of knowledge and communication. There is a right and wrong way to evaluate to evaluate this kind of thing - e.g. "Didn't know about the direction property in the HTML node? Terrible, get out." Would be a pretty lousy interview, but there's no reason to assume the interviewer is going to do that and anyone could beat jerk with any set of interview questions.

I would think that if you would walk out of an interview if the interviewer asked you basic questions then those questions have done their job.


These conversational questions where you talk out some code are probably the most pleasant interviews.

It’s not a quiz, if done right. But you can get to know a lot about someone even by how they respond to not knowing the answer.

Someone with experience knows it’s not a big deal to not know every bit of trivia, but they can talk intelligently about what the code might do. And they know how to find out.

For example, they may point out they know about charset=utf8 in the Content-Type header and admit they thought the meta tag was redundant, and you can have a conversation from there. Or how about "I know 'ltr' means left to right but I never thought about using it with lang=en, but now I want to see what 'rtl' does with English". I suppose it's not the best starter question, but I don't think it needs to be to suss out good candidates from bad ones.

Rage-quitting the interview or blurting out confidently wrong guesses, on the other hand, are bad signals.


I assume that I'm bad at interviews, but I've had people intelligently talk about code, but then completely fail at simple coding tasks. In pretty much all of the cases, they completely understood what was going on, but they were part of a team where someone else was actually implementing it all. So, I think more is needed. This seems to be great for screening though, since it can be done casually, on the phone or while eating a sandwich.


I never doubted you were. That's why I'm saying you're not serious if you say you don't know these things that you obviously do. I'm 100% sure you'd ace the first ten lines of Twitter's html question.

I want to hire you, not someone who's never really thought about what's going on. These questions are just a trick to force someone to step out of the box and go deep into some fundamental web concepts. It's not about memorizing some HTML tags, it's about knowing why they exist.

edit: This is just in the hypothetical scenario I'd be hiring a senior frontend web developer. You generally only need maybe 30% of those, the rest I can get trained on developing features within 3 months after finishing a 10 week bootcamp. I wouldn't bother asking them how UTF-8 works, I just explained what the word "encoding" means to a junior who'se been outpacing me for the past 3 months. The person who reviews their merge request should definitely know what UTF-8 is.


And, if I was trying to hire someone and had this type of conversation with them and they stormed off in a huff, I would be grateful. I don't want to employ people who can't get out of their own mental demesne to have the conversation that I, as an employer, want to have, and I for sure as hell would not want to hire someone who got upset that I asked them questions that they consider beneath them during the interview where the point is for me to figure out how much value you bring.

The ground is beneath you too but you would fall to your roasty death in the center of the planet if it wasn't there, and if you have a gaping hole in your knowledge base then identifying and resolving it before some portion of the companies' success is resting on your too-narrow shoulders is a good idea.


[flagged]


You're not coming off how you think you're coming off.

I'd much rather work with and for any of the people replying than you.


It's also about your communication style. If you know what an HTML tag is for, can you clearly explain it in language that's easy to understand? If you don't know what it does, do you just say that, or do you try and bullshit your way through the answer?


You can't be serious. I save someone a million dollars a year knowing how to properly index and query DynamoDB, not about what <doctype HTML> means or whatever. Or when preflight requests in CORS are too expensive to be worth the overhead vs alternatives. Or the advantages and disadvantages of a REST API following jsonapi.org vs GraphQL.

Nobody cares about text-size-adjust and other such nonsense. It doesn't materially change anything.


I save someone a million dollars a year knowing how to properly index and query DynamoDB, not about what <doctype HTML> means or whatever.

If someone said that to me in an interview my next question would be "Why did you apply for a senior frontend dev role then?"

Nobody cares about text-size-adjust and other such nonsense.

Senuor frontend devs do care about that, because it affects the display quality, accessibility, and readability of a web app on a mobile device. If you get text size wrong on a site like Amazon or Twitter you could push tens of thousands of people to stop engaging with the site. Imagine if the "Buy Now" text on a button overflowed because the font was too big so it read "Buy no" instead. That would have an impact on revenue.


I think this is just one of the many questions. No body is expecting the interviewer to spend hours quizzing you on twitters HTML. But a 5 to 10min discussion on HTML tags and their applicability seems right for a web-developer interview. If nothing else, it shows that the candidate knows tags other than `div`, `span`, `form` and `style`.


This is basic stuff. Perfect answers aren't required.. it's just whether or not you can have a conversation on something technical which you ought to be, according to your job title, at least vaguely familiar with.

Don't take this type of exercise personally; it's not aimed at you - it's aimed at the many people who call themselves "full-stack engineers", but haven't ventured beyond the bounds of a particular framework.


> it's aimed at the many people who call themselves "full-stack engineers", but haven't ventured beyond the bounds of a particular framework.

That's a great point. Lots of people think that full-stack means knowing how to use npm to install tailwind and express. They just don't know what they don't know.

A "full-stack engineer" should be very familiar with standards like TCP/IP, HTTP headers, the OSI model, CSS things like flexbox, DOM, CORS, SQL, websockets/eventsource, unicode etc etc as well as probably multiple web frameworks in multiple languages, various backend and cloud platforms (at least enough to get around in) like AWS and GCP, and understand what proxies and TLS are and what they do, and probably also how to do things like Let's Encrypt and write secure code with XSS, CSRF, etc hardening.

Obviously, everything is a gradient, and nobody is perfect with everything (as well as the JS build tool of the week) but this stuff takes years and perhaps decades to really grok. There's nothing wrong with being a "junior dev", or just a "dev", or whatever -- it takes a lot of effort to master your craft, especially when you're crossing multiple domains from front-end to back-end to security to architecture. But it is important to know where you best fit in, at least at whatever your current career stage is.


I think it's unrealistic for any engineer to remain highly proficient in many of those things simultaneously. I use AWS day-to-day, but haven't used GCP day-to-day in 5+ years - should I realistically be able to keep abreast of the vast number of GCP changes that have happened over that time (plus all the changes in devops that make the workflows I was using 10 years ago look outdated)? Many projects don't need Websockets or Eventsource - do I have to keep that knowledge top-of-mind across the years that I don't use them? Can you really claim that you're "very familiar" with that web framework that you used two jobs ago - assuming there haven't been a bunch of major changes since then? I guess my point here is that proficiency teaches you some knowledge, but perhaps more importantly it provides you with context, guidance and direction when picking up new stuff (or catching up on old stuff).


When referring to AWS/GCP, I said,

> "at least enough to get around in"

Because, you're right -- cloud-based knowledge changes a lot faster (and gets wider) than standards-based, and it's actually a lot less useful because you don't know from year to year if the knowledge is even still relevant or if the product is still supported.

And, yes, you do need to keep standards-based knowledge top-of-mind, even if you perhaps are not currently building projects on them and even if you can't remember the specifics of syntax etc. Knowing every tool in your toolbox will make you a far better engineer, and, yes, it absolutely can be done.


> A "full-stack engineer" should be very familiar with...

That person doesn't exist, gradient or not. There's no way for someone to be "very familiar" with so many different domains at the same time. By the time you gain familiarity with all the domains, the information you initially learned will be out of date or you will have forgotten.

Also, full-stack colloquially refers to someone who can work on frontend and backend.


I sometimes market myself as a “true full-stack engineer” and I’d say I’m pretty darn familiar with everything from the machine code, lexer, parser, compiler, linker, language idioms in a few languages, frameworks, CSS, HTML, TCP/IP, an ever-hating-and-hope-will-die feeling towards GRPC, JSON quirks, YAML quirks, how file systems work, how email works (SMTP, DKIM, SPF, etc), k8s, the Linux kernel, custom drivers, video game engines and the maths behind them (like Quaternions, vectors, matrices, etc), and probably a few other things I can’t remember right now.

It takes a lot of time work to stay on top of these things but it’s a passion, and some things I know exist but don’t know the current incantation for (like getting full screen access for a game engine). It used to be quite long, but I think it’s much less LoC these days. Anyway… we do exist.

Like I said, for me it’s a passion. It probably won’t come up in an interview unless it’s a startup and the job sounds incredibly interesting. Even then I might keep my mouth shut just to not come across as over-qualified or “too expensive.”


To me being "very familiar" with those things would mean that you could perform the role of a SWE, SRE, compiler dev, <language> dev, <framework> dev, kernel dev, engine dev, etc right now and be effective.

Since that isn't possible I have to assume that you have a different definition of "very familiar" than I do.


I’m active in my favorite language’s development, I work as a SWE, my current project is in a legacy system touching billions of people a year. Prior to that, I worked on a stats-heavy project that needed to make real-time decisions for millions of users at any given moment.

On my free time, I work on various things like building a cockpit for a flight sim, building my own Bluetooth door lock, learning new languages and frameworks, creating SDKs for my favorite language to popular services, etc.


It is possible. Contradiction dissolved.


Do you know of such a person? I would love to see someone who can work in all of those roles simultaneously so I can try to learn how they're so effective across such a large number domains.


Sure. I’m like the person you replied to. It’s three things. 1) It took me 25+ years to amass the expertise. 2) It’s a hobby first, and a career second. 3) Since the beginning I always choose to see how things are the same more than how they are different. Goes for languages, hardware, APIs, OSes, protocols, everything. I insist on seeing it all as superficial variations on the same thing, no matter what anybody says.

Oh but I don’t know how to do SRE. No interest.


Same. It took about 25+ years, and a hobby that happens to pay the bills. Interesting that you say that about how things are similar. It’s so true! The same patterns/abstractions are everywhere, just with different words in them, different orders, and sometimes, different names.

I also have no interest in an SRE role. I don’t like being on-call. I build systems to fail gracefully so I never work weekends, but most people don’t do that for some reason.

I currently work as a SWE. We don’t have explicit roles where I work, but my responsibilities are in-line with a principal or lead engineer.


I've also written a Linux driver, a filesystem, IPC code across an ARM CPU and proprietary DSP, web apps in PHP, Python, React, and Go, desktop apps, data pipelines, reporting dashboards, and all kinds of other things. Same as my sibling I stay curious and say yes a lot.


I don't think this is true - while exposure to a wider or narrower set of these domains / technologies will depend greatly by your held positions and responsibilities within teams, size of companies worked for, and raw years of experience (so it is a gradient), I would expect from an experienced web developer to simply be very familiar with all of these if they are passionate and curious about what they do.

I consider myself a mediocre senior web dev, and I am can humbly say that I'm very familiar with all of the listed, without intentional effort in that direction over the years, simply because I wanted to understand the context of some of the things I needed to do, and also poke into each enough to understand how much depth there is and what I don't know. It is natural that it tends to add up.

Over the years, I saw a strong correlation between that breadth and how "good" someone was - on the example of someone working on the fronted in a team, I see 3 basic categories:

1) Not very good: I can do only the most direct and specified things and if something doesn't go as implementation plan intended, or requires outside of what I see as my "formal scope" (e.g. "frontend developer", so React + CSS), I expect someone to solve it so I can continue

2) Ok, but limited: I do only the things inside my "formal scope", so if I'm building a frontend to a web app, it's someone else's responsibility to think about e.g. security - but when something doesn't go as planned along my line of work, I'll find why and unblock it

3) Good: We're building a web app, what are all the things it needs to consider and achieve? My part in the team is this UI / frontend, but if security is important for this use-case, how will my frontend be cognizant of the security goals? I should read up that OSI thing I heard about, cover the basics on my side, and start the discussion on it so we as a team ensure the frontend part is good security-wise


> I wanted to understand the context of some of the things I needed to do, and also poke into each enough to understand how much depth there is and what I don't know

To me this is not equivalent to "very familiar". I think whakim's comment puts things well:

> I use AWS day-to-day, but haven't used GCP day-to-day in 5+ years - should I realistically be able to keep abreast of the vast number of GCP changes that have happened over that time (plus all the changes in devops that make the workflows I was using 10 years ago look outdated)? Many projects don't need Websockets or Eventsource - do I have to keep that knowledge top-of-mind across the years that I don't use them? Can you really claim that you're "very familiar" with that web framework that you used two jobs ago - assuming there haven't been a bunch of major changes since then?

https://news.ycombinator.com/item?id=30474206


> That person doesn't exist

Just because you've never met one doesn't mean they don't exist.

However, often, people like this (sadly) move into management or into higher-level architecture types of roles, and let their tech skills go fallow.


"Very familiar" feels pretty squishy, aren't there fairly standard HR terms for these levels of knowledge? I'm pretty sure it's less than "proficient" which is less than "expert," and I feel there should be at least one more in the middle there. I've always understood "familiar" being just a little more than exposure.


A web developer that can't explain extremely basic tags for something that is the absolute foundation of their tech does sound quite a lot like a scotsman not knowing how to speak Scottish.


I'd strongly dispute this point - these tags need to (usually) be written once per organization, occasionally you need to come in and fiddle with it, but the contents of your page header should occupy no brainspace. Additionally I think this interview question might be testing a depth of knowledge, but not one that's actually relevant for your position. I've worked on backend systems for most of my life (that and databases) and I can definitely name the purpose of most of these tags since, back before node, I'd just be popping them out in some PHP file somewhere - again, once written and then mostly forgotten about. If the job responsibilities are going to involve a modern front-end framework/language suite and your interview isn't even touching on that topic then you're not effectively interviewing for the position - you're querying about some corollary information that most people in the space will sort of know but, if I was their manager, I'd be happy as a clam if they popped over to the MDN and copy-pasted a big chunk of this as a starting point... assuming they ever actually needed to interact with it.


Not to mention they're perfectly referenceable. If I need to set up a new HTML doc and add the meta tags I can easily find everything I need on MDN and a quick Google search for best practices. Anything more specific (like Apple specific tags) is trivial to find as well.

Interviews should be focused on skills and experience because those take time and effort to develop. Not 5 minutes on the internet.


Not only do these get written once per organization, but they are specific to that organization. With the exception of the doctype, html tag, viewport, and charset, we use none of the rest. And our attribute usage differs.


That’s exactly why it’s such a bad interview question, regardless of how “fundamental” it is to a website, changing the HTML <head> tags will never be within the new hire’s scope of work.

They will basically never ever in their entire career need to do this.

It’s like hiring a C++ developer by quizzing them on random gcc flags. These are things that make up 0.00001% of the total work produced by the dev.


Now I'm thinking its a good idea to quiz developers on the first 10 lines of some arbitrary Makefile


Wow, there seems to be a consensus that being able to read an entire HTML file is not a reasonable expectation of a senior frontend engineer. That's news to me, and honestly I can't imagine how narrow the job definition must be if it doesn't include a working understanding of page headers.


I don't think there's a consensus. This is a totally fine interview question.

If you read a thread on hiring, you'll learn that you can't ask a coding question, you can't do a take-home coding test, you can't talk through system design, you can't expect people to have a Github or portfolio, and you certainly can't rely on academic credentials. At that point, it sounds like you have to hire the first person that responds to your want ad, and I'm sure someone is against that too.

The only consensus is that people that care strongly one way or another will write a comment. Those that don't really care just go read some other article ;)


When I look at the article two things stand out to me:

1. The author is focusing on the first 10 lines, not the whole document. 2. Their "perfect answers" have the candidate essentially reciting the reference docs verbatim.

That to me reads very differently from reading and discussing the whole HTML file. It reads much more like gotcha questions or an expectation that your candidate has extremely specific, arcane knowledge.

For example, the perfect answer for line 1 includes:

> This was especially annoying because each standard generated a different layout so this tag was adopted to make it easy for browsers. Previously, DOCTYPE tags were long and even included the specification link (kinda like SVGs have today), but luckily the simple <!doctype html> was standardized in HTML5 and still lives on.

So to the author, one should ideally not just know what "<!doctype html>" is for, but also be able to rattle off complaints against the previous revisions of HTML. The whole article just comes off as very verbose and stifling. (For that line he does allow for a more basic, but still verbose, answer)

Is it unreasonable for a senior frontend engineer to rely on references for some of these extremely specific details?


It's auto filled ha

! then tab (emmet).

To me though most important is that viewport scale 1 and similar tangent, using offsetWidth for Mac's higher DPI screen.


Unless you are hired for a very specific function, why would testing specific knowledge be useful?

The way I see a Senior is someone who can autonomously get shit done. How does testing for specific knowledge help determine if someone is capable of solving problems autonomously? If they don't have knowledge they should be able to seek it out.


In my company we see a senior as someone who can help increase the leverage of juniors.

Another definition I’ve seen is “a senior developer is a developer who can turns other developers into senior developers”

Whereas someone who can autonomously get shit done (and may or may not be good at the earlier definitions) is a “contractor”.


The article makes it pretty clear that the exercise is a conversation, not a test. It’s not just seeing what they know, it’s finding out if they can carry on a pleasant conversation. It’s finding out if they can discuss a technical topic beyond telling the other person to “Google it.” In many organizations a Senior is responsible for helping the Juniors become Seniors — a responsibility not well suited to the autonomous lone wolf.


The way the author writes and answers questions in the comments shows he does actually see it as a test.

> Note that since our technical discussion is a conversation. I don’t expect a perfect answer from anyone. If I hear some right keywords, I know that the candidate knows the concept, and I try to push them in the right direction

I.e. if you don't know the concept you don't pass.

And in a comment:

> I would much rather hire an all-rounder with deep knowledge of HTML/CSS/JS rather than a particular framework. This “Twitter source code” test demonstrates just that.

He literally calls it a test.

Also, I'm not saying Seniors are lone wolfs. I'm saying that they should be able to work autonomously (I.e. without supervision). I'm not prescribing what that work entails.


"but, but leetcode cramming didn't prepare me for this!" /s


Senior engineers duties including mentoring juniors, working with managers and architects, setting and maintaining the technical direction of a project, having input into planning etc etc etc. Talking about the first 10 lines of a website and seniors is laughable.


FWIW, the article said this is a question they use for a senior full stack role, not a frontend specialist role. With that in mind, the question does seem a bit badly formulated. For example, why would you ask about tags that you know through calibration that nobody will answer satisfactorily? And if you're already gathering signals about frontend specialization fluency by discussing web vitals, accessibility and other topics that would already establish competence, then why continue to get into these trivia style questions? Seems like a bit of a waste of time.

One potential problem with this approach of trivia checkbox ticking is that you could be selecting for "mini me" candidates, meaning that you're overfitting for the skillset you already have. For example, maybe the candidate is "full stack" from a primarily backend background, but you're formulating questions like this because you have a frontend background. But then they might seem less qualified than a mid-level frontend-only person because the interview was focusing on frontend, even though stronger expertise on backend would complement your current skill pool better.


> What needs to be tested is how well do you know your domain

I pretty much never look for this in an interview, outside of specific claims from the candidate, specific needs for the position, or the bare minimum.

I try to evaluate candidates for their ability to think, reason and operate in a domain. Knowledge is easy to acquire and useless in the face of changing tech.


Ask me questions I can't answer using Google. If you do ask me questions I can Google, let me answer the what I can from memory & give me points for looking up the rest.


I think this only works if management has enough foresight to hire before the person is actually needed, to allow for ramp up. Unfortunately, I've never seen this, so the person needs to be able to hit the ground running, meaning general intelligence is put to the side, which really sucks.


Is this sarcasm?


I think it's a very good question. You're not just checking boxes and giving a score here, and if the interviewer is any good, it's not just about "how many correct answers".

The depth of each answer gives you a lot of information about the depth and breadth of the candidate's knowledge. It immediately lets you tell the complete idiot who has always copy-pasted without any understanding from the person who lives and breathes web standards.

Since some of the questions are very esoteric, as you said, it lets you judge how the candidate deals with lack of knowledge. Do they make up some bullshit pretending to be confident (which could be a huge problem in a real project), or do they say "I don't know this one, but based on X I assume it's probably Y"?


I agree. If this is judged by how many you can answer then the interview isn't useful. But if the interviewer uses it as a launching point from which the candidate can talk about their experience with web technologies then it's a great addition to a longer interview.


Very surprised to see this as the most upvoted answer. Stuff like doctype is HTML 101. “A framework is going to output this for you anyway” sets alarm bells ringing in my head, it shows that you don’t actually understand the underlying technology and you use frameworks as a crutch.

Look, all of this clearly depends on what job you’re actually applying for. If it’s a junior role I wouldn’t sweat it a whole lot and wouldn’t ask a question like this. But if you’re interviewing to be a senior front end engineer I absolutely want to know that you can head an HTML source and know what the lines are doing.


It's pedantic. Firefox parses the doctype from the document itself,[a] and no one is using Netscape anymore anyway. Any web engineer could learn all of this in an hour if need be. If they don't know it already it's because it is simply miscellania tangential to building web applications today.

[a] You can see this by navigating to `data:text/html,<div>Inspecting the source shows the "naive" HTML. Inspecting the DOM in Firefox shows the added doctype tag.</div>`.


I’m really not sure what you’re trying to say here.

Firefox parses the doctyp from the document. Of course it does. That’s why it’s there. That’s what everything does. What else would it do?

Your footnote is incorrect: `data:text/html,<!doctype html>…` will show a doctype in the dev tools and view source, `data:text/html,…` will not show a doctype in either place, and report the document to be in Quirks Mode. If you want more fun, try `data:application/xhtml+xml,<!DOCTYPE html SYSTEM "about:legacy-compat"><b xmlns="http://www.w3.org/1999/xhtml">Look at this!</b>`.

The history of the doctype is not particularly important any more, and I wouldn’t expect normal developers to know about specific doctypes beyond <!DOCTYPE html>, but its presence is important, and missing it or not knowing it’s necessary for sanity is a definite red flag.

And that’s the first line. Lang, charset, viewport… these are basic essentials that everyone who works in HTML should already know about, even if it’s as simple as “lang="en" means the document is English”, “there must be a <meta charset="utf-8"> right at the top, I dunno why, but it’s necessary like the doctype” and “this viewport tag is to tell mobile browsers that I know what I’m doing on small screens”. Some of the other things in the ten lines aren’t so important for many areas, but you should still be aware of most of them.

The starting point for basic competence is not knowing things, but rather knowing where and how to look: and that requires at least basic broad foundations of knowledge. I would have grave concerns about the foundations of any web engineer that didn’t recognise and know the purpose of at least most of these lines: the first four lines are basic web page functionality, then there’s OpenGraph which it’s important to know the purpose of and what can be achieved thereby, then three lines of mostly mobile browser chrome tweaks and it’s generally wise to be at least aware of this stuff—you get the idea?

I’ve spent too long suffering because of people that don’t know how to write a <title> tag (and writing user scripts to fix this), often because they’re using the Single Page App style and they don’t know how to get their router to change something in the <head>, and maybe don’t even notice it.


You will have to trust when I say the last time I tested this (not when I wrote the comment) using the data scheme without a doctype tag still disabled quirk mode. Clearly you are very knowledgeable about the browser so I am willing to concede defeat here. :)

edit: I suppose what I'm trying to say is: I wouldn't hold it against an engineer with proven experience if they don't know what quirk mode is, but I would become suspicious of their capabilities if they couldn't imagine any justifications for it after giving them a quick rundown of what it is and how it works.


> Note that since our technical discussion is a conversation. I don’t expect a perfect answer from anyone. If I hear some right keywords, I know that the candidate knows the concept, and I try to push them in the right direction.

You seemed to have missed the most important point in this interview. I agree with you that rote memorization is useless, but the goal here is to have a technical discussion on topics like mobile design, accessibility and SEO. And if you're not willing to have this kind of discussion you're doing the interviewer a favor by walking away.

You also don't need to know how to code those by heart, but you need to view at a glance what their use is if you ever need to diagnose an issue, even if it's generated by a framework, because a framework may not generate the proper code for you.


I'll gladly admit that creating boilerplate from memory is a low-value skill, but you absolutely must know why it is there, and what does it do.

Through the eyes of the interviewer, you googling those tags means you don't know what they do. If you were hired and for some reason had to change those tags, what is the chance that you'll just google and copy/paste? (again, through the eyes of the interviewer)

To be fair, not all people work the same way. Some are happy to swim through the mountain of knowledge that web development has become these days, others are happier specializing in a subset of web development, and others will prefer to diversify their knowledge outside of web development, which means wider breadth in exchange for lesser depth. The interviewed should make sure to clearly transmit how he works, so the interviewer doesn't have to make too many assumptions.


How to change meta tags:

1. What is the current general standard. 2. Does our site do what we want it to do? -> Yes? Then we don't need more meta tags. -> No? Go to 3. 3. Are meta tags part of how to accomplish what we want? -> Yes? Look up the docs and tags needed and implement. -> No? Implement without touching the meta tags of the doc.

That's why focusing on the first 10 lines isn't very helpful IMO. Most of these are things that are trivial to look up and read the docs on when they become necessary.

If you want to interview around a site's source you'd be better served to have a discussion around the whole document.


Their answer should include googling the latest accepted specification if they’re going to be making changes or creating new ones from scratch. If their answer is to go to stack overflow, you might have a problem.


The interview is looking for one very specific type of engineer: a frontend specialist with demonstrated experience with a broad range of web technologies.

I see lots of full-stack and generalist engineers screw up frontend development because they don't understand the choices they need to make or understand the consequences of those choices. They lack domain knowledge. Sure, you can Google a meta tag, but if you never knew it existed in the first place you're going to walk into a performance, security, accessibility, or SEO edge case. It's a domain where a good developer with experience is going to outperform a great developer working from first principles.

I usually dislike interviews that focus on trivia. But I also see a lot of people who wouldn't dare disparage other engineering specialisations belittling frontend as trivial. Yes, everyone can and should do frontend engineering, but it is also a domain full of gotchas where esoteric and hard-won knowledge can be valuable.


I'm a senior frontend engineer and I would absolute use this question in my future interviews.

These are really important details to know to become an effective frontend engineer.

Personally I have encountered several bugs related to wrong or incomplete meta tags on html (css units don't work properly if you fail to declare correct doctype).

Not knowing them will either slow you down in solving a problem (SEO, performance, browser compatibility), or introduce a variety of bugs sooner or later.


You’re not going to convince a technical hiring manager that their puzzles are demeaning or pointless. They believe they’ve beaten some sort of game. That they post / blog about it just reinforces this.

IMHO, if you like the company, just answer the question and add 20% to your ask (fee to deal with person X). The hiring process is usually irrelevant to the company culture in my experience.

When I was hiring for my startup it was really just a conversation and reviewing some of their code / ask them to explain what they were doing in a very casual way. Get people relaxed so it’s not some dreaded test. Worked really well for me, but that’s anecdotal. The idea that there’s one true test / formulae is asinine.


jfc I work full time on .NET desktop and even I know this. This is fizzbuzz.

Are you really suggesting that actual qualified web developers don’t know this stuff?

This isn’t even fizzbuzz. I was inclined to think these questions were too obvious to ask but I think these comments are completely validating the interview question.


I lead a team running very large scale distributed systems with almost a decade of experience and I could take a guess about what these elements and attributes mean but I don’t claim to fully know them.

I also believe I’m fully capable of googling the specification and understanding this in like 15-30 minutes, but by your definition I guess I’m a fizzbuzz failure.


You missed the entire point of the article. The point is now to know whether you know those 10 lines by heart, it's whether you can have a discussion starting from just this.

Do you know why the document starts with a doctype declaration? What accessibility tags are and why they are important? What is OpenGraph and why SEO is important? What are CSS resets and why do we use them?

If you can take a guess you're already halfway there. If you can explain what you know about them you've aced it. It's not about knowing all of the meta tags or the OpenGraph attributes, it's whether you can have a discussion about mobile design, accessibility and SEO.


I’m responding to someone who claimed this is a good fizzbuzz test which is different than the point of the article.


Could you not also Google the answer to fizzbuzz in 15-30 minutes?


You could Google solutions very easily but I suspect if you can’t do fizzbuzz you couldn’t explain those solutions very well.

I see fizzbuzz as a basic test to see if one can synthesize basic programming concepts and implement something that works. Explaining the first few elements on an html5 document is more like asking if you have definitions memorized in my opinion.


None of that is 'esoteric knowledge' knowledge!

When you hire people you need to check for basic competence.

I've hired plenty of FEDs and it's a nightmare, let me tell you!

It's not about answering the questions as such; it's about how you answer them and your ability to reason.

The lack of basic knowledge is appalling across the board. The industry is full of copy and paste developers with Computing degrees that essentially have zero useful skills. I'm speaking as an Australia BTW. So YMMV :-)


> I'd end the interview and move on

Interviews are as much about what it would be like to work with somebody as they are about this supposedly esoteric knowledge. If your reaction to a question you didn't see the value of would be to end the interview immediately, I think they'd be glad to have found that out so early.


Yeah I'd only ask that question if I was interviewing people to work at w3.org.

The years of experience line is nonsense. I learned html 25 years ago and can only describe what that line does in pretty generic terms. It's like asking a journalist candidate to give you the Webster definition of "amalgamation".


It's not a very good question and it's not a very good answer either. Discussing the DOCTYPE without mentioning SGML or XML seems to be a bit weird to me.


That was more relevant 10 years ago. Nowadays the primary point of the html doctype declaration is to say 'I am HTML5'. I know this and I'm not even a frontend developer.


Agreed it's not too relevant, but if you are going to ask a knowledge question, rather that a skill question, you might as well expect some theoritical knowledge :)


IMHO instead of doing fancy tricks the first day for interviewing take something that could be completed in one day at the job you are interviewing for and if you can complete it or get it near enough I would think that would be a better criterion to hire. Also, this interview would be paid for the first day at the same rate that you would be hired for.


Wait... completed in one day? So an ~8 hour task? That's way too much of an ask for an interview, in my opinion.


Not everyone does well in a high stakes environment, which is what this sounds like it would create.


I haven't done or even really touched front end work in a decade and I believe that this would have been an interesting interview.

Given his perfect answers I probably would have been able to come pretty close to passing.

If you know anything at all about the details of html, all of these can be easily understood by looking at what they're claiming to do. None of these are esoteric even if your front end knowledge predates wide spread use of mobile devices.

Take line 5 for example. I have never heard of Open Graph, but I know that og: is declaring a namespace for a pretty self describing tag. It's clear from this take with no other information that it is providing a site name for a specific service.

I don't think it's a big ask at all for a senior front-end dev, who is fresh in the field, to know what the first 10 lines of one of the most popular websites out there is doing.


> I write that line 1 time max in a project and then never think about it again.

In my experience, wanting to know why things work the way they do (instead of just accepting that things work a certain way) is a very desirable quality in candidates. Sure, the candidate might have figured out why it worked a certain way and then forgotten about it (which I think is totally fine in this context), but then the interviewer gets to see how candidates approach unknowns.


It's not 'useless' and it doesn't scream 'knowledge signalling' - it's just not a very good question.


Well said


Such a polite community with opinions...


A lot of these things are also automated from whatever framework, CMS or plugins you're using. It's the kind of thing you usually aren't writing in by hand, and shouldn't need to.

It's the equivalent of asking someone to multiply numbers together by hand instead of just using a calculator. Ok I can do it, what have be proven here? Not a lot really.


I actually really like this and I’m a bit surprised to see all the pushback. If someone asked me this in an interview, I would have no problem talking about all of the stuff (origin trials, I might have messed up, but I might have been able to BS my way through the answer depending on the full length of the line and what context I could glean from it) and even now standards and boilerplate and defaults have evolved over the years.

Now, whether or not that would be a good indicator for my viability as a front-end dev, I’m not sure. But at least it would show I have an understanding of what is going on and how to read and explain it. Which is better than a lot of leetcode exercises.

I actually like the idea of asking people to explain code to them — even if it isn’t something like the first ten lines. If I’m proficient in a language, I should hopefully have a good idea of what is going on, at least in a sample app. And that is a useful skill, especially if your job is to come into an already established codebase.


> I actually really like this and I’m a bit surprised to see all the pushback.

FWIW, I have yet to see any discussion about interviewing on HN that didn't attract a lot of pushback in the comments. It doesn't seem to matter what format the interview is in (technical questions like this, leetcode-style problems, take-home problems), it will attract angry comments on HN and Reddit.

I suspect a lot of this is exaggerated. In the real world I've only ever had a couple candidates decline to do take-home interviews, and that's only because they were 99% sure they were taking another offer at that point. Back when we did in-person technical interviews we never had anyone end the interview early because we asked questions that were too hard (as the top HN comment claims they would do).

Take interview-related commentary on HN and Reddit with a grain of salt.


Exactly. I think this question is fine. But every question ever asked here gets mocked as stupid by the subsection of people who think its stupid.


Probably because interviewing is highly subjective. The advice in this article could be used as part of a great interview or part of a terrible one. It depends on how the interviewer uses it.


No. This is nonsense. Nobody has ever, ever asked me about text-size-adjust or <doctype html> in an interview and I've been working in software since 1999 and I make mid six digits in total comp.


Thats why it was posted... because it's a novel interviewing technique. It has nothing to do with how much you make.


Congrats, man. That's how much I made too and no one asked me either. Doesn't make it a bad question.


Yes it does. It's these ridiculous hyper-specific questions that make tech interviewing generally awful.

It'd be like me asking what type of lock Postgres 12 awards when dropping an index concurrently. Or how long it takes for an AWS SQS message to time out. These things don't matter at all during an interview for the vast majority of positions. What matters is figuring out if someone understands how to build software. Do they think through realistic problems well. Do they know the difference between memory and disk.

For example, if there is a conditional index that is frequently accessed, but is small, the O runtime doesn't matter because it's for sure going to be in memory. That's the type of thing that can naturally come up during an interview when you ask someone to, say, plan out a social API endpoint. But the question shouldn't start with the hyper specific because at best that tests recall ability and only after many, many questions have been asked. It doesn't test inventiveness, pragmatism, thoroughness, and attention to detail all of which are far more important than random trivia.


> able to BS my way through the answer

That's it. Anyone claiming to be a senior full-stack engineer should be able to BS their way through this.

If you're shocked by what you see on a "view-source" screen, then you haven't been doing this for very long, and you're not really "full stack".


Meh. Anyone at a sufficiently large/established company might be senior and never touch these. It's not like those tags need attention very often.

The main thing here is that a senior engineer could:

1. Know how to find out what each of those mean (junior engineer level work)

2. Most importantly, be able to come up with a good set of meta tags after some research (mid-to-senior level)

Being able to B.S. your way through reading the tags tells me nothing. It's like asking language API trivia questions.


If someone can get stuff done on the front-end and back-end at a senior level, who cares what they've memorized? I used to memorize all sorts of stuff. The only advantage it gave me was occasionally sounding smart, which it came at the expense of learning actually interesting things, like how to pick a useful database schema.


You don't know this stuff because you have "memorized" it, like with flash cards or something as some kind of memorization exersize. You know it because you know web technologies.

It's weird to use "memorization" as basically a synonym for "remembered". Being a good developer is not just copy-and-pasting things from google, it involves actually understanding some technologies. Understanding technologies is not "memorization".


I don’t think of this as rote memorization tho. This is about, can you read, identify, and explain the different parts. Now, you might not think that is a good test to see if someone is competent or not — and I’m not going to pretend it is perfect. But as these things go, I don’t think it’s a bad starting point.

I could explain nearly every one of those ten lines (and again, I’d have to see to full origin-trials line to know for sure, but I’d say there is a 70% I could infer/BS the answer), not because I’ve memorized anything but because I’ve spent years writing and reading this sort of thing.

Now, if you asked me to write the first ten lines perfectly without any mistakes or use of code completions or boilerplate, I would almost assuredly fail. To me, that’s a stupid memorization test. But asking someone to explain why something is there and what it does, I don’t think that’s the same thing at all.


But for the job in question, this kind of stuff isn't memorisable factoids.

Knowing what these 2 tags are for is fundamental, the wording of the attributes are vaguely self-descriptive, and recognising CSS from HTML is instinctive.

You can't "get stuff done" without being able to at least bullshit the basics.


And BS-ing through it is exactly one of the red flags I'd be looking for as an interviewer.

I don't want people who tell me "it's all under control" and "I know this" and then the result is a disaster. I want people who tell me "I know X and Y but I'll have to look up Z". Tell me that you don't know but are assuming, then show me your reasoning skills by "BS-ing your way through it".


Yeah, I had some great results in the past with "I'm not familiar with that, but if I were to take a guess I'd say ...". Shows you're not a bullshitter and is capable of reasoning about stuff. Good qualities for people I want to work with.

Also, if I have the least bit of doubt about what I'm going to say, I always start with "not really sure about that, but ...". Might seem weird at first sight to be a candidate who is not sure about anything, but it shows you can recognize your own lacks(and look it up if needed), shows you're humble, and usually scores some extra points when you still get most answers right even if you were not so sure.


Absolutely. I think about this as, one of the things we communicate with our speech is our confidence. (Likelihood that some claim we make is correct). Speaking confidently about something you don’t know is epistemic lying. And seeing a candidate lie to me is a red flag in an interview.

It’s also really stupid. An interviewer wouldn’t ask a question like this unless they knew what every line of code shown does. By all means say “I think this does X, but I’m not sure”. But if you boldly tell me it does X when I know for a fact you’re wrong, that will go badly for you.


Absolutely. And I’ll also say that as an interviewer, I appreciate someone who can BS though something like this. Because part of the job is BSing through a lot of stuff.


I really like the question "What happens when I type [x].com into the browser?"


Expecting people to know meta tags is ridiculous for all but very specialized roles. It's the kind of thing you rarely touch once it's set up. I'd expect most developers to be able to guess correct or near-correct answers just from context, which I guess is a test of a certain kind of reading ability. So I suppose that's some kind of signal. But this stuff changes often enough and there's enough subtlety, and very few people touch it very often, that you should be consulting a guide or reference most every time anyway.

This is probably a test of some useful ability for developers to have, but it's not knowledge of these things in particular.

Also:

> <meta name="theme-color" [...]

> This is the proper web standards-esque equivalent of the Apple status bar color meta tag. It tells the browser to theme the surrounding UI.

Oh, so this is the horrible thing that's infecting my desktop Safari and making it hideous and weird and inconsistent? Interesting.


> Expecting people to know meta tags is ridiculous for all but very specialized roles.

Devil's advocate - is it? You're right, this stuff rarely gets touched, and (aside from changing the colours in the bit you hate!) it's the kind of stuff I'd normally boilerplate between projects.

But if you're interviewing for a role and you're not giving them a coding test (yet?) but looking to see how curious they are, how disparate their knowledge is, or just (as you say) how good someone is at guessing from context - isn't this a fun experiment?

I'd imagine just seeing how people deal with the answers gives you a good idea as to how they'd approach something when you're working together. Are they guessing? Confidently wrong? Seen it before but don't know what it is? Can roughly talk around it and what it does without exactly knowing? Proficient in it all (and how that relates to what they have or haven't said on their CV - have they under or over sold themselves?!)?

I assume you could apply the same sort of test to any domain - test someone on something closely related you don't necessarily need to know and see how they react.


It's really just the same kinda thing that fills most coding interviews (that aren't just pure live coding challenges): the interviewer is testing for something that isn't directly relevant to the role, because of course in the real role you'd be able to (and should!) research all the appropriate meta tags you should have on your web site, but since the interviewer deems it too difficult to actually directly test for the ability to do the job, they instead test for things that surely the candidate must have ran into before and has a good enough memory to at least have a conversation so that I can subjectively judge how skilled the candidate is.


The problem with these "present a tangental question / loosely unfamiliar but similar" questions is that they become useless when a candidate does know the answer as memorized trivia. At that point you're looking for a signal about "what does the candidate do when presented with something familiar but unknown" but receiving "can the candidate regurgitate an answer."

Of course you can then ask a different question, follow-ups, and so on, but you're so far off baseline compared to most candidates that the question starts to become useless.


I don't think the point is that every interviewer should ask about Twitters source code, and every interviewee should memorize it.

The point is to ask a few randomly sampled knowledge questions to measure how well rounded the candidate is. Taking the "first 10 lines of Twitter" is just one way to sample such questions.


If you want to know how curious I am, ask me. If you want to know how disparate my knowledge is, ask me. If you want to know how good I am at guessing from context, ask me. If you're asking about meta-tag trivia, all you're going to find out is if I know meta-tag trivia. I know myself way better than any interviewer possibly can. If you don't trust me to evaluate myself, then you shouldn't be hiring me into a creative, professional, self-directed position.


“ I know myself way better than any interviewer possibly can. If you don't trust me to evaluate myself, then you shouldn't be hiring me into a creative, professional, self-directed position.”

I am not sure this is well grounded in the studies of human psychology.


I think it's extremely fair to not trust people to evaluate themselves when doing open hiring - for networked candidates you can usually relax some assumptions and for very senior/niche positions there's usually ample street knowledge available... but in these cases you're relying on a third party for some level of vetting. I would never solely trust a second party during hiring unless I had some method to confirm at least some of what they're saying.

A lot of companies are far too hesitant to trust employees, but blind trust is unwise - you can end up with an employee that either wastes three months salary or actively causes damage.


I think we may be talking about slightly different things.

There is a ton of well researched psychology work on self deception, confirmation bias, it goes on and on.

Asking about the things that the OP was mentioning are deep psychological traps. Perhaps the OP has deep self awareness, but that does not apply to the general candidate or human.

Our blind spots of our own actions and behaviors are profound.


In my experience, lots of people apply for jobs they aren't qualified for. How does I as the interviewer know which candidates I can trust to assess themselves and which I can't?


I mean, a fair number will walk in the door talking about C-pound. A number of them will exclaim "What wizardry is that!" when you open up the developer console (or accuse you of hacking). Just do your best to sus out obvious lemons and fix the rest in post (i.e. figure out if they're full of crap during their probationary period).

If you have specific pieces of technology you're working with and want to interview about then take an afternoon and just code up some bizarre snippets to go through with them - add a few mistakes they should be able to catch and just talk through their process.

I honestly don't think opening up a random website and asking about some of the source code is a terrible approach... if you're interviewing someone for writing HTML in the 90's - in the modern world all the JS is minified (and likely generated by a framework), the CSS is absolutely atrocious to read (usually also generated) and the HTML is pretty much irrelevant. Use something that's going to be applicable to candidates to judge their understanding - I've always been fond of short puzzles very much unlike this one (it's way too arcane) in PHP `0x5 &$var=['cow' => 6]['cow']`[1] - just blerbs where you can step through some syntax understanding and problem solving at the same time.

An actually good suggestion is to check out a random (ideally mostly self-contained) file from your codebase from a decade ago and step through what's awful about it - all code bases have these, and they're usually still kicking around as active code in production. At one of my more recent interviews they sent me login.php (the one actually in production, which they knew was broken - they had two developers before me which were really overworked) and just asked me to mark up wrong stuff - I found SQL injections, unbound variables, conditions that would result in invalid HTML and broken forms and some terrible decisions from a readability perspective. I spent... maybe an hour on it.

1. https://3v4l.org/85MV3


My point was that you can have a conversation with a candidate instead of using arbitrary trivia that is irrelevant to the job and potentially irrelevant to the human you’re interviewing. If you want to find out about someone’s diversity of knowledge, I think “what’s the most esoteric tech you’ve worked with” or “tell me about a project that taught you the most” are vastly superior conversation starters than meta-tag trivia.


The author says he doesn't expect perfect answers

> Note that since our technical discussion is a conversation. I don’t expect a perfect answer from anyone. If I hear some right keywords, I know that the candidate knows the concept, and I try to push them in the right direction.

If I were being interviewed, I would probably say "yeah all those meta tags are metadata for various consumers. The apple related ones are probably for tailoring the page for display on apple devices"

Hopefully that's good enough, if I were doing the interview I wouldn't expect more than that.


Yeah, the post indicates that the author might be Doing It Right, but then there's stuff like:

> Surprisingly, only a few people knew about the dir attribute in my interviews

No. Most of those few people who "knew" it are decent-to-good readers with enough context to figure it out, and in this particular case they probably recognized "ltr", then worked backward to get what "dir" means, and were confident enough about that guess to state it as fact. They did all this in less than a second, because, again, they're decent-to-good readers who had the right context for this particular task. If this had been a made-up attribute you'd have gotten nearly as many people who "knew" it, I guarantee.

This is closer to a web dev reading test than a direct test of knowledge. Which, again, might not actually be a crazy thing to administer.


But don't underestimate the importance of reading as a skill! It's incredibly frustrating to see devs make stupid mistakes and spend time trying to get something to work when the answer is right in front of their nose.

I see this too often. A developer (usually more towards the junior end) who think they can just chug through any problem. Trying this, then that, then google, then that again. When, if they would just stop and think through the problem - and use their eyes - they would see the solution was there all along.


I sometimes see this with C++ compiler errors. People don't even try to understand them. They just change some random things and copy/paste some snippets from Stack Overflow, and finally request help instead of just investing a few minutes to actually understand what the compiler has problems with. Yes, g++ compiler errors are heard to read, but often the needed information is right there.


Totally agree. I’ve definitely made this mistake myself (we all have) and the lesson is definitely to stop, think, read the code and that usually helps with the solution (or at least makes it easier to hone in on what to google)


You’re right that this is closer to a reading test than a direct knowledge test, but I don’t think that’s a bad thing.


It's a perfectly cromulent attribute!


They don't expect candidates to be able to write the "right" set of tags, but they use them as a basis for discussing different topics and recognizing things and maybe doing educated guesses in the meaning are quite useful skills.


> It's the kind of thing you rarely touch once it's set up.

Exactly. Surely being able to actually configure the metadata tags on a webpage correctly must be more valuable than being able to remember what the different configuration options do years later, no?


I think expecting people to know things they really shouldn't, and seeing how they react to that lack of knowledge is a very important part of interviewing.

I assume this isn't the only question OP asks in their interviews, but I think it's got a couple of good outcomes and returns a lot for the length of time it takes to go through.


I've not been a frontend dev for well over a decade but I knew the meaning of all these meta tags. Back then I think it'd be pretty rare to find a good frontend developer who couldn't say what these were.

Have things changed so much that knowledge of meta tags is specialist now?

Assuming this interview was for a front end role that is.


>Have things changed so much that knowledge of meta tags is specialist now?

Yes. More or less all web development now involves generating HTML with a language that compiles to javascript and a framework. No one even looks at, much less directly interacts with, fundamental web code anymore, and HTML has become esoteric "low level" knowledge like assembly language.


But we've always generated the html using other languages, still needed to have a pretty decent idea of how it works. I find it hard to believe that's all redundant now in quite the same way knowledge of assembly is when your a python dev for example.

Like take the open graph meta tags for example, for certain websites it'd be a big oversight to leave them out because you never bothered to learn what they were.

I don't know if all this makes for a decent interview. Just blows my mind that people deem it too low level to have to care about, but what do I know anymore, it's been a real long time since I made a web page.


> Oh, so this is the horrible thing that's infecting my desktop Safari and making it hideous and weird and inconsistent? Interesting.

FYI you can disable the coloring as well as the "compact" layout that mushes the URL bar into the active tab and hides its <title>

https://www.macrumors.com/how-to/safari-macos-turn-off-websi...


Yeah, reading TFA prompted me to finally go figure out how to do that :-)

Much better. No more wild recoloring of my browser chrome because I switched tabs.

> FYI you can disable the coloring as well as the "compact" layout that mushes the URL bar into the active tab and hides its <title>

Did that day-1 with the new Safari. That part was wholly intolerable, not just ugly and annoying.


I am not a developer, never was, but I know most of the stuff in these lines. If I know about it, I expect a front-end developer to know a lot more - the developer is not a monkey pushing buttons in a framework to get a banana and web development frameworks should not be black boxes that nobody using it understands how it works and why. That is a level of superficiality that is terrifying.


It's not a test of their meta tag knowledge, it's a test of how well they can speak to concepts with some context. (For instance, I don't really do anything with Open Graph, and I don't know the meta tag off the top of my head, but I spotted it in this example)



And this is for a furniture rental business...? I think there is a easier way to determine if a candidate has the minimum technical skills required for the job besides a diminutive interrogation about Twitter.


I was going to say what's the point of asking such basic, obvious questions, but reading the replies in this thread – yikes! If you cannot answer at least 7-8 of the 10 questions in under a minute, you have no business being a web developer, forget calling yourself a "senior" one. If I was an interviewer in this situation, I'd be perfectly happy with a candidate who thinks they are too good for this walking away and taking their framework-of-the-month skills elsewhere.


I'd happily hire someone who can write clear, maintainable code in the framework-of-the-month over someone who can remember how to change the Apple status bar color without Googling it.


Recognizing what it is is different from remembering the exact syntax.


Such responses actually highlight the need for us to do basic checks like this.


I’m imagining many of the people who are against this idea have never been on the interviewer side. Or aren’t web developers and feel they should be able to answer this regardless.

The intention of questions like these aren’t to see if you know all the answers, it is to have a discussion and to learn about your experiences and see how you think.

Also if you’re applying for a web dev role and you’re not fairly familiar with what real world HTML looks like it’s may not be a great fit. You may not remember the exact syntax (because who care, you can google it), but you should have an idea of what you’re sending over the wire.


HN: complains about leetcode-esque interviews

Also HN: complains about alternative conversation-style interview

I don't work on the front-end, but I have had a general curiosity for it for a while, and I think this would have been a great conversation starter! And I think a lot are missing the point that the interviewer isn't exactly using this to just "fail" people. Like you mentioned, these are the sort of out-of-the-box conversation starters that good interviewers try hard to come up with so they don't have to just give coding tests and ask the top 30 JS trick questions that are easily googleable.


Also, people who haven't been on the interviewer side have no idea what kind of idiots apply to jobs they're absolutely not qualified for.

Like web developers who couldn't make a reasonable guess at more than two of these lines.


Exactly -- it gets people talking so you hear how they communicate and solve problems.


> The intention of questions like these aren’t to see if you know all the answers, it is to have a discussion and to learn about your experiences and see how you think.

I get that this might be the intention, but if you're being interviewed, and asked to explain the first 10 lines of some code, you'll rightfully feel nervous, and feel as if this is a pass or fail test. If the intention is to make this a discussion, perhaps change the question, and start the discussion yourself.


May I jump in to point out that this is not "Twitter's source code". It's their HTML.

Source code implies it's a programming language. This is not. This is HTML, which is a Markup Language (hence the ML in HTML).

There is probably some Javascript code there further down but you didn't look at it.

In common parlance, Twitter's source code is the source code to their web services and backend systems, which is not public.


I mean, right clicking my browser shows "View source code".

Are we going to giggle about how those dumb browser developers don't know that it's not actually the application server source code, or can we admit it's the source code of the rendered page, a different layer of the stack?

Is it really that much of a mistake to shorten "Twitter's [html] source code"?

Frankly, I think a bigger pedant could come in here and correct you.


At least one major researcher studying programming (and how people learn to program) would agree with you!

Check out Alan Blackwell's "What is programming" paper from 2002. In it, he argues that we should not be asking "is writing html programming", because that question comes from an older (past overdue for revision) mental model of what programming is all about.


I don't know what browser you're using, but in Brave it says "View page source" not "View source code".


I tend to agree with this. My expectation from reading the headline was that it would be code from the backend (which admittedly seemed odd, since that's not public).

I can't recall ever seeing someone use the phrase "X's source code" to mean HTML. In my view it's data, not code. Just like you wouldn't call some XML file "source code" -- it's purely descriptive markup. When a browser's context menu says View Source, the word "code" isn't implied. It's the same usage of the word "source" meaning "origin" (as in "cite your sources").

Maybe I'm being overly pedantic, but the phrasing definitely read strangely to me regardless. Speaking as someone who's done a mixture of programming and web development for over two decades.


Calling it "Twitter's HTML Source" or "Twitter's HTML Source Code" would be reasonably clear. But just saying "Twitter's Source Code" does imply something other than that, probably non-public backend code, you're right

That would make me wonder about the interviewer's experience. That's not a feeling you want to have at the start of an interview


Agreed, if an interviewer asked me to look at source code and then opened this up I’d have a good laugh.


The browser ui to view this Html has been called View Source for decades.


If someone starts arguing about this in an interview it would be the quickest no-hire decision ever.


“Sorry, we don’t hire pedants here”


"Have fun with your bootcamp graduates then"


I'd say it's fair enough to consider markup as code ("code" in the sense of morse code)


To web people this is "source code." It's what you see when you say "view source."


Author needs clickbaits to get clicks


It’s the code you see when you view source


"As a side note, it looks like Twitter omits the HEAD tag for performance reasons"

Yeah, right.

HTML is supposed to be <html><head>head stuff</head><body>body stuff</body></html>. But in practice you see multiple HEAD sections, missing HEAD sections, multiple BODY sections, missing BODY sections, and even multiple HTML sections. If you omit all those tags, it still works, mostly.


It's an absolute necessity that they shave 13 bytes off the packet size... to make room for more advertisements. Their page size is 90KB for me, which isn't great nor terrible, but violating standards "just because" feels unnecessary.


Omitting the <head> tag doesn’t violate any standard. It’s valid HTML.


    The title tag SHOULD occur in the head of a document[1]

    The <title> element is always used within a page's <head> block.[2]
Just because browsers are compatible[3] doesn't mean what you're doing is right. Twitter does set a title tag and thus that tag should be within a head block. They are leaning on browser compatibility mode to cover the fact that they aren't adhering to standards.

1. https://www.w3.org/Provider/Style/TITLE.html

2. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ti...

3. "HTML5-compliant browsers automatically create a <head> element if its tags are omitted in the markup. This auto-creation is not guaranteed in ancient browsers." https://developer.mozilla.org/en-US/docs/Web/HTML/Element/he...


> Twitter does set a title tag and thus that tag should be within a head block.

It is in a <head> element. You don’t understand how HTML is parsed. The opening and closing tags for the <head> element are optional. That doesn’t mean the element isn’t there, it means that the element is always there.

> They are leaning on browser compatibility mode to cover the fact that they aren't adhering to standards.

They aren’t. See this comment I made and go ahead and paste that HTML into a validator:

https://news.ycombinator.com/item?id=30475015

There is no error handling taking place, there is no browser compatibility mode involved. This is correct HTML that adheres to the standard being parsed normally.

> [1], [2], [3]

Why are you quoting a style guide written in 1992 and two unofficial sources when you could just as easily have referred to the actual HTML specification?

> § 13.1.2.4 Optional tags

> Certain tags can be omitted.

> Note: Omitting an element's start tag in the situations described below does not mean the element is not present; it is implied, but it is still there. For example, an HTML document always has a root html element, even if the string <html> doesn't appear anywhere in the markup.

https://html.spec.whatwg.org/multipage/syntax.html#syntax-ta...

The HTML specification literally gives this as an example of a valid document:

    <!DOCTYPE HTML>
    <title>Hello</title>
    <p>Welcome to this example.</p>
There are a great many ways in which people write broken HTML and the browser repairs things. This is not one of them. Omitting the opening and closing tags for the <head> element is perfectly correct HTML that adheres to the standard.


> HTML is supposed to be <html><head>head stuff</head><body>body stuff</body></html>.

It’s not. Every single part of what you quoted is optional, and you didn’t include the parts that are actually required.

This is a complete, valid, correct HTML document:

    <!DOCTYPE html>
    <title>…</title>
    …
> But in practice you see […] missing HEAD sections […] missing BODY sections

You never see this, ever. It’s not possible to have an HTML document without a <head> or <body> element. The document I listed above has one <head> element and one <body> element. Both the opening and closing tags for these elements are optional. When an HTML parser parses that document, it will construct a DOM with those elements in it.

> If you omit all those tags, it still works, mostly.

Omitting these tags works completely. This is valid HTML that follows the HTML specification correctly without any need for error handling. All browsers follow these parsing rules without any problems.


You beat me to the punch, but at least I can support with a link to the spec: https://html.spec.whatwg.org/dev/semantics.html


So his way to test a full-stack javascript developer is to let someone explain 10 lines of which none is javascript.


If you position yourself as a full stack JavaScript developer and you think talking to 10 lines of non-JS front end code is too much out of a 1 hour long interview I'd be extremely suspicious of how much time you've spent on the front end half of JavaScript integration.


The issue I have with this test is it tells you nothing about the person you are interviewing.

When would you actually create such tags as a fullstack dev? Almost never. 90% of the time, those tags are auto generated by some boiler plate app.

A person that can answer correctly MIGHT be someone that's looked into those tags and done things the hard way, but is that really someone you need to hire? A person that answers incorrectly doesn't necessarily seem like someone I wouldn't hire. After all, what do I care about someone knowing the intricate details of the "html" tag and how it interacts with various browsers? That's write once and forget sort of code.

If you wanted this test to mean anything, why are you picking worthless trivia. Why not, instead, pick something like a function out of jquery or your own code base and ask the same question "Tell me what this function is doing".


"Explain the first ten or so lines of the Twitter source code to me." doesn't read to me like a test, it reads like an opener. Sure, it's possible to show off you know 100% of the trivia for the tags that show up... but more so it's an opener for you to talk to about how much background you know, how much you can relate what you didn't know to things you did or have worked on, and how much you've bothered to go beyond "that boilerplate is generated for me" and look into what the first few lines of the webpages you work on do.

The point does not at all seem to be "Aha, gotcha! You didn't know about the syntax for Apple's limited PWA like functionality offhand in an interview. 5 demerits, next question!".

A person that can hold a good discussion around these tags is both likely to be one that has truly been developing pages for a couple of years and has an interest in learning more than how to make their framework work rather how to make any framework work in a browser. If you're not able to say something cursory about language attributes I'm going to have a hard time believing you've full-stacked a multi-language website (not that I wouldn't but it'd lead to a lot of different questions later). If your response about the doctype line is "it's boilerplate put in by my IDE" my first thought isn't going to be "oh they just spend a lot of time writing code in the rest of the page" it's going to be "they either don't care what the first line of the page is about or it's been so long since they've touch the front end directly they can't say anything about the first tag. I wonder how well they can deal with integrating the front end JS with the page" and steer to towards more about that.

Also the interview was mentioned to be an hour long, if 10 lines of HTML boilerplate, most of which should be on every page, is too far into the weeds of front end time wise then I'd have severe concerns the candidate would be too back-end heavy. Yes, other things should be talked about too, that's why the interview is an hour and this singular question is only about 10 lines.


> 90% of the time, those tags are auto generated by some boiler plate app.

Well, that's a problem. If you don't know how to create a web page with out having to fall back to using "some boiler plate app", I question if you really are a fullstack developer (I would also question if you really can consider yourself a web developer at all, but I know that will just upset people, so I won't go there).


I'd say that's legit, considering what he is looking for - full stack. JavaScript is strongly connected to the term WebDevelopment and thus to HTML. That's just basic knowledge.


Sure, but it also means being skilled in writing Node backends and I'm doubtful if knowing what some meta tags mean is a good indicator for that.

This is the equivalent of interviewing for a C developer by letting him explain a Makefile.


Surely you don't think this would be the _only_ tech-oriented conversation starter / interview question in a full-stack interview. This is for testing the front-end "half" of a full-stack dev's skills. A separate conversation in the same interview would be had for node, SQL, etc.


what's wrong with that? surely a c developer would know their tools. I wouldn't call it a stretch to ask if a java developer could explain maven


Pretty much the same thing that would be wrong with asking a javascript dev to explain grunt.

What if that C++ dev primarily uses visual C++ and Visual studios projects? What if the C++ dev primarily used Cmake, ninja, or scion (or any of the other thousands of C++ build tools).

What if that C++ dev never really needed to start a project from scratch?

The issue is testing someone on minutia doesn't tell you anything about how capable they are. In particular, testing them on minutia that they very likely rarely interact with is beyond pointless.


> What if that C++ dev primarily uses visual C++ and Visual studios projects? What if the C++ dev primarily used Cmake, ninja, or scion (or any of the other thousands of C++ build tools).

Then it's an opportunity for the candidate to explain the tools they do use.

There are certainly bad interviewers out there who misuse these kinds of questions, but I think they're fine if used as conversation starters.


if it makes any difference, I was referring to C, for which Make is the majority, I think - could be wrong, though, since I'm not a c developer.

But to the point, I'm not sure if the code at issue would be considered minutiae or not, but I believe that the more curious you are, the more you tend to dig into the details, and a person doing this over many years would attain a rich knowledge-base spanning depth and breadth. I know as a java developer that I've referred innumerable times the docs for the POM and settings structure in order to explore the limits of customizing my build, which would include the rather obscure features. Not saying this is technically comparable to meta tags in html, but maybe that's what the author was going for.


It's not that they can't technically answer it.

It's that the signal you're gonna get out of such an interview is gonna be so low that whoever you end up hiring is mostly going to be due to chance + how much you "liked" them.


I thought "full-stack" implied you understood the front-end web environment?


> A full-stack developer should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for junior developers.

-- Robert A. Heinlein


I do like this interview question - but I would angle it a little differently.

I'm definitely a "senior" web developer - been doing this since '97 - but I couldn't talk fluently about a number of these tags, particularly the exact meaning of each of their properties. However I have used most of them at one point or another and they at least ring a bell.

Most of them are tags you throw in at some point to solve some problem or other and forget about them. At least, that's the way my memory works.

They are, however, an interesting Rosetta Stone into many different browser quirks and technologies that I would expect a senior developer to know about.

If I were to show this list to a candidate, I might ask them to pick one of the tags and talk about a time they used it in a project, to keep it on a level that's comfortable for them and not risk "freezing them up". I would expect the discussion that ensued to give me a good sense of their depth of knowledge in one area. After a few minutes, I'd move on to another topic.


The comments in this article are embarrassing. It shows none of you have even basic reading comprehension. Either you didn't read the article at all or not very carefully:

"So, instead, we have an hour-long technical discussion where I ask them questions about web vitals, accessibility, the browser wars, and other similar topics about the web. One of the questions I always like to ask is..."

It's ONE of the questions, so those concluding it's a terrible interview altogether are dramatizing.

As for the question being relevant or not, I think it actually does say a lot about a developer. Just those few lines of code show historic knowledge, internationalization, SEO and social networks, mobile optimization, CSS normalization, and bleeding edge features (origin-trial).

In that sense it's an effective question. You learn a lot about someone with little code, even if the understanding of some individual lines is not a showstopper.

Finally, saying that your framework usually generates this for you isn't the great answer you think it is.


Quizzing on trivia, especially minutia that can be looked up and fully understood in less than 2 minutes, seems like a waste of time to me on the interviewer's part.

I also find it strange to pick apart and quiz on the messy output of Twitter's frontend frameworks, compilers/transpilers, minifiers, bundlers, etc. It's akin to feeding a binary or some bytecode into a decompiler and quizzing on its output.


Knowing what a <html> tag is is very far from trivia. If someone fails to answer at least ~7 of 10 questions in this interview, there's really no point in continuing on. I'd call it an excellent filter.


The best questions are the simple ones that start a conversation. That only works if the interviewer is confident in their ability to read people and competent at their job. These articles are written by and for people who don't meet those criteria.


I just don't see the value in the questions from the OP. What if the person being interviewed genuinely doesn't know and says, "I don't know"? Asking them to then guess what the markup could mean doesn't really tell you much about their skills or abilities. It feels like a potential dead end to me. I think there is better material to review and ask questions about that actually pertains to the abilities of the interviewee or the skills needed for the job at hand.


There's 10 lines.

If they're applying for a web development role and say "I don't know" to all of them, it tells me enough about their skills and abilities to end the interview right there.

If they don't know half of the trivia but tell me "this looks like it probably controls browser feature X", and they're making a reasonable guess (regardless whether it is correct or not), that's a good sign.

If they don't know something but confidently pretend they know and spurt bullshit - red flag. I don't want to have to second-guess everything they say, and have them deliver something that looks right while being completely wrong.

If you don't know what that specific prefixed attribute does, I don't care. If you don't know what a vendor prefix is in CSS, you haven't written much CSS.


> Twitter also applies user-scalable=0 which, as the name suggests, disables the ability to zoom

I want to revoke the keyboard from whoever decided this is a feature.

I understand removing features in order to clean up a UI, but this serves no such purpose. It's purely removing a feature because you think you know what the user wants, despite there being no negatives to leaving the feature enabled.


Check your browser settings under accessibility. It makes sense for most users to allow sites to disable this, because users accidentally zoom (especially by double-tapping) making the web app feel non-native and broken. But I believe most browsers let you tell them that you always want to be able to zoom, and then they ignore this setting.

Providing it as a setting has the advantage that developers just set it (and you can tell your browser to ignore it), instead of finding some horrifying and harder-to-avoid way of preventing the browser from zooming.


Ditto for everyone who has ever written code to stop me from copying text - they're obnoxious anti-features.


WebKit ignores this, I can resize Twitter no prob https://webkit.org/blog/7367/new-interaction-behaviors-in-io...


I assumed my accessibility settings were overriding this. Enough websites had disabled zoom I turned it on.



This seems to be closer to the right approach to interviewing over the leetcode grind, but it's the wrong example. The head tags are trivia and have changed a lot over 5-10 years (not to mention Twitter doesn't include the head tag which is just wrong, IMO, though every browser since the '90s is flexible on this and everything else to do with HTML). Many front end devs haven't touched the head tags because that's a separate team. Or it's the lead devs that set that up. It's also the kind of thing you set once and never touch again and every site will use different head tags.

A better approach is to drop into some code and ask the candidate to explain it. What's the code doing, why is it doing it. Maybe even show some code with a bug and have the candidate fix the bug. That's like 60% of most jobs right there. Reading code, understanding what it's doing, and figuring out how to make changes to it.


Hi! I'm not a front-end person, I'm an ops guy, I live in the world of bash terminals and thread dumps. My knowledge of HTML and CSS is enough to make some headings and paragraphs. So pardon what might be to you folks who look at this daily-seem like a "duh" question.

The article says this:

You might think that this information is redundant because the browser already knows that the MIME type of the response is text/html; but in the Netscape/Internet Explorer days, browsers had the difficult task of figuring out which HTML standard to use to render the page from multiple competing versions.

Are there still a lot of browsers in use that have difficulty figuring out the HTML standard, and if not, is the doctype declaration just an anachronism of markup?

Asked in a less roundabout way: If response data is sufficient for a browser to know what it needs to do, and modern browsers support such capability: why do we still declare document types?


It's not that there's any "difficulty" in figuring it out, but it's literally part of the standard. An HTML 5 page will not render correctly without <!DOCTYPE html> even in modern browsers.


Ok, that's fair, it's in the standard.

I suppose my real question is (and maybe this is a discussion that's been beaten to death and I'm merely ignorant of it): why does the standard require it, if modern technology seems to have obviated the need for it?

Am I too far off the mark with "backwards compatibility" as a scientific wild-ass guess or is it more complicated than that? And if so, with what kind of devices/browsers that would still be in use today?


It is for backwards compatibility, but you're thinking about it in reverse. It's so that modern browsers can also render pages written to older standards correctly as well. They will not use "HTML 5 mode" unless the page explicitly declares that it's HTML 5. Nor should they, because you can't have a valid HTML 5 page without it.


The loud noise you're hearing is the sound of a bunch of old, rusty mechanical gears clanking into place. This explanation makes perfect sense to me now. I hadn't done much serious front-end things since high school in the early 2000's and even then I had no idea what "web standards" were. I just knew how to make pages and display images for a counter-strike 1.6 clan haha.

Thanks for taking me to school.


No problem, glad I could help!


Most browsers have quirks modes for different types of HTML standards. Certain errors are renderered in certain ways because that's what web devs used to expect, even if they weren't following the standard. If you strictly enforce XHTML1.1 or HTML4 because the website says that's the standard it follows, you end up with tons of broken websites. It's a consequence of websites historically being lenient with front end developers.

The HTML5 string basically says "I promise to be good, please turn off your weird workarounds". Of course, HTML5 has been around long enough that some browsers still have certain quirks, but they're not as extensive as the ones before HTML5.

Compared to the `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">` monstrosity from before, I'll happily take the modern standard. There's no version number anymore, just a simple HTML identifier.


Browsers include a lot of crazy backwards compatability stuff. You can basically trigger a whole different experience with the right/wrong doctype line.

I guess it'll disappear eventually and become an opt out rather than an opt-in, but not sure if we're there yet, IE11 has been a major drag on progress.


It can never disappear and become an “opt out” without breaking backwards compatibility. This has nothing to do with old browsers, but rather, old content. You can’t go back in time and rewrite every HTML file ever published in order to have them “opt in” to quirks mode.


I like that now we have "apple" tags, and "twitter" tags everywhere. Maybe cocacola and mcdonalds should buy a tag too , because, why not. At least facebook had the decency to call their tags "open graph"


I'm not so sure about this one. There's not much open about opengraph other than that Facebook published the for wat they want to use. Everybody else copied it, but Facebook decides what does and doesn't make it into the standard.

At least Twitter has the decency to mark their proprietary standards as proprietary.


why didnt twitter just use og: ? it 's the exact same content. they create tag pollution without thinking


FWIW, Twitter does fall back to OpenGraph tags:

https://developer.twitter.com/en/docs/twitter-for-websites/c... (scroll to bottom)

For example, maybe you want to specify a Twitter username for your Twitter card but for all other OpenGraph consumers you want different attribution. You may also want to serve a specialized crop of the image to Twitter vs other consumers since they all display differently (Facebook doesn't crop the preview iirc but Twitter does, so you may want to specialize the image for Twitter).

It's not completely braindead that they let you specialize for Twitter.


Count me as someone who loves this. I could turn this prompt into an enjoyable 30 minute discussion easily. I am a front end developer, not a computer programmer. I cannot reverse a linked list or invert a binary tree. But I can explain in depth to you about every single aspect of the browser, HTML, CSS, JS, and UI engineering in general. I have a decade of deep, specialized expertise in building software for web browsers, and an encyclopedic knowledge of web technologies. I can build anything, and my previous work speaks for itself. But I simply cannot pass the SV Leetcode/whiteboard style interviews. It's maddening.


If anything this illustrates how convulated and painful web development has become.

The design was that HTML was HTML and the client managed all the implementation details. Over time that got ruined by wildly different implementations, introducing non standard tags and so on.

I'm glad I moved away from it before mobile versions of sites became a neccessity.

Having to do all this work to cater for members that have a mobile device made by a specific manufacturer just emphasises that the whole thing has gone totally off the rails and completely awry. The ratio of actual information you read vs the amount of cruft that comes with it to display it is insane. And it's been a major issue for a long time. It was painful enough in the 'if !ie6'...era.

At what point does the ongoing cost of presenting and maintaining the information exceed the value of the information itself?

However, this is the reality of the online world we live in today. It also makes you appreciate the simplicity, usability and maintenance-ease of HN itself. You're already into the actual content only 3 lines in.


This test leaves me conflicted. I'm often surprised by what developers remember and more importantly forget; it seems that after a while the fundamental elements of what makes up a website are lost in the sea of new development languages or platforms. I've done front-end design and development for over a decade now but have largely leaned into the prototyping and design area of that career, so my knowledge of development is limited enough to not have forgotten HTML and the markup for building a page. I would've been able to ace this test while also failing to be suitable for a senior Javascript developer. Developers here on HN who would likely be able to outwit me in every way in development seem to have lost touch with simple HTML markup. Still, I wonder if something important is lost when development requires these basic elements of a page to be forgotten in service of a new framework or language.


I wonder why so many interview questions are focussed on knowledge and memory. For most technical roles, and especially in the ever-changing world of FE; your main skill is looking things up and applying what you find.

I do find this an interesting question in some ways, it probably gives some insight into the breadth of knowledge and experience. But I would not spend too much time on it. Get the impression, move on.

What would potentially be more interesting is to ask them to look up some of the things they don't know.

But interviewing is hard, it's a strange dynamic by default, it's hard to not make it cringe. A conversation like described in the article is sort of nice compared to many other tactics.


> I wonder why so many interview questions are focussed on knowledge and memory. For most technical roles, and especially in the ever-changing world of FE; your main skill is looking things up and applying what you find.

Yes, but you need to have some foundation of quickly-accessible knowledge ready to go, so you can focus on looking up the hard things. Technically I could hire motivated college students and give them years and years to look everything up and study it as they go, but I could also ship the same software in a fraction of the time by finding someone who has experience doing something similar. That's the purpose of interviews: To gauge baseline experience.

The alternative interview format is a take-home problem. The candidate receives a small, arbitrary problem (not real work) that approximates a ticket they might work on at the job. They're free to solve it at home on their own time.

Unfortunately, take-home interview questions are also a contentious topic on HN. A lot of people on HN insist they refuse to do take-home problems or otherwise hate the idea of candidates having to put effort into the interview outside of the conversation.

I think the real take away is that engineers (and other professions) just don't like to interview. Nobody likes sitting in front of someone else and having their performance evaluated. Nobody likes potentially being rejected. Nobody likes being asked to do effort to interview for a job they might not get.


I disagree with this point of view. The main foundation isn't of quickly-accessible knowledge, it's having a good process and strong intuition. Knowledge feels more incidental than being the main focus.

If you throw a Staff engineer into a new domain they're likely going to quickly become more effective than a mid level engineer with domain knowledge because they have better meta level skills.

Of course, this is very dependent on how specific the function of the person you're hiring is and how quickly things are moving. If you're hiring for a very specialist role then knowledge will be a lot more valuable. Same goes if the domain is not moving very quickly (I.e. historical knowledge is valuable).

Though in general, I think a lot of people would jump to hire a SWE who has been an expert in a different domain.


> The main foundation isn't of quickly-accessible knowledge, it's having a good process and strong intuition. Knowledge feels more incidental than being the main focus.

Well said! I very much agree.


Why interview questions are focused on knowledge? Because you want to hire someone that knows how to do things, not how to Google it or ask on Stackoverflow and assemble bits and pieces of stuff wrote by others in a Frankenstein monster.

Memory? It is not a test to write rare parameters correctly, the questions problem the knowledge about the most basic things in web development - html. It's like asking a surgeon in a hiring interview if he knows what a scalpel is; not the chemical composition or forging method, just what is used for. Imagine the guy saying "I don't know, I never memorize this stuff".


How often do you write the html params and meta tags?

I really don’t care if someone memorized all the meta tags. What matters to me is that if I ask them to write a template they can find out what they need to include according to the latest best practices and our situation. I rather have them looking it up than relying on something they memorized years ago and might be outdated.

Looking things up is not the same as carelessly assembling as you describe it. It’s the ability to gather knowledge quickly, learn on the spot, so they can work on things they haven’t worked on before, and keep up with the latest best practices. Absolutely essential to FE development.

And some of it is assembling and relying on tools to work efficiently; for example I would highly recommend to generate Favicon and tile tags.

To be an effective fe dev require tons of learning on the job and doing your research as new things arrive constantly, best practices change, and you will encounter many things you haven’t before.

Like I said; experience and breadth of knowledge is an interesting indicator, but it doesn’t make much sense to me to have it as the main indicator.

> Imagine the guy saying "I don't know, I never memorize this stuff".

Then I would ask them to look it up and get an impression of their ability to gather quality knowledge and understanding. Not a problem to me, and I would appreciate the opportunity to gain insight in those skills.


> the ability to gather knowledge quickly, learn on the spot, so they can work on things they haven’t worked on before

That is perfect for a junior, not acceptable for a senior that is supposed to already have solid experience with that stuff; HTML tags should be something they worked before a lot.


I'm an old-timer and mostly backend now... I knew all but one of these lines. But the chances of me now being able to make a website based on modern frontend frameworks is near zero.


I don't see a problem with this line of questioning.

It seems likely that someone applying for such a position would be interested in the fundamentals of the subject matter, and also that they would realize that the goal might be to start a conversation.

Let's move away from this particular topic for a moment. Were I hiring someone to teach English literature, I might ask the applicant to talk about their favourite novel, play, or poem. The idea is to learn, through indirect means, whether the person has a long-standing interest in the work at hand.


My only question is why does a furniture rental site interview candidates like they're trying to change the world. Dear lord, you're making a CRUD app. Get over yourself.


I really like this as an interview task. I wouldn't do particularly well, as I'm more on the JavaScript side, but it would really expose the parts of web dev that I'm not familiar with.

Prompts to have conversations that expose a candidate's depth of knowledge in real world cases are exactly what an interview should contain...


I am a software engineer with about 35 years of experience. For the last 10 years I am working as an engineering manager, but I am taking an interview or two on engineering positions from time to time.

I firmly beleive that a good software engineer will never pass an opportunity to write code during the interview, being it a Leetcode, "explain this" or architectural flowchart. If I feel that the task is too easy - good for me, I can ace it and grab some extra points talking about how I would test or deploy that code.

Leetcode could be hard. Writing code on a paper could be even harder - I tried it myself. So, denying it you are showing that you are afraid of hard problems. I don't treat it as a strong downside, and I beleive that there are a lot of teams where this type of personality is totally acceptable. But I don't think those teams will ever be successful.


When I interviewed people I asked questions like this in their domain, and the responses were quite valuable. The answers immediately highlighted how experienced the person was, how long have they been in the domain, and what kind of approach they used in their work.


I do my own front end work but most of what this bit is about is boilerplate stuff I just edit as needed.

I think I'd have missed at least half what he's asking for because front-end work is not what I focus on primarily and I didn't get to see the entire line of code.

I spend most of my time designing logic flow and writing functions to perform it. Asking me to do front end work would be a waste of my skills. I'll never be as good as someone who specializes in that, and I don't know many who do that would be as good as I at what I do.

I'm sure there are many who are better than I at what I do. I learn from them everyday, but I doubt they spend a lot of time on front end stuff. They probably do what I do, copy and paste that stuff and get to work.


It's the cross section of subjective vs objective .. I'd much rather you give me an actual problem you have and let me have a go at explaining a solution for you. All this tells me is you are recruiting generically and have no idea who you need on your team.


Its interview questions like this that makes me never interview for a new job. I get jobs when I need them pretty easily, but usually just through someone who already knows me and/or worked with me before and skip the silly interview questions like this.


What don't you like about this question?

The author isn't looking for exact right answers and just wants a discussion about the technology to gauge your skill.

I enjoy interviews like this.


Is this a trick question, and "HTML isn't technically code" the correct answer?

Because it's not. It's a step up from typesetting.

There is a small if very vocal minority of webdevs acting like their work is the most meaningful and complex work imaginable when the "source code" they work with is what you would get if a 2nd year CS student was asked to re-implement LaTeX in XML.

Gatekeeping is so much more prevalent in webdev because it's really not that complicated until you abstract your framework a couple levels up and then insist it's the industry standard.


> Perfect answer: This meta tag...

The perfect answer calls these elements, not tags.


I think this is fine as a fun litmus test, I don't think it's fine as a key criterion. If a person didn't know a single one of these, they should still be in the running (if marked down a little bit). Most senior front-end devs I would expect to have a decent grasp on maybe 1/3 of these.

I think it's fine to have some ridiculous questions that you don't expect anyone to get perfectly, just to gauge, though it's important to communicate that to the candidate so their nerves aren't rattled when they feel out of their depth


Reading the article, it sounds like the author is looking for a Senior Software Archeologist, not a full stack engineer. None of this is relevant or useful to any job somebody might be doing.


Who do you think wrote that code for Twitter?


My guess would be Mark Otto[1].

[1] https://github.com/mdo


I know these, because I build websites, often simple static sites. A bunch are social or just rendering on apple devices.

And manifest wasn't even in there. though does anyone actually 'install' pwa 'apps' (sorry double apps)?

IDK why anyone who's main job is not SEO or building static html pages should know this. Except maybe viewport for people writing css by hand. Hell even then.

You can just use a generator. I think the SEO one that generators most of this is the #1 wordpress plugin


The only one I didn’t know was origin trial; though curiously that line also used http-equiv, which is an interesting one, because those meta tags act can be used in place of response headers (and vice-versa). I was a little surprised that the “perfect answer” didn’t call that out.

I’m actually impressed there was quite a lot to discuss in just 10 lines. That said, i’m less convinced it’s worth spending precious interview time on it, but I could be persuaded.


People here are arguing that having "esoteric" knowledge is pointless. But the point of the article was to use it as a "discussion point" and get the person talking about things.

I've interviewed lots of developers and that's much more important to me than whether they know the intricate details to see whether they are good to hire.


Why are lines 10+ not inside of a <style> tag? I wasn't aware you could put CSS into the document without being in a <style> tag.

Also, why does the document not have a <head> tag? And, why does it not have a <title> tag?

It appears that many things that I thought were normal to put into an html page are not.


There is a <style> tag. It's at the end of very long line 9:

  ...haW4iOnRydWV9" /><style>html,body{height: 100%;}</style><style id="react-native-stylesheet">[stylesheet-group="0"]{}
Several of the first 10 lines are extremely long and have a large number of elements per line. Because it's not meant to be human-readable, to save space, newlines are omitted where they are not required.

<head> is optional in HTML5 syntax. It's implied by the first <meta> tag. There's still a <head> element, which you can see in the DOM inspector.

<title> is optional. But in Twitter's case, the <title> element appears to be added later by JavaScript, as it's not in the page source but it is in the DOM after loading.

Various people say <head> is omitted to save space because it's optional in the HTML5 syntax anyway, and that shaving off a few bytes is worth it. It is to save space, but it seems hardly worth it when you look at the full head section, which has a large number of <link> elements>, and the long content of the origin-trial <meta> elements. They suggest the page is not particularly optimised for size.

To see Twitter's head section properly, it's best to view source, copy to a text editor, then insert a newline before each "<" where there isn't one already.


It appears that many things that I thought were normal to put into an html page are not.

Those are normal things, but some companies like to deviate, often just to be different. For example, Google uses a Unicode lightning bolt as its DOCTYPE for Amp pages.

However, saving 100 bytes on a page load can end up being actual money saved when you shove out as many pages as Twitter does in a month.


Saving bytes makes sense. But how does the rendering engine know that those lines are CSS instead of junk text? And without a head tag, how do those lines not end up as text in the body of the document? And isn't it strange that it doesn't have a title tag (though, if you aren't going to have a head section, maybe skipping the title tag makes sense too).


It's cropped out in the screenshot, but if you look at Twitter html source, you'll see that there is a <style> tag that opens at the end of the line before the CSS.

There is a <title> tag, but it's created by Javascript. You can see it with document.querySelector('title') once the page loads.


> <html dir="ltr" lang="en">

This one surprised me a bit. Are there browsers that are default Right-to-Left rendering and are going to put English language characters backwards if you don't specify the direction?


Per https://html.spec.whatwg.org/multipage/dom.html#the-dir-attr... it'll default to LTR

> The directionality of an element (any element, not just an HTML element) is either 'ltr' or 'rtl', and is determined as per the first appropriate set of steps from the following list:

> ... If the element is a document element and the dir attribute is not in a defined state (i.e. it is not present or has an invalid value) ...

> ... The directionality of the element is 'ltr'.

It's not that common to see LTR explicitly specified for the document, but you could imagine some code that either outputs ltr or rtl based on the user's preferences. (Indeed I just checked and twitter puts a rtl there if you're using it in Arabic)


There's probably a line of code that looks like this:

> echo('<html dir="$dir" lang="$lang">')

(or something similar), and they unconditionally include the `dir` attribute without checking if it's already set to the default value a browser would assume.


No, but a screen reader that has set rtl as a default might.


What the nay-sayers in these comments seem to not understand is that your curiosity here is a great response to TFA's question.


With that title, I would have expected an analysis of leaked backend code.


The "perfect answer" for the doctype is odd, the "also accepted" is, IMO, the perfect answer.

Unless you're hiring someone with indepth experience/PTSD of supporting IE6.


I think I'd enjoy this interview, as I don't really like people watching me code.

But to have a discussion about quirky html history would be a fun (I think less stressful) way to spend the time.


I think this might weed out more junior but very promising profiles.

And remembering the Netscape days and why of each meta “hacks” might be a little tricky even for very senior profiles.


I thought the answer was going to be years of bad hiring and lack of care about their users, but I guess that’s probably a bit snarky :-)


My first thought was that with minification in place, there might not even be 10 lines, but instead 1 extremely long line


Great discussion of what these mean, but terrible idea for an interview question. As a rule, I really try to shy away from questions where the answer is "I don't konw, but I'd be happy to look it up if it were relevant to my job," and with modern frameworks direct knowledge of these tags is almost never relevant.

(On the other hand, if the candidate had access to a computer, following their process of looking these up might be interesting...).


I see this as similar to the "what happens when you visit google.com?" question - it's a starting point for conversation, not gotcha trivia.

I certainly wouldn't expect anyone to know every answer off the top of their head, but talking through a candidate's educated guesses can be informative.


That seems a pretty basic question for a senior position, it's weird the author says most candidates failed it.


My expectations for people cratered after I began interviewing. It's.. incredible.. how untechnical people applying for highly technical positions can be.


Agreed. It's sad how many SRE candidates are positioning themselves as senior and end up being someone with basically nothing more than surface level knowledge of AWS manages services.

I have a relatively similar approach as the article:

1. I have them walk me through a production dockerfile and explain what is going on (it is not a very complex dockerfile).

2. I have them troubleshoot a broken web server with the most basic scenario (public web server that we run, ec2 with apache2, public ip, no load balancers, no cdn, just a VM serving a static html page on xyz.actualdomain.com).

Things that are broken:

1. NXDOMAIN (I make sure to unset the DNS before the interview)

2. Security group isn't allowing 80/443

3. NACL isn't allowing egress

4. iptables isn't allowing 80/443

5. Apache2 is stopped

6. Apache2 is bound to 127.0.0.1:80/443

7. Self signed TLS

I don't require specific incantations, I know I can't write the iptables insert without looking up an example. But I do expect candidates to know where and what to look for to troubleshoot the entire chain. They are allowed to run any command they want (I'm running it on a screen share). If they get stuck on a portion, they get some hints, then finally they get given the answer to get past it. My goal is not a gotcha, my goal is to see how they attack the problem and if they are at least familiar with how things can break and have guesses at fixes.

Fully a third of interviewees get stuck on NXDOMAIN, which is just shocking to me interviewing people that, on paper, have over a decade of deep Linux and cloud experience.

To me, the scenario I present is basic troubleshooting and something that should be a breeze for most candidates.


While I too have seen strange knowledge gaps in interviews (interviews for JS developers who can't write a function that adds two numbers), the NXDOMAIN issue doesn't surprise me too much.

Maybe it's different for SREs, but as a fullstack web developer, unless you've got a greenfield project, usually someone else sorted out DNS a long time ago. And unless you're working on something that changes DNS a ton, nobody has touched DNS in a long time.

Additionally, I've seen NXDOMAIN way more often as a local machine configuration problem, rather than as a production environment DNS problem.

So if I'm going in to debug a server, but then I see an NXDOMAIN, I could see myself getting stuck wondering just what else in the world is broken. If I was doing the test on my own hardware, I might panic that my machine is in a bad state. If I was doing the test on hardware the interviewer provided, I might start wondering if this is some kind of trick, and I have to debug a broken client and a broken server.

Then again, maybe if I went back to those people who couldn't add two numbers in JS, they'd have a great explanation too :)


For SRE, DNS is a relatively common issue to troubleshoot. Something silently fails in a deploy, someone went mucking around with DNS by hand when they shouldn't have, your local resolver might just be borked.

Specifically for us, since we are a SaaS provider with new customer environments in their own VPCs every week, DNS is something we touch regularly. We touch it waaay more by hand than we should, but that is one of many processes I am fixing and automating to remove the cognitive load and human errors.

You are right that it could be a client issue, but when candidates start down that path and won't let it go, I tell them to pretend they're on a residential internet connection, no corporate shenanigans of any type.

I also expect them to know how to rule out their local machine quickly (they can always run nslookup xyz.actualdomain.com 8.8.8.8). I intentionally use real problems I have encountered so that the scenario is something they can expect to fix(not usually all at once).

I'll probably do a revision on the process next week with a terraform deployment to build the scenario out automatically for each interview. I'll be asking candidates to send me a ssh pubkey before the interview. I need to get another AWS sub-account too so I can issue credentials for the candidate and literally give them the keys and let them drive instead of me.


How is not knowing something unethical?

[EDIT] - they said "untechnical", not unethical.


un - technical


It feels kinda reminiscent of a "FizzBuzz" type of question, serving as a litmus test or catalyst for an informal conversation rather than anything strictly defined.


Ah. FizzBuzz the destroyer.


So many people have the idea that "senior" is just someone who's been doing it for a long enough time.


I saw a tweet yesterday where someone with 4 years of experience was looking for a Staff Engineer position. One thing the engineering community doesn't lack is confidence in our abilities, even if we aren't there yet.


I've seen interns perform better than "Staff Engineers" at some companies.

Leveling is purely a function of leverage and nothing else. I'm ~4yoe and I find myself in meetings pretty much entirely populated by staff engineers. I've seen kids come right out of waterloo with more skills & knowledge than I think I'll ever manage to get. I've seen people get to Staff at FANG before 27

Anything is possible, just get good :)


"Senior" developers tend to waaaaaay overestimate their abilities, unfortunately.


this is such a dumb, mediocre gotcha interview question.

I prefer take homes to live coding questions but ffs, ask me questions that will pertain to my day to day responsibilities and have me explain my code sample. No FE dev in 2022 is creating a bunch of HTML pages.


Most people's claims of interviewing brilliance are bullshit because they only know the performance of those they accepted, not those they rejected.

Trivia quizzes like this will get you people who know the trivia, which is probably better than hiring completely at random but not necessarily the best strategy.


having a conversation about HTML semantics and browser features is great, but is it really different than live coding or white-boarding?

Those too are “conversations” that are testing someone’s ability and knowledge.


If asked this I would ace it. And I'm not even a web dev :)


FWIW I have been building web applications with JavaScript for about 7 years - sometimes very complex applications with literally millions of MAU - and I couldn’t have told you with any depth what most of these LOC actually do.

YMMV


And this is why the tech interview process is (still) broken.


This is wrong set of questions to ask for a Frontend Developer position. This is perfectly fine for those who are building tools for Frontend. I knew most of these questions primarily because that is what I love doing. I, however, won't expect any frontend developer to focus on this as this is not the job of a frontend developer (more a job of tooling developer if that is even a thing).

The reason you have CSS style tags at the top is because it is an optimization technique for having critical CSS added to the <head> tag to ensure that styles of top of the page are rendered immediately (so no flash of content). I can bet anything that "-ms-text-size-adjust" is not something any Twitter Frontend Developer would be aware of unless they are building the tooling for the Frontend. This actually comes from normalize.css which every Frontend developer just blindly imports: https://necolas.github.io/normalize.css/8.0.1/normalize.css

This normalize.css is critical style as it resets the browser styles. Hence it is added above the fold (in the <head> tag) to ensure that the initial page load won't have any flash of content.

Honestly, this is a very bad way of judging Frontend Developers. My biggest critique of hiring process for Frontend Developers is precisely this. Either interviewers ask questions related to solving data structures and algorithms (which honestly you never use in majority Frontend Development anyways) or such esoteric questions that won't be useful anywhere else except for clearing the interview process.

Want to hire a Frontend Developer? Just ask them to code a sample project: possibly a Todo list. And focus more on how they organize code, how they structure components, what libraries they choose, how they test the components, are they aware of the latest standards (are they still using React createClass or using functional components with hooks)?. This is the only correct way to judge a candidate for the position of Frontend Development. For Senior Frontend Development roles, you can ask them about how they would work with tooling that connects with the backend. Probably give them a GraphQL endpoint and see how they approach it. Do they use a mock adaptor? How do they integrate Authentication? How do they put guards around pages and how do they handle role management within the app? How do they handle internationalization? Would they resort to by default picking Redux (just because it is popular) or is there a better alternative for the specific project/task at hand? These are much much better questions that gauge the experience of the Developer.

All these other methods of interviewing are basically admitting that you have no idea of how to filter correct candidates or you want to show off your esoteric skills. This also sends a very wrong message to the Frontend Developer community that the requirement to get a job is to learn all these hidden features and edge cases. It will sidetrack them from becoming the best at their job as they spend countless hours read/learning things that in no way contribute to business outcome.

Honestly, seeing all this, I have a strong urge to do something about the hiring process. Maybe a startup along these lines. The hiring scene in Frontend Development sucks.


So... how did I do? ;)

---

<!DOCTYPE html> is a magic string that indicates the document should be parsed as an HTML5 document (possibly avoiding quirks mode too? I don't remember what triggers that).

"Doctype" comes from the XML concept, and XHTML documents may have a different doctype.

<html> is the document's root element. It's supposed to be there but the browser will create it if you leave it off.

ltr means the document direction is left to right. direction here refers to the direction of lines (e.g. in English lines go left to right, in Arabic lines go right to left). There's another value that influences writing mode too below the document level, but I forget what it's called.

Browser implementers and webmasters have to be careful with a non RTL direction; as it changes the scrolling element origin, the browser will have to deal with logical vs physical coordinates, and scrollX may go negative. I believe scrollX was reconciled across the different browsers fairly recently.

The meta tags tell you metadata about the document. I believe they're supposed to go in the head section, but again the browser will create that for you if you don't.

lang just tells you the language of the page. I'm not familiar with what this is used for, but you could imagine a search engine using it for one thing (e.g. Google's "display only results in English").

The two letter country code comes from some standard I don't remember the name of. Also used in TLDs. Watch out for easy to confuse countries like cn, ca. Some websites like to use the trendy .io TLD, but I heard rumors it wasn't run very well.

charset="utf-8" means the document's bytes should be treated as unicode. Note that this meta tag should occur in the first 1024 bytes of the document or browsers may not notice it. Without specifying the charset the browser will likely fall back to... I think latin1?

Anyway I read once that browsers don't get too fancy with the encoding detection on purpose, to avoid people relying on unreliable heuristics.

Another interesting point is that Chrome can load utf-8 documents as utf-8 without a metatag if it's a file:// URL. I guess conceptually this is because local files can't specify the encoding in HTTP headers or something?

Viewport specifies the responsive sizing behavior. This is described in the CSS Device Adaptation Level 3 spec; but the section on actually parsing this tag is pretty gnarly. If I remember right it was a non-normative section and had a few weird corners that were likely left over from matching browser implementation quirks.

Anyway you need the viewport for responsive viewport sizing. 99% of the time you can just copy-paste the usual string and don't need to get fancy with custom values or anything. There's also a newer way to specify the viewport behavior through CSS (and indeed Chrome basically converts the meta tag to this internally), but it didn't really work right last time I tried it.

"og:" is from some semantic web standard. I never learned the details, but basically it tells crawlers some basic information about the page's contents.

For the remaining lines; presumably Safari recognize some custom meta tags to change Apple device theming. The "origin-trial" may refer to Chrome (or Safari?) origin-trials, where webpages can opt into (or sometimes out of) experimental browser behavior.

Line 10 is CSS. Presumably there was a <style> tag off the right end of the screenshot on line 9.

Interesting point about CSS or JS embedded in HTML:

This actually changes the parser's language from HTML parsing to CSS or JS parsing on the fly. But with a special rule to look for the end tag and switch back to HTML. This is why you'll see people break up the string "<script/>" if they have to embed it in JS embedded in HTML.

But my favorite is the <plaintext> tag which switches the parser to... plaintext. Unlike CSS or JS there is no special escape-hatch and it's just plaintext for the rest of the document.

Speaking of embedded languages: SVGs have a title element but it isn't the document's title element. Poorly written browsers or crawlers could confuse the SVG title with the document title if they don't have an understanding of tag namespaces (another relic from XML perhaps?!)


> Another interesting point is that Chrome can load utf-8 documents as utf-8 without a metatag if it's a file:// URL. I guess conceptually this is because local files can't specify the encoding in HTTP headers or something?

You can guess the encoding after reading a few bytes from the request. Checkout universalchardet from Mozilla or the equivalent Java port: https://github.com/albfernandez/juniversalchardet

By the time the meta tag is parsed, you almost always know the right encoding already.


So actually reading the post now:

> People even used to use * { margin: 0 } which is totally overkill and not great for performance.

Wait why would that be bad for performance? Zero margins should be just as fast as 8px margins, and if you have this style in the head section it's not like the browser will have to relayout a bunch of stuff.


The universal selector has the potential to be slower than other selectors in naïve CSS engines because CSS works by matching selectors from the right to the left. A rule like `.baz *` matches every element on the page (vs something like `.baz .foo` which only matches elements with `.foo`). The match is only rejected after walking up the DOM tree to the root node to see if any parent elements have the `.baz` class or not.

In the case of a single universal selector, there is no performance issue, the selector just matches every element, which is fine.

In modern engines, there is also no performance issue, they JIT compile selectors[0] and do other stuff to be fast. Even old engines wouldn’t really have a performance issue in practice unless you were doing something else bad, like having extremely deep DOM trees with extremely large numbers of elements.

[0] https://webkit.org/blog/3271/webkit-css-selector-jit-compile...


The argument on performance comes from the idea that theoretically the rules are applied in order. So the browser has built in stylesheet of 8px, and after that a margin of 0 is calculated. (And after that, some more specific margin in the stylesheet is recalculated)

Basically * { margin: anything } adds one extra calculation to each element in the page.

Not sure if the performace hit is measurable tough, knowing how much optimization goes into browser engines.


Yup, you're very right about the doctype avoiding quirks mode. That's the primary reason for it.


Self-description about the business that is mentioned in the first sentence: "Beautiful interior design for your home with the flexibility to /rent/ or buy the furniture you love"

Renting furniture... Isn't it weird* how the right to own drives capitalism which spawns businesses that thrive on you not owning the things they sell you?

* read: perverse


I wonder why people keep calling HTML "source code"


Ahah this! When reading the post title I was wondering if Twitter backend end (or even front end) source code had leaked. As a candidate I would give minus 1 point to the interviewer ;)


It screams "non-technical manager" (or journalist, or politician, et c) to me (though that doesn't seem to actually be the case, here?)


I don’t, for one. From the title I thought this was about the code that runs the Twitter back end. I would call this “markup” or “HTML”.


Why the first line of Twitter, why not Facebook.com or Google.com actually I just looked there all very different given meta tags for each company, i.e Facebook does not use twitter meta tags from what i could see neither does the google home page, although i guess there search does.


This isn't a very great interview question.

Testing detailed arcane knowledge is one thing, and it should be impressive if people know everything.

But the web is a giant mess of technologies that nobody can really fully keep up with and I'd rather people spent that extra minute learning about another language or subject, than say the details of 'doctype'.


Wow, html of the twitter's front page is called "twitter's source code" on hacker news. I guess, we can call this "popular programming for kids" to avoid harsher epitets.


I've been doing web development since the web began, literally. The percentage of my time that I've cared about the stuff in this header is approximately .000047%. And when I do care, I can look it up and reacquaint myself. A full stack developer has so many things to know. This is representative of the kinds of questions that make interviewing so awful these days.

Oh, and I've interviewed hundreds of front end developers, so I've been on both sides of the table.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: