Hacker News new | past | comments | ask | show | jobs | submit login
What happens when you type Google.com into the address box and press enter (github.com/alex)
172 points by PleaseHelpMe on July 30, 2017 | hide | past | favorite | 26 comments





It's lacking the biology part and physics part, and chemistry, and ....

Some of the sections are just out of context and become showing offs(like the keyboard part. For a hardware position that is not enough, for a software position that's non-relevant), which doesn't mean more sophisticated, just different interest domains.


Your comment sums it up well but I don't see what the problem with that is. Expanding arbitrarily into different interest domains without any limits (upper or lower) to detail seems exactly the point of this repo. Which seems great.


That point (arbitrary domains) become less impressive for me when I knew everybody can have some less known knowledge to others.

I found I often can learn from slickdeals discussion in various topics, which is actually a good way to hear seasoned opinions.


This is like that old comedic trope where someone says start at the beginning and the respondent says 'Well, a long time ago the universe existed as a single point that was infinitely small, infinitely hot, and infinitely dense..' and the questioner has to spend a lot of time saying ok skip that, okay skip that part...

on edit: typo fixed


I love this how oversimplified this is.


What is the actual utility of this question?


Before it was such a cliche, it was actually a great question. Open ended, allowing you to gauge how a candidate deals with unknown problems; answers can focus on any part of what happens, giving you an idea of where the candidate has most experience; lots of opportunities to ask questions to go deeper; but also lots op opportunities to say 'yeah let's just skip this part'.

As a candidate, I loved the creativity in it, and the chances it gives you to show off knowing things that you don't necessarily need to know to do a certain job but will still make you better at it than others. Say, when you're an (average) web dev, you don't need to know much about DNS. But pointing out the difference between an A and an MX record shows you have deeper knowledge than many, or at least that you've managed some systems before.

Look, I'll admit that I too have at some point asked people 'what's the difference between an object and a class'. But that's such a shit question, today I'd only do it after having asked some other questions they completely bombed to check if they know anything at all, or after apologizing profusely for the question and blaming it on 'standardized interviewing procedure' or whatever.

I deal a lot with spatial information systems; here's my favorite question I used to ask back when I interviewed people: consider a matrix A of dimensions M x N. Assume that that matrix represents a height map, i.e. each value represents the elevation at that location of a (discrete representation of) a terrain. How would you go about filling this matrix to make it represent a pyramid, i.e. the center cell having the highest value, linearly going down to 0 (or 1) at the border cells? Start by enumerating the assumptions you make, pick the ones that make your solution simplest, then go from there describing how you'd go about relaxing the constraints of your assumptions.

Then I'd draw a sample on a small 5x5 matrix.

I've had people who couldn't understand the problem no matter how hard I tried; and then I had people who would insist on showing 5 different ways of doing it complete with big O notation (in both cycles and memory) to illustrate the trade offs.

Anyone else have any favorite interview questions they came up with themselves that you think are a good representation of your field?


>"Before it was such a cliche, it was actually a great question. Open ended, allowing you to gauge how a candidate deals with unknown problems ..."

Wait isn't it still an open ended question with answers that can focus on any part of what happens? Why would the fact that it's "cliche" change that?

You can go memorize that post but unless you really understand TCP, HTTP, networking, DNS etc. it's still going to be really apparent to an interviewer who does by simply digging further into just one of those aspects.


Well it loses much of its effectiveness when people can study for it. Plus I didn't say it was no longer open ended, just that it's no longer a great question, because everybody asks it.


No, that's the beauty of of an open ended question it doesn't lose its effectiveness. There is no wrote memorization for an answer.

An example of a question that loses its effectiveness because people can study for it is "reverse a linked list"


*rote memorization

Either way, I guess we'll just have to agree to disagree. Even for open ended questions, in my experience it makes a big difference whether someone has prepared for it, and a weak candidate can prepare enough to appear (much) better than he/she actually is.


>"*rote memorization"

Mea culpa, yes I meant write "rote." Cheers.


> I've had people who couldn't understand the problem no matter how hard I tried

I understand the problem you're describing very well, but I had to read the entire problem statement to understand what you're talking about. Making someone understand is a two way street, and half of it is about you communicating the problem effectively.

That's not to say you did a bad job, but for me the signal to noise ratio of that problem statement was low and made me question whether I understand what you're actually asking. If you said 'draw a height map of a pyramid on a 5x5 grid', that'd be far more clear.


Well it's not like I would read it out loud like I wrote it down here, plus I did say I also gave them an example. I did start out calling it a 'height map' for example, because well that's what it is, but there are plenty of people who don't know what that is. Damned if you do damned if you don't I guess.


I assume my code knows (or can readily find) the value of M and N. The max_height of the pyramid is ceil(M/2) + ceil(N/2). The height of every point in the matrix can be readily calculated by taking its Manhattan Metric distance from the center. The equation is max_height - (floor(abs(i-M/2)) + floor(abs(j-N/2))). O(MN) operations are needed. The ceils and floors are there to deal with the case that M or N is even. I did this in my head so there may be off an off by one error which is easily remedied.

I forget terminology. Object is an instance of a class right?

Did I get the job?


Actually, if your M/2 isn't integer division (which I assume is the case from your use of ceil around it first), your 5x5 pyramid would look like this:

    23443
    34554
    45665
    45665
    34554
Using max_height - (abs(i - floor(M/2)) + abs(j - floor(N/2))) would give the properly-centered pyramid:

    23432
    34543
    45654
    34543
    23432
Your max height should really be just max(ceil(M/2), ceil(N/2)) for a height of 3 going to 1 at the edges or floor(M/2) for 2 to 0. Using both Manhattan distances gives you an octagon-base pyramid (approximated to the square shape) when really you just want the max of both distances:

    max_height - max(abs(i - floor(M/2)), abs(j - floor(N/2)))
gives:

    11111
    12221
    12321
    12221
    11111
But this only works for square pyramids, using 3x5 you get:

    12221
    12321
    12221
If you want a rectangle pyramid, use min manhattan distance from edge (don't need a max height then):

    1 + min(i, N-i-1, j, M-j-1)
gives:

    11111
    12221
    11111
or for a 7x10 grid:

    1111111111
    1222222221
    1233333321
    1234444321
    1233333321
    1222222221
    1111111111
Python 3 code for those who want to test themselves:

    N = 7
    M = 10
    for i in range(N):
        print("".join(str(1 + min(i,j,N-i-1,M-j-1)) for j in range(M)))


This is what I get for trying to work it out in my head and be the first clever person to respond to OP.

I like your code. very elegant solution with mins and such.


Well I would never interview in a style of 'get 5 answers right, you got the job'. So I can't quite tell from your answer :) But yeah that's generally what most working answers would end up like.

One interesting aspect is that in some circumstances (I don't remember the details - one of my colleagues did some tests 10 years ago) it was faster to do it this way (iterate over all cells in order, so better cache locality) but in some it was better to 'draw rectangles' as it were, ie first put in all 1's, then all 2's and so on. Requires no floating point ops but more cache misses (iirc).


> Manhattan Metric

Nope. All border cells are supposed to be 0, but they have different Manhattan distances from the center.

> Object is an instance of a class

Correct.


The question statement above calls for border cells to have a height of "0 or 1". Perhaps to give the candidate some fudge-factor for matrices having an odd number height or width.

I realize that this is a contrived testing problem, but to me a pyramid with zeros in the border cells sounds wrong. The area just beyond the border should be zero. Being within bounds of the pyramid intuitively should imply some non-zero height.


Yeah borders being 0 is weird, but it's not material to the question, and for some reason someone once thought this was how it was supposed to work - I never cared about details like that.


It's kind of a way to figure out how much someone knows about how computers and the internet work. It's an easy way to distinguish between people who don't understand much about how the internet works beyond some level of perceived magic. Beyond that you can gain an understanding of which protocols and systems someone is familiar with. For example, do they understand ethernet? and http? and caching? and dns? etc. Interestingly, it's a question with sufficient depth that no human can really fully explain it in complete detail (no, really), you can kind of shine a light on different aspects of the question for a moment but you'll never cover everything (we're talking about the workings of a system that has trillion of active components, some simplification is necessary).


Exactly. I've been asking this question for a long time, at least 10 years. I guess it's a joke now, but I still love it. If you asked me or some of my teammates, we could talk for hours. Yet, we have candidates that finish the question in 30 seconds! They get a big nope from me, which brings me to another thing I like about this question...

A lot of people just don't know how to react to it. I think it shows me what kind of thinker they are, ie do they need to be spoon fed or not? A lot of time, if I ask about some piece of this process, they can answer it. But they can't get to that piece on their own.


In fairness to those candidates, do you make your length or detail expectations explicitly clear? I've accepted someone's 30 second summary of TLS before as an interviewer because it was pretty clear they understood it at a high level, knew something meaningful about the process and would never be implementing anything like it (just relying on it).

If I was asked this question I could probably ramble on for...oh, a half hour or so, if I actually exhausted my knowledge of keyboard interrupts, RAM, the TCP/IP stack (including specific packet headers and data frames and their lengths), hardware switching and routing, DNS lookups, HTTP, the TLS protocol (including which side does which part in which order), HTML/JavaScript parsing and client-side rendering. If I had to, I could talk less confidently about relative latencies and performance for all of those things too.

How much signal does that question actually carry? I can give you a lot of true information, but is it useful for knowing if I can properly code or debug existing software? For example, I could drill down into TLS specifically for another half hour - I probably couldn't actually write a TLS stack without referring to a lot of pre-existing literature, and even then it wouldn't be safe to use and I'd likely make critical mistakes. That's a crypto example but I think it applies to a lot that's here.

This question feels like one that doesn't really know what it's looking for, which I personally feel happens a lot in "open ended questions." If you need to test someone's knowledge of memory and latency, tailor the interview for that. If you need to know how well they understand HTTP and HTML/JavaScript, tailor your questions for that. But this question is sort of unreasonable for a lot of people because I think you'll get a few types of answers, among the set who can answer it well:

1. People who can speak for literally hours about everything that happens and who really know what they're doing, but who give a concise summary in a minute or two because the question is ridiculously underspecified and they really don't know where to go with it (this is worst case scenario, because these candidates might be dismissed for not being able to get to the meat on their own, when really they just recognize it's a gargantuan question and they're not sure how far you want them to go).

2. People who know all of it extremely well (like 1), but who hate the question and parody it by drilling down into mind-numbing detail about one particular part that is minutia for the actual job (e.g. they give you a treatise on multi-process browser architecture that could be a conference talk with some more polish). Ask for another detail and they'll punish you for asking by drilling down into something else that's literally what you meant but vaguely misses the point. Do you fail the candidate on the question because they're being passive aggressive or accept that they know an incredible amount about it and are expressing it's a bad question?

3. People who know one or two parts extremely well and who know the rest to a shallower (but still correct) depth (I fit into this category, in that I know the crypto and networking very well but am fuzzy on everything else more than two meaty question-response cycles down on the topic). Posed with this question, they'll most likely give a good first order explanation of how each part works or just skip it (e.g. people rarely even talk about the keyboard, USB, etc and just skip to the networking, passing over RAM completely), followed by a reasonably well explained overview of whichever part they're confident in.

This isn't to criticize you or the other commenters at all, it's just my bias in the other direction. I don't typically like "open ended" questions because I feel they are underspecified versions of the questions you really want to get at, and a candidate can know the topic really well but sort of flub them. If I was hiring someone to literally work on writing a browser I'd probably ask this question but...that's about it, I think.




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

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

Search: