If you know what you are doing even in the slightest, you won't fail.
No one will put you next to the whiteboard and say "do FizzBuzz", expecting you to know exactly what it is and what to do. They will say "write a function that takes in a positive integer as an argument, and then counts from 0 up to that integer. Every time a count is divisible by 3, print out 'Fizz'. Every time a count is divisible by 5, print 'Buzz'. If a count is divisible by both 3 and 5, print 'FizzBuzz'".
I cannot imagine someone who wrote all the complex things you did, but is not able to write a toy counter function like that.
But in general, I find LeetCode style interviewing very boring and dry. Like all of those "Given a string, find a substring that satisfies bla bla condition", or "given a matrix as csv input, read it then calculate some BS and find the best estimation for some other BS, etc".
When I was very young and naive, that might be fine, but at this point in my life, I just get super super bored and annoyed by such questions.
Instead, I prefer contextual questions. Like if you're hiring for a low-level network programmer, let me do some socket stuff in C or Go, implement a backoff mechanism in a given code template, discuss some TCP/IP congestion stuff, discuss some code, add a small feature, put a bunch of system calls and watch how I care about performance (blocking vs non-blocking, epoll vs select, shared-memory vs message-passing, context switching, etc) and how I handle errors, and also observe my workflow, how I check the documentation, the man pages, debugging, etc.
I think this is a much more reliable and less frustrating way of interviewing and I believe it attracts very highly skilled and motivated people.
I've seen candidates fumble when given the problem of adding a node to the end of a linked list. Everybody is pampered now with swiss army knife languages that do everything for you that they don't know how anything basic works. Many of the HN crowd will sneer at the idea of this sort of low level coding but it is still important in many domains.
Wow. Who's sneering again?
> Many of the HN crowd will sneer at the idea of this sort of low level coding but it is still important in many domains
Yeah, we do. Because developer-cum-interviewers for companies writing marketing-optimized CRUD apps use these as filters (or to make them feel superior, take your pick), and sneer at people who can't bark out the proper magic incantation for reversing a linked list on demand.
And let's be honest. Unless you're in an exceptionally specific field with exceptionally restricted resources, using the "swiss army libraries" will create more performant code than a human can. Because those "pampered languages" have been optimized to ridiculous degrees.
Haha, and then there are stories about python finally getting rid of the GIL - soon, probably, hopefully!
And that's only my favorite language.
If you were being hired into a specialist role such as for low-level networking, there would absolutely be a more detailed “Systems” interview where you would discuss in depth the topics you mentioned, usually in the context of a more open-ended “architectural” problem.
Interviewee performance on these “Systems” interviews hold a lot more weight at senior levels, not just for hire/no hire decisions, but in fact the level of your offer.
I'd suggest actually looking up what fizz buzz is before making that claim.
https://en.wikipedia.org/wiki/Fizz_buzz
I like it as an interview question because it gives insight into the candidate's thought process. I'm not as concerned that the resulting code works. My approach is to explain fizz buzz, hand the candidate a computer, ensure they have the tools they're comfortable with, and tell them to use whatever resources they need. Copy and pasting code from the Wiki page wouldn't be the worst that I've seen (and would be 100% acceptable to me if the candidate can explain what the code does). Write it in BF for all I care, as long as you can explain what it does and (ideally) run it.
At one job a few candidates stood out. I was running late as usual, so I popped in, realized I'd forgotten my notebook in my car, and went back to grab it. By the time I returned the candidate had literally run out of the office. One candidate wanted to impress us with his bash skills and got completely flummoxed trying to figure out how to implement the modulo operation in bash. What really stood out about the candidate we hired was that they reviewed the code and then ran it to verify the correct behavior before handing the computer back to me. They were the only candidate to do that.
I like fizz buzz because it's both a good low pass filter and a good jumping off point for further discussion. If you can't read the Wiki entry and wrap your head around fizz buzz, you're probably not a good fit. If you can then there's the opportunity to ask all sorts of questions (e.g. why did you choose this language, how would you test this, what would you do differently) and maybe even move on to a more complex program.
For the one candidate who struggled with bash, we started offering input around the ten minute mark. Stuff like "is there something else you could use instead of the modulo operator", leading questions to encourage them to check the man page (or google it), inquiring maybe a different language would be a better fit. That this person could wrap their head around fizz buzz was only a minor detail. That they were fixated on making a specific implementation work was a big miss. At this job specifically the tech stack was fairly diverse so there was a lot of value in being able to suss out the right tools for the job and less value in being able to bang out a more complex algorithm in clojurescript or whatever.
A fellow commenter here has already addressed this point, but let me reiterate: you wouldn't be told "do FizzBuzz" with the expectation that you already know what FizzBuzz is. The problem definition would be explained, and it is a very trivial problem. That's why it's often used as a low level filter for programming interviews.
At a former employer we used to do just about everything we could to make the process as easy for the candidates as we could. We'd give them a laptop with an IDE running, the skeleton of the test app already in place (eg, main method, and any "plumbing" dictated by the language. We supported using Java and Python) and comments basically saying "flesh in the required logic here." We would give them, IIRC, 5 such "skeletons" and ask them to pick any one (or more) they wanted to implement and gave them approximately 30 minutes. Besides FizzBuzz the other ones were "reverse a string" and other problems of similar difficulty. And yes, you could use any standard library API that you wanted. And frankly, if somebody had said "I know how to do this, but I'd need to download library $FOO" we probably would have arranged to get them library $FOO ('net access on the test machine was disabled, as we really didn't want to test their ability to go find the answer somewhere else and copy & paste).
And despite all that, it was sad to find that very many candidates, even those with documented years of experience and/or advanced degrees, could not manage to complete a very simple programming assignment. Well... I say "sad" but there is another way of looking at this: it could be that FizzBuzz, "reverse a string", etc., just don't have any particular relevance and that this whole exercise is useless. I mean, if you have a person who's been gainfully employed as a developer for 10 years, and they can't do this, what does that tell you? Maybe it's the test that's wrong. Even though intuitively, I think most developers would believe that anybody who can't do this sort of thing doesn't really know how to program.
Anyway, back to the original point directed at the OP: being self-taught isn't really that big a deal, IF you can demonstrate some fundamental level of competency.
If number modulus 3 is true, print "Fizz"
If number modulus 5 is true, print "Buzz"
If number modulus 15 is true, print "FizzBuzz"
My favorite examples are in Python and Lua, but I honestly adore Lua's version as it makes it really clear of what it does.Here's an implementation of mine for reference:
local startTime = os.clock()
for i=1,100 do
fizz = (i % 3 == 0) and "fizz" or ""
buzz = (i % 5 == 0) and "buzz" or ""
if fizz == "" and buzz == "" then goto continue end
print(string.format("[%03d]: %s", i, fizz..buzz))
::continue::
end
local endTime = os.clock()
print(string.format("Total time %.6f seconds", endTime - startTime))The field of interviewees is so mediocre that if you start with a reasonably difficult interview question a lot of them will flounder and will never get it. When I interview I like asking tiered questions. They build on each other conceptually and get harder.
The first one I ask takes good candidates 10-15 minutes at most. I've had some solve it in 2 minutes. You can write a not-too-ugly 1-liner in Python to solve it. Some candidates spend a full interview on that question and never get it. The question isn't a trick question, it requires a basic knowledge of data structures and directly translates to the (mostly simple) code people write every day. If someone solves this question it basically tells me that they're good enough for the second question, not much else.
But man, is it painful to interview someone who can't answer that first question with a harder problem to start with. I don't know if you've ever interviewed someone who just didn't get it, no matter how many hints you drop, but it is an uncomfortable experience.
That is why we have FizzBuzz. Asking a harder question first to a shockingly large number of candidates is a waste of effort. So we all have to FizzBuzz and then (hopefully) answer some real questions.