News for hackers. Stuff that matters.
Re:Why do interviewers ask linked list questions? by prepend on Monday March 29, 2021 @12:48PM (#26624608)
I used to ask about linked list (and connection pools) as a stage two fizzbuzz just to give a straightforward requirement to see how people think through something that has a little bit of a hard bit and might make the interviewee think to make sure requirements are met.

It also helps a little with culture to weed out the “I’d use a library” or “I’d Google it” as the purpose is to just walk through how to code something.

I never asked anyone to write a linked list, but it is sort of straightforward to write in a short period of time.

Re:Why do interviewers ask linked list questions? by KerryJones on Monday March 29, 2021 @12:57PM (#26624749)
What's wrong with "I'd use a library" or "I'd Google it"?

I think that's the most honest answer, and someone in the field for 10+ years I _prefer_ those answers. I don't want someone reinventing a library if a good one exists, and I hope people Google answers (or use Stack Overflow) to find solutions that are a bit more vetted. I was at a company where they pushed for all their own coding and it was a _mess_. The amount of proprietary technology we had to maintain was ridiculous, and in most cases there was 3rd party libraries that would have handled the problem as well or nearly as well.

I agree that "I'd use a library" doesn't tell you how good of a coder someone is, but I'd much prefer a "lazy programmer" to an overly-clever, always-do-it-yourself programmer. If the point of the interview is to see how someone codes, have them code something in the realm of what they would actually be doing.

Also, to be clear, if you are incredibly clever _and_ know how to do it yourself, but seek to find the balance of when to use libraries vs when not t,o I find that the most valuable.

Background: Current FAANG employee, previously CTO of small startup

Re:Why do interviewers ask linked list questions? by cousin_it on Monday March 29, 2021 @01:36PM (#26625371)
> What's wrong with "I'd use a library" or "I'd Google it"?

Saying "I'd use a library" isn't a reliable signal. If you hire based on it, everyone will just parrot it. On the other hand, being able to solve programming/math problems is a reliable signal. Linus and Jeff Dean are very good at such problems and it's not a coincidence.

Re:Why do interviewers ask linked list questions? by nicoburns on Monday March 29, 2021 @02:02PM (#26625763)
> Saying "I'd use a library" isn't a reliable signal.

True. That's why you shouldn't be asking a question where that's a good answer in the first place.

> Linus and Jeff Dean are very good at such problems and it's not a coincidence.

Sure. But being good at these problems also isn't what makes Jeff Dean or Linus good programmers. Being good at solving novel problems is. The problem with the linked list question is that half of your interviewees will have seen it before and half of them wont, thus giving you quite a biased view on them.

Re:Why do interviewers ask linked list questions? by cousin_it on Monday March 29, 2021 @02:12PM (#26625930)
> half of your interviewees will have seen it before and half of them wont

That's just not true at all. There's a huge supply of algorithmic problems and it's easy to invent new ones, so a typical problem given in an interview will be novel to pretty much all interviewees.

Re:Why do interviewers ask linked list questions? by prepend on Monday March 29, 2021 @05:00PM (#26628108)
> That's why you shouldn't be asking a question where that's a good answer in the first place.

I’d like a better question, but time is limited and spending lots of time on explaining the context behind a real example is harder. Although it’s not like I’m married to these questions and would gladly replace them with some generic question that tries to address threading, resource management, and whatever linked lists are supposed to test.

Re:Why do interviewers ask linked list questions? by collyw on Thursday April 01, 2021 @08:05AM (#26659410)
Disagree. The guy who built the system I am now maintaining reinvented the wheel many times. So now we have a lot of undocumented buggy code. Most people aren't programming the linux kernel, they are writing a variation on web based CRUD.
Re:Why do interviewers ask linked list questions? by prepend on Monday March 29, 2021 @04:58PM (#26628078)
> What's wrong with "I'd use a library" or "I'd Google it"?

I meant if that’s their only answer and they aren’t able to design something like a linked list from scratch.

Usually the answer went like “I’d of course use the built in class Foo, but for purposes of this answer, yadda yadda yadda”

Sometimes I would get someone who would argue over wherever it’s a dumb question or try to explain how they don’t know how to make getters and setters because they would just Google the answer. So that’s a bad sign for culture, teamwork.

IRL you don’t want people making their own linkedlists, just like no one should actually write FizzBuzz.

But it’s helpful to filter out the number of non-programmers who apply for programmer jobs.

Re:Why do interviewers ask linked list questions? by collyw on Thursday April 01, 2021 @08:07AM (#26659423)
>But it’s helpful to filter out the number of non-programmers who apply for programmer jobs.

I keep hearing about these people, but I have never met one in 20 years.

Re:Why do interviewers ask linked list questions? by _jordan on Monday March 29, 2021 @01:15PM (#26625055)
May I ask if the approach you describe here was what you applied in the FAANG interview? I would be pleasantly surprised if it worked! :)
Re:Why do interviewers ask linked list questions? by KerryJones on Monday March 29, 2021 @02:40PM (#26626329)
They asked no Linked-List questions (I was prepared for them, the only time I have ever used linked-lists was in interview prep).

I also think the FAANG interview was pretty bad overall (took 6 months to go through), the last question was great. It required no algorithms, but a difficult problem to solve that required me to think on my feet rather than apply a known algorithm.

I can also tell you that my current team leads have both emphasized the importance of being able to find information, less importance being able to do it off the cuff (which I agree with).

Re:Why do interviewers ask linked list questions? by balfirevic on Monday March 29, 2021 @05:44PM (#26628589)
> the last question was great

What was the question?

Re:Why do interviewers ask linked list questions? by KerryJones on Monday March 29, 2021 @05:53PM (#26628716)
They have pretty strict words around not sharing problems unfortunately, and while it's unlikely it would be traced back to me the potential isn't worth my job.
Re:Why do interviewers ask linked list questions? by balfirevic on Monday March 29, 2021 @06:00PM (#26628781)
Damn, that sounds almost draconian. Well, thanks for sharing what you could!
Re:Why do interviewers ask linked list questions? by collyw on Thursday April 01, 2021 @08:03AM (#26659390)
Exactly. If I have a new problem to solve, I may have an idea how to solve it, but I might as well see how others have solved it as there may be a better solution.
Re:Why do interviewers ask linked list questions? by 908B64B197 on Monday March 29, 2021 @01:08PM (#26624941)
> What's wrong with "I'd use a library" or "I'd Google it"?

The point of the question is to solve a problem in ~15 minutes. Algorithms and Data Structures are used for these because everyone knows them.

Re:Why do interviewers ask linked list questions? by justaguy88 on Monday March 29, 2021 @01:23PM (#26625179)
Thats the problem, they _don't_ know them and are expected to study beforehand because they're not used often in many roles
Re:Why do interviewers ask linked list questions? by 908B64B197 on Monday March 29, 2021 @01:27PM (#26625248)
Any serious intro to CS course will have them as part of the curriculum (at least for linked list).

Even when not teaching about memory, it's used to teach recursion.

Re:Why do interviewers ask linked list questions? by skyde on Monday March 29, 2021 @01:39PM (#26625424)
Right I expect anyone that just graduated 1 or 2 years ago to be able to write it in 15 minutes.

But someone who is an expert in machine learning or SQL ... and have not used data-structure for the past 20 year would need to study for it. Do you want to hire the programmer that have 0 deep knowledge of the specific thing you are working on but can quickly tell you the content of CS 101 books or do you want someone that have skill set, experience and knowledge that complement your current team?

Re:Why do interviewers ask linked list questions? by nerdponx on Monday March 29, 2021 @01:38PM (#26625402)
Not everyone who is a programmer starts with undergrad CS. Why not ask them to build a basic web app in their preferred framework, or read and process a basic text file, or any number of things that are more practical than implementing a low-level data structure?
Re:Why do interviewers ask linked list questions? by 567fghvbb on Monday March 29, 2021 @01:43PM (#26625481)
That's fine for assessing graduates, but good developers with a lot of experience won't be as familiar with writing algorithms from scratch. They'll have to do a lot of revision for technical tests just to memorise reels of information they'd google in 10 seconds in real life.
Re:Why do interviewers ask linked list questions? by etripe on Tuesday March 30, 2021 @06:55AM (#26633128)
> Any serious intro to CS course will have them as part of the curriculum (at least for linked list).

Your implied assertion is that a CS degree is required for programming. That's a good way to select for people like you, which is one of the strongest biases in hiring. One should also take survivor's bias into account, increasing the likelihood that if you're a programmer and did a CS degree, you think a CS degree is required.

Whether a "serious intro" to CS should include recursion and linked lists depends on whether you think:

a. a CS degree should prepare for a programming job

b. it should only prepare for a programming job

c. a CS degree actually prepares for a programming job

d. data structure knowledge is fundamental to programming in general

My personal answers are it should prepare for a programming job, but not exclusively, and that it doesn't usually (adequately) prepare for a programming job. In that context, it should include data structures, general computer architecture and similar historic/foundational topics. I wouldn't go so far as to call them fundamental, because that implies they're must haves. I also wouldn't go so far as to say any CS course that doesn't offer them isn't serious. Maybe that school has a greater focus on preparing for the job, or maybe someone's major is more akin to IT project management than technical.

In the end, a degree is:

* a proxy for general intelligence

* a basis for your social network

* a status symbol (school pedigree)

* an introduction to the topics covered

* an authority argument

* an indication of how well that person does at tests in an academic setting

That's it. If you're lucky, someone with a degree remembers most of what they covered in classes. At best, a CS degree is correlated to someone being able do fill a programming role.

What programming may require is:

* General intelligence

* Systems thinking (e.g. abstraction, information flows, decision trees)

* Programming language skills

* Patterns (architecture, design, OO/FP)

* Knowledge of data structures

* General IT knowledge (DevOps)

* Domain knowledge

* Framework familiarity

* Math skills

* Solving novel problems

* Absorbing new knowledge

* Communication skills (requirements gathering, expectation management, reporting, etc)

One could arrive at these skills through passion and dedication to the hobby, learning on the job, vocational training, a bootcamp, a CS degree, a PhD and more. Of these skills, the ones least likely to be required for the vast majority of positions are math skills and data structures - beyond the absolute basics.

I think it's important not to get our Ps and Qs reversed, don't you?

Re:Why do interviewers ask linked list questions? by 908B64B197 on Tuesday March 30, 2021 @08:40PM (#26642277)
You forgot a crucial variable: Signal to Noise.

Sure, a bootcamp grad might have the required skills, if I'm lucky. But most won't and interviewing over and over has a non-negligible cost (I'm wasting everyone's time)

A serious CS degree provides a better signal to noise ratio. And should cover most of the points you listed as potentially required to program anyways.

Re:Why do interviewers ask linked list questions? by etripe on Wednesday March 31, 2021 @06:57AM (#26645690)
> interviewing over and over has a non-negligible cost

I would say, specifically in the US where this type of question is asked, it is negligible compared to a dev's yearly salary. What one should consider is the time spent interviewing all candidates versus the cost of making a bad hire and doing it all over again. The only thing you're limiting when interviewing fewer people is the short-term cost of "hours spent doing interviews". That's a myopic metric.

Another thing I didn't mention in my list is churn or employee retention. Another aspect is if your domain/application might be more appealing to someone who doesn't have a degree and might stay interested and on board longer.

> A serious CS degree provides a better signal to noise ratio.

For one, noise is subjective. And in filtering out the noise, you're filtering out outliers - both good and bad. Even assuming you're right, that would only mainly apply to juniors.

> And should cover most of the points you listed as potentially required to program anyways.

The question is if you're selecting for the right criteria, since some of my points can only be arrived at through experience and general maturity.

The simple fact is: an education is only one aspect of someone's CV, a start and a depreciating asset over time. There is no sense in ignoring the candidate's job experience, general life path, public repos, etc.

Re:Why do interviewers ask linked list questions? by 908B64B197 on Thursday April 01, 2021 @01:17PM (#26663414)
> I would say, specifically in the US where this type of question is asked, it is negligible compared to a dev's yearly salary. What one should consider is the time spent interviewing all candidates versus the cost of making a bad hire and doing it all over again. The only thing you're limiting when interviewing fewer people is the short-term cost of "hours spent doing interviews". That's a myopic metric.

You are right, most of the cost is in the bad hire.

> For one, noise is subjective. And in filtering out the noise, you're filtering out outliers - both good and bad. Even assuming you're right, that would only mainly apply to juniors.

True and true. A bad hire is extremely costly.

Re:Why do interviewers ask linked list questions? by KerryJones on Monday March 29, 2021 @02:43PM (#26626386)
I would argue that's a bad "point of the question" -- also, many of them are in 50 minute interviews.

Call me crazy, I think an interview question should test for one's ability to program well, not test their memorization knowledge.

My argument is precisely that linked-list questions are a poor proxy for programming well. It's testing the wrong thing(s).

Re:Why do interviewers ask linked list questions? by spacedcowboy on Monday March 29, 2021 @12:58PM (#26624758)
I tend to start off with a "calm-the-nerves" question, something like "write me a function to print out all the numbers from INT_MAX down to 0", which has a (small) gotcha in the termination condition, but is relatively simple.

Then I'll ask something like "write a function to find the nth-to-last entry in a singly-linked list", which is possibly difficult if you haven't come across multiple-runners before.

But the meat of the interview is something like "design me an algorithm to manage the entry-gate for a car-park that can cope with bikes (1/2 space), cars (1 space) and busses (4 spaces)".

There's so much you can do with that last one. The most impressive answers I get are those that recognize it as malloc() with zones, and cope with the corner-cases (can't park a bus around the corner of a car-park, 4 spaces have to be in a straight line...)

I mean, I have a variety of questions like each of the above, and I tailor the interview to suit what other members of the team are asking too, but the quick-functions at the start are really to calm nerves and get them into the swing of the interview. The main point is the design/thought-process one, which takes the majority of the time.

Re:Why do interviewers ask linked list questions? by benmller313 on Monday March 29, 2021 @12:56PM (#26624737)
Do the people you weed out that suggest using a library know that the purpose of the question is to walk through how to code something?
Re:Why do interviewers ask linked list questions? by izacus on Monday March 29, 2021 @12:59PM (#26624781)
Does it seem reasonable to you to assume that a task on your job interview will be answered with "I'll take someone elses library" and they'll just be "ah, ok, you're hired!"?
Re:Why do interviewers ask linked list questions? by jhayward on Monday March 29, 2021 @01:35PM (#26625351)
Yes, because that's the correct answer in a real-world situation. If you want to play some game with the applicant, be sure to tell them you're playing fantasy and not reality.
Re:Why do interviewers ask linked list questions? by prepend on Monday March 29, 2021 @05:02PM (#26628134)
Yes and I usually say that. It’s not meant as a trick question. Sometimes I’ll prefix it with “While you would never do this is real life, please walk me through how you would design and implement a database connection pool...”
Re:Why do interviewers ask linked list questions? by collyw on Thursday April 01, 2021 @08:11AM (#26659456)
I got asked a python question that involved a couple of list comprehensions. I did it and got asked how to do it without an intermediate variable. It involved nesting the list comprehensions, and I nearly didn't get it, not because I didn't understand how to do it, just that I have a personal rule never to do that, as it makes code quite difficult to read.