Ask HN: Why I failed interview by fixing bug without using debugger? - eugenis
======
partisan
Not really anywhere near enough information to answer the question as it is
stated, but in order to provide you with an answer, it could come down to how
you identified and/or fixed the bug.

Did you put a bunch of print statements all over the place or really, any at
all? Did you comment out some lines of code and repeatedly run the sample? Did
you make changes of any kind and repeatedly run the sample to understand what
was happening?

If you answered Yes to any of the above, then you went about it the hard way.
You could have introduced additional errors into the code in a non-trivial
case. You could have left debugging/print statements in places they shouldn't
be. There are probably other good reasons why you shouldn't do it this way.

~~~
eugenis
I read the code just like reading an English article and then I saw the bug
and fixed it right on spot. Then ran successfully. No print statements were
added. Existing codes were not changed at all.

To give an example, one of the bug is for (int i = 0; i <= len; i++)

It is obvious so I just change <= to <.

~~~
partisan
Wow. OK. What makes you think this was the exact specific reason? Were there
maybe other bugs you did not catch? Maybe there were less obvious things in
the code that could have been fixed/changed? Is there any possibility of other
factors?

I think the answer as to why this happened is in you. You just have to ask the
right questions of yourself and answer honestly. Do some honest root cause
analysis.

And then at the end of the day, there are those times where you do incredibly
well and all seems as it should be and you don't get an offer. If there is
absolutely nothing to learn from the experience, well then shrug and move on.

------
davelnewton
How is this question answerable with the information given? How do we even
know that's why you "failed" the interview?

~~~
eugenis
I was given the reason explicitly that I failed because I didn't use debugger
to fix the bug.

~~~
codegeek
ok then explain to us how you did fix the bug without a debugger ?

~~~
Grishnakh
He solved it by _inspection_. It's the best way to fix a bug: it requires
understanding the code (which you should anyway), and is fast and easy. Using
a debugger requires a lot of overhead: recompiling with debugging symbols
enabled, starting up the debugger, isolating where in the code the error
happens, stepping through the code line-by-line around that point, etc. It's a
pain in the ass. If you can skip all that and just look at the code and see
"oh, this is obviously causing the problem", fix it and test it, that's a far
superior method.

Of course, solving bugs by inspection isn't always viable. At some point, it
takes less time to go through the overhead of using the debugger, because it
lets you step line-by-line and lets you inspect memory etc., then just staring
at the code. If you're highly competent, you know when each approach is the
best choice.

It sounds like this stupid company came up with an idiotic example case of a
trivial bug to use as an interview exercise, and then rules out people who
don't go through the unnecessary step of using the debugger when the bug is
obvious to a competent coder just by looking at it.

If they're testing for the ability to use a debugger, they should just come
out and say so: "you can probably spot the bug here just by looking at the
code, but we're looking for someone who can use a debugger for solving much
harder bugs, so please take that approach here and show us how you'd go about
finding a bug using a debugger."

------
sharemywin
Just look at it as they self selected as not a good place to work.

------
zura
You're lucky, seriously. Imagine you've used the debugger - you'd had to work
with such persons/company.

------
stephenr
Without knowing much detail all I can guess is that the 'test' was not about
fixing the bug, but about testing your methodology.

This sounds like when high school students get marked down/fail for "not
showing their working" in maths classes.

It doesn't matter that they can "do it in their head" the teacher is testing
to see if they actually understand how to solve the problem, not if they can
get the right answer.

~~~
Grishnakh
Yeah, I've never liked tests like that; they're insulting to intelligent
people. It's like having a driving test at the DMV where they ask you to list
all the steps in driving to a store nearby, and then they fail you because you
missed a bunch of steps such as "open the car door", "close the car door",
"put feet on pedals", "check adjustment of rearview mirrors", etc. It reminds
me of an old 80's Twilight Zone episode where some teenagers find a leprechaun
and one wishes that his parents would do whatever he wanted, and then his
parents can't do the simplest things because he has to tell them every single
little step to take, such as having to take the frozen pizza out of the box
before putting it in the oven.

If your test requires the test-taker to show every minute, trivial step, then
your test is a failure.

~~~
stephenr
My point was that maybe their test wasn't what it appears to be. The bug could
have been anything - the test may have been to see if applicants are
comfortable using a debugger.

~~~
Grishnakh
Yes, I'm sure it was exactly that. My point is that it's a failure, because
it's an insult to the test-taker's intelligence. "Here's a trivial problem to
solve, now I want to see you solve it in the most inefficient manner
possible."

------
moon_of_moon
No. Interview failed you. Apply better job. Using Debugger easy. Using brains
not easy.

------
J_Darnley
The obvious answer? You didn't demonstrate that you can use it.

------
Raphmedia
Because they want developers who develop like their current employees.

------
sevilo
not enough information, but one of the possibilities is they're trying to
judge how you approach problems. You solved the bug great, but without using
the debugger did you explain how you came to the solution? If they can't tell,
there's no way for them to tell whether you just got lucky or if you actually
have the skills to solve different problems

------
chrisBob
Interviewer - Use the debugger to find the bug.

You - No.

Interviewer - I guess you don't know how to use the debugger and it is
required for the job. Have a nice day.

~~~
0xmohit
I guess that the interviewer needs to in a put in a bit more effort to present
a problem that warrants using a debugger. Who debugs a hello world program?

------
SFJulie
fixing bugs is not a skill. Being able to look pro is, and it requires doing
the some arcane black magic to make customers think they are not being scamed.
You failed in black arts. That's all.

