Live data from Hacker News

Lessons from 3,000 technical interviews

blog.interviewing.io

291–300 of 330 posts

Re: Lessons from 3,000 technical interviews

#291
post #255

Earlier quoted context omitted.

When the government pays for health care (like what happens in most european countries) it means that people that are not sick are paying for people that are sick. Why should they, right?

Good question. For saving someone from dying it may be justified to forcefully extract money from others. But definitely not for education.

'forcefully extract money'

I hate that sort of terminology, money only exists for you to trade because you are a member of a society that collectively decided it was a good idea.

Re: Lessons from 3,000 technical interviews

#292

Earlier quoted context omitted.

I would like to see a solution to your problem with bounded memory. In particular, the case where I want the top 3 words, you don't know the length of the stream, and you get random permutations of the same 4 words until I stop emitting them (where I will end by emitting 3 to break the tie). That's not to say your problem isn't interesting -- just that while specifically constructing a problem as an example, you crea…

In the given case, it's actually the "English words" limitation that saves the question. An exact answer to top-k problems is O(N) is storage space where N is the number of distinct items. So since N is ~200k, it's not a terrible problem to deal with. When N is 3 as in your given case, it's not really a problem. The general case, of when the stream is unbounded in the number of distinct items, is much harder, say the…

Hah! Hell, I'd even give credit to the SQL answer, if it came with the rest. ;-)

The only thing I'd add is that you can probably come up with a pretty simple heuristic or three to solve the problem for the case of truly random gibberish, without the need for elaborate data structures. But yes, this would be the answer of a great candidate.

Re: Lessons from 3,000 technical interviews

#293

Earlier quoted context omitted.

14 percent is still thousands of students. Equating elite universities with privileged upbringings is stereotyping. Like most stereotypes, it's grounded in truth but also unfair I worked really hard to be able to get into an elite university and to get the scholarships to pay for it. When people automatically assume that my education means my family is wealthy, it discounts the enormous amount of work which I (and ot…

You are confirming the point that was made!! It is harder for "poor folks" to get in. It is easier for wealthy kids to get in. You should state ".. and I had to work my way in there - my folks aren't wealthy!" as a bi-sentence every time you mention your education. I bet most people immediately would understand what it implied: This is an achiever!

No I'm not.

