6 ms·
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 someth
by prepend 6y ago
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.
- benmller313 6y agoDo 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?
- izacus 6y agoDoes 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!"?
- jhayward 6y agoYes, 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.
- prepend 6y agoYes 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...”
- collyw 6y agoI 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.
- KerryJones 6y agoWhat'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
- 908B64B197 6y ago> 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.
- justaguy88 6y agoThats the problem, they _don't_ know them and are expected to study beforehand because they're not used often in many roles
- 908B64B197 6y agoAny 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.
- 567fghvbb 6y ago
- spacedcowboy 6y agoI 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.