Even if fewer poor students get in, that definitely does not mean you can make the reverse assumption: that everyone who attended an elite university is wealthy. For all we know, these results are dominated by poor students who worked hard enough to get into an elite university (which, by the way, wouldn't be a crazy assumption: my CS classes had a lot more income diversity than, for example, political science ones).

Re: Lessons from 3,000 technical interviews

#294
post #14

Interesting bit on the MS degree. I followed the link, and I'm not quite as surprised that the correlation is poor, or even negative, given the way the data was collected and analyzed. Absolutely agree that some MS degrees are pretty much less rigorous cash cows by now, that allow students to skip the fundamentals such as data structures, operating systems, and compilers. However, many CS MS degrees actually do requi…

> Absolutely agree that some MS degrees are pretty much less rigorous cash cows by now, that allow students to skip the fundamentals such as data structures, operating systems, and compilers. At what point do we not consider operating systems and compilers "fundamental"? What percentage of CS/programming jobs require deep knowledge in these arenas?

That's a really complicated topic, of course. CS is in an interesting spot, in terms of how people perceive it and what students expect from it.

On one extreme, people see CS as a kind of trade school housed in a research university, teaching only what is useful on the job. Some people see CS as professional degree, kind of like law - you must teach theory for students to understand the field, but in the end, you're producing practicing lawyers, not abstract thinkers. And then, at the other end of the distribution, you find people who see CS as an academic field, a branch of scholarship, where the question "what percentage of programmers need to understand compilers" would be akin to asking "what percentage of math majors who become actuaries use real analysis?".

Re: Lessons from 3,000 technical interviews

#295
post #284

Earlier quoted context omitted.

I would like to see a solution to your problem with bounded memory. In particular, the case where I want the top 3 words, you don't know the length of the stream, and you get random permutations of the same 4 words until I stop emitting them (where I will end by emitting 3 to break the tie). That's not to say your problem isn't interesting -- just that while specifically constructing a problem as an example, you crea…

"I think most interview questions are similar nonsense." It's probably a good idea to be careful with your words when you admit that you don't know the answer to a question. First off: your example (random permutations of the same four words) doesn't require much memory at all. So if you think it does, you're wrong. You might overflow your counters, but that's a different problem. A stream of random gibberish is cert…

Do you really think you need unbounded storage?

This is an example of a trap that interviewers run into when they try to arbitrarily reword questions.

While I could be mistaken, an exact solution to the top-k problem requires O(N) space where N is the number of distinct items. I can trivially think of a stream of tokens that would defeat any reasonable computer in both available memory and general "storage" (ex: 1 quintillion distinct words, then the next 10 words are a duplicate of an existing word, then end of stream). Since you asked for an algorithm and not a heuristic, it's clear you are looking for an exact answer. So the answer is "Yes, I would need unbounded storage for the new question as asked". Since this is an interview, I'd expect that'd you'd want me to give you the technically correct, and accurate answer.

I've tripped up enough interviewers who have tried to slightly reword questions, but ended up changing their meaning.

Re: Lessons from 3,000 technical interviews

#296
post #285
post #274

Earlier quoted context omitted.

I'm hard pressed to imagine how this couldn't be done efficiently. Do you have an example which correctly solves the problem but takes too long? The only thing I can think of is something like the output rewriting an array on update over and over.

Which problem? The first one? Don't underestimate the badness of the average interviewee. For the "find the min and max of a set" in particular, a lot of folks start out with terrible solutions.

Well either I suppose. For the subset problem as you say a filter critera can be applied while looping through the collection. And that should be it. Now if the question was multiple criteria I could see the solution diverging rapidly. If the filter can be expressed as a rank we could sort the collection first and then binary search through it to find the boundaries. I suppose I'm just trying to imagine some way an interviewee may turn that into two loops, or three loops... more?

Re: Lessons from 3,000 technical interviews

#297
post #274
post #258

Earlier quoted context omitted.

Not that I can see. The OP said: "find the subset in a given collection that matches this specific criteria" So basically, a loop through a single table. That's as simple as it gets. You can make the problem more complicated, of course (e.g. "write a method to find the minimum and maximum ages of the male users" ), but it's still pretty simple stuff. A slightly less trivial "algorithm" question that should be equally…

I'm hard pressed to imagine how this couldn't be done efficiently. Do you have an example which correctly solves the problem but takes too long? The only thing I can think of is something like the output rewriting an array on update over and over.

Do you have an example which correctly solves the problem but takes too long?

Behold

  var AGESORT = rows.bubblesort("AGE ASCENDING")
  var AGESORT1 = rows.bubblesort("AGE DESCENDING")
  var MALE = "None"
  var MALE1 = "None"

  for row in AGESORT
    if row.isMale
       MALE = row
       break

  for row in AGESORT1
    if row.isMale
      MALE1 = row
      break
    
  
  print "Min age: " + MALE
  print "Max age: " + MALE1
Stuff like this is usually the result of thoughts like "Ok, I'll break this problem into two, then combine the pieces. First I'll find the minimum age, which is easy once I sort the rows. Done. Ok, now I can see I can slightly alter that code so that it finds the max age! Now, I just put the pieces of code together, and do a little code organization to put like with like. I"

Re: Lessons from 3,000 technical interviews

#298
post #231
post #220

Earlier quoted context omitted.

A society that cared deeply about educating the population wouldn't confuse schooling for education. Yes there's some education conferred along with the schooling, but credentialism is a huge part of it and even more so in Germany than most countries.

> wouldn't schooling for education I agree that there are not-yet-mainstream concepts for schools/universities/etc. that should be covered by public money as well, at least partly. Currently, this exploration happens entirely in the private sector, which is simply inadequate (read: too small and too slow) for the society to move forwards with its educational system. A society should actively invest into improving the…

Okay, I can introduce you to three real world alternatives I've seen in my own life—self study, direct mentorship and work experience. I'll share one example of each from different fields.

To be clear, I don't think there's a single one-size fits all solution for education. One of the core problems I see in formalized schooling is that by its nature it pushes large numbers of people through the same curricula. This may have been good in the early industrial era, but in today's world most job-related skills that can be commoditized are either outsourced or automated. Non-job related skills are also of great value, though it's not clear that it's best for people to build them in an factory-line style either.

Self-study: I put over a thousand hours into foreign language classes while growing up and got pretty bad results. It's an ancient discipline and curricula have had centuries to adapt, but it's just not well-suited to formalized schooling. I've met literally thousands of people with advanced degrees in English language study who don't speak that well. I've also met a lot of foreigners who graduated with degrees in Chinese who don't really speak or read comfortably. Though I've hired people for positions in which English language skills were important, I've never even considered looking at their related credentials rather than evaluating their results. Foreign languages are very learnable through self-directed study. This is even true for one's native tongue—most really good writers have gotten there through voracious reading and practicing their craft, not generallythrough advanced degrees.

Work experience: Another discipline I've seen schooling fall down is in sales. It's a core business skill, but those I've met who have excelled in it have come from a variety of backgrounds, not necessarily business schools. Almost invariably, the people who really know how to sell have gotten that way through work experience, either for themselves or on commission for someone else.

The third alternative, that of direct mentorship, is probably the most powerful I've encountered. Especially in music, athletics or other extremely competitive fields, there's nearly always a mentor behind the top performer, and often there is a series of several mentors over different stages of the learning process.

Now at this point, I suspect you're thinking about the fact that there are two types of educational goals—getting really good at something and getting to minimum level in all the core skills. Though my three examples were related to the first goal, schooling often fails in the second goal as well. It can succeed, but there are still a lot of people who do what must be done to get the credential they want and little else. On the other hand, it's exceedingly rare to meet someone who reads broadly and doesn't end up with at least a decent education.

Re: Lessons from 3,000 technical interviews

#299

Earlier quoted context omitted.

I would like to see a solution to your problem with bounded memory. In particular, the case where I want the top 3 words, you don't know the length of the stream, and you get random permutations of the same 4 words until I stop emitting them (where I will end by emitting 3 to break the tie). That's not to say your problem isn't interesting -- just that while specifically constructing a problem as an example, you crea…

In the given case, it's actually the "English words" limitation that saves the question. An exact answer to top-k problems is O(N) is storage space where N is the number of distinct items. So since N is ~200k, it's not a terrible problem to deal with. When N is 3 as in your given case, it's not really a problem. The general case, of when the stream is unbounded in the number of distinct items, is much harder, say the…

You can't have finite counters per word, else you can't disambiguate between counter length of a single word then the pattern I described and just the pattern I described, despite the fact it impacts the answer.

Your solution is incorrect because it fails to handle arbitrary length streams as specified -- as do the other glib answers.

My point was the specification didn't seem to align with the intended problem, and that interviewers tend to make such mistakes on the description, and then get mad when you ask them to clarify if we're talking practice or theory.

Similarly, you don't account for arbitrary proper nouns, which could theoretically be unboundedly introduced to an arbitrary sized English corpus. I guess you can debate which of these are "English" (itself a proper noun!), but interviewers often treat you as dumb if you don't divine their intent in such underspecified situations.

Re: Lessons from 3,000 technical interviews

#300
post #274

Earlier quoted context omitted.

I'm hard pressed to imagine how this couldn't be done efficiently. Do you have an example which correctly solves the problem but takes too long? The only thing I can think of is something like the output rewriting an array on update over and over.

Do you have an example which correctly solves the problem but takes too long? Behold var AGESORT = rows.bubblesort("AGE ASCENDING") var AGESORT1 = rows.bubblesort("AGE DESCENDING") var MALE = "None" var MALE1 = "None" for row in AGESORT if row.isMale MALE = row break for row in AGESORT1 if row.isMale MALE1 = row break print "Min age: " + MALE print "Max age: " + MALE1 Stuff like this is usually the result of thoughts…

Good point.
Post reply on HN