• ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to Chris P. Peterson
    Chris P. Peterson:
    There is no way the guy wanted an exact answer. He was trying to see the candidate's thought process when the answer was not available. The interviewer could've done a better job at asking the question and the candidate should've done a better job at realizing what was being asked and made an attempt.
    And the point is that if the interviewer is that bad at asking questions, it probably indicates a general level of WTFery at the company. "What if there were no bookstores?" Then society has fallen apart and I have more important things to do than your silly square roots. Leaving was the correct answer.
  • Anonymous Coward (unregistered) in reply to robert
    robert:
    Anonymous Coward:
    1. How do you know he wanted an exact value? You left without offering a non-exact solution.
    1. Successive approximation WILL give you an exact value.

    That's impossible. Most square root functions return an irrational number, i.e.: their digits repeat endlessly without a recurring pattern. There is no representation for the number in a digit-based system.

    As you can see in the portion of my point 2 that you omitted, I didn't really mean "exact", but rather "as exact as representable". More generally, I meant, "you can do just as good as Math.sqrt with successive approximation".

  • Franky (unregistered) in reply to asdbsd
    asdbsd:
    That last one was awful. Although you don't get to write square root formulas often, in real life not all answers are readily available. Being a programmer means that sometimes there's no site, no person, no book with the answer, and you have to patch something up by yourself.
    jeah, but up to that point until you have consulted all (easily available) it would be stupid to invent anything ... and if you want your programmer to show some skill, ask him for some real problem from the area he will actually be hired for (I am pretty sure the job didn't involve squareroots to begin with). Some ppl are great in writing formulas, others are great in working with data, others are great getting security right, etc. etc.
  • (cs) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    Chris P. Peterson:
    There is no way the guy wanted an exact answer. He was trying to see the candidate's thought process when the answer was not available. The interviewer could've done a better job at asking the question and the candidate should've done a better job at realizing what was being asked and made an attempt.
    And the point is that if the interviewer is that bad at asking questions, it probably indicates a general level of WTFery at the company. "What if there were no bookstores?" Then society has fallen apart and I have more important things to do than your silly square roots. Leaving was the correct answer.
    Maybe the interviewer was testing to see whether the applicant would perform any task, no matter how stupid. This is an important quality at many jobs.

    Interviewing is a totally different skill from actually doing the job and I would have stayed for the practice.

  • Sebastian Buchannon (unregistered)

    I am surprised JAVA doesn't come with a square root function. I thought all these new flash-in-the-pan modern languages were supposed to have all the bells and whistles.

    Yet another case where I would shine in an interview, possibly even convincing the company to undergo an organizational switch to a real programming language in the process.

    01 WS-INPUT	COMP-2.
    02 WS-OUTPUT	COMP-2.
    
    COMPUTE WS-OUTPUT = FUNCTION SQRT (WS-INPUT)
  • StMarc (unregistered)

    Perhaps he wanted to know if that last fellow knew anything about how algorithms are actually created. Since anybody who knows what a square root actually is should be able to create an algorithm to approximate one to any desired precision in about ten seconds.

  • (cs) in reply to jonnyq
    jonnyq:
    Anyone who comes up with a lame attempt at approximation to figure out a square root without checking a reference, and puts that code in production with the obvious zombie apocolypse going on, isn't fit for a programming job.

    If you are trying to program your way out of a zombie apocalypse, you probably have a heck of a lot of code to write, and you'd better get it done NOW NOW NOW!
    Plus you might not want to venture outside to go the bookstore.

  • (cs) in reply to coder guy

    Yeah. I mean tell them you don't know a formula but it's clear they want you to try and figure it out. This isn't a dumb "how many piano tuners are there" question, but an attempt to see if you can do maths.

  • Anonymous Coward (unregistered) in reply to jonnyq
    jonnyq:
    Anyone who comes up with a lame attempt at approximation to figure out a square root without checking a reference, and puts that code in production with the obvious zombie apocolypse going on, isn't fit for a programming job.
    This needlessly excludes simple programming questions that happen to have a library function. Years ago, I had an interviewer ask me something like, "You have a string of words separated by spaces. How do you reverse the order of the words in-place?" I didn't say, "What kind of crazy person would do that in-place in production code? That's grossly premature optimization. Also, you'd have to be a terrible programmer not to just use split() and reverse(). We haven't even considered localization issues with the whitespace characters!" I answered the damn question.

    How can you possibly answer interview questions if you treat them like production code? It's a bizarre standard, but suddenly everyone pulls it out because some guy was asked how he'd implement a library function.

  • (cs) in reply to Rick
    Rick:
    [I would have stayed for the practice.
    If it's at the beginning of a job search, I probably would have stayed for the practice, if only to get current on my list of good-snappy-answers-to-stupid-questions for subsequent interviews. Unfortunately, this was near the end of my job search, and I was on-my-game w.r.t. interviewing, so I just cut it short.

    I found out much later that I knew someone in another department at that company, and walking away from this person (interviewer) was absolutely the right thing to do.

  • Captcha:luctus (unregistered)

    Snoofle quit his job‽?

  • Sebastian Buchannon (unregistered) in reply to @Deprecated
    @Deprecated:
    jonnyq:
    Anyone who comes up with a lame attempt at approximation to figure out a square root without checking a reference, and puts that code in production with the obvious zombie apocolypse going on, isn't fit for a programming job.

    If you are trying to program your way out of a zombie apocalypse, you probably have a heck of a lot of code to write, and you'd better get it done NOW NOW NOW!
    Plus you might not want to venture outside to go the bookstore.

    Bookstore is one of the places you want to go in an apocalypse. It's not a priority but with no internet it'll be pretty useful in the longterm to get books on basic medicine and electronics, etc.

  • DES (unregistered) in reply to Helpfull
    Helpfull:
    If you answer ARM and Intel have built in assembly squareroot instructions the next question will be what if you don't have a processor :)

    Please show me how to use those built-in instructions in a Java program.

  • (cs) in reply to asdbsd
    asdbsd:
    That last one was awful. Although you don't get to write square root formulas often, in real life not all answers are readily available. Being a programmer means that sometimes there's no site, no person, no book with the answer, and you have to patch something up by yourself. It is this ability which the interviewer obviously wanted to test. Walking away at this point is just stupid.
    If he wanted to know how you'd deal with a situation where you don't have all the information readily available, he should have bloody asked and not come up with some Interview 2.0 rubbish that he clearly didn't understand himself.
  • DES (unregistered) in reply to Joe
    Joe:
    I've been programming for 30 years and I can guarantee you I've never had the slightest use for Math.exp or Math.log. Some programming jobs aren't about math, despite what your Computer Science teacher told you. And I'm talking real code, not drag-and-drop crap.

    None of my computer science teachers ever told me that programming was about math. Where did you get that idea? However, I'd expect candidates to have at least completed high school.

    BTW, “I've been programming for 30 years” doesn't impress me. I've worked with people with as much experience as you or more who were still totally incompetent.

  • me myself and I (unregistered) in reply to John
    John:
    Hey, where can I get a computer like yours, that can represent sqrt(2) exactly?
    Your computer can already represent that perfectly.

    √2

    See, that was not soo difficult, or was it?

  • taustin (unregistered) in reply to snoofle

    Weird -- that was exactly what I thought up after I read that. It's a crappy, but simple as...

  • Sockatume (unregistered) in reply to Severity One

    The interviewer doesn't want to know how the candidate thinks he would react to a problem outside of his training. The interviewer wants to know how the candidate would actually react. Apparently in this case it's to rage out of the office.

    I'd love to see his take on the Kobiyashi Maru.

    ("Interview 2.0"? Problems like that have been a standard part of technical interviews for decades.)

  • Barc (unregistered)

    For the last one, I think it was a fail on both parts. The interviewer should've known when to cut his losses and tried a different tact. But the interviewee is obviously a bit of a prima donna without patience. His side of the story is the interviewer was being unreasonable but to the interviewer he wasn't answering the question, just deflecting it. The interviewer probably told his co-workers about the bullet they just dodged in the guy who would have trouble holding down a job if he didn't curb the attitude. Truth is they're probably better off without each other.

  • Poster #sqrt(2) (unregistered) in reply to The REAL WTF
    The REAL WTF:
    Your approximation function should either find the exact value (what's the square root of 25?) or there IS no exact value (what's the square root of 2?) and it should be able to calculate it to any desired precision.
    Now you've done it and insulted sqrt(2), claiming that it does not even exist.
  • (cs)

    Back in 1994, the programmers responsible for maintaining a legacy ERP systems asked me how to calculate the cubic root of a number, because they were using COBOL and apparently they didn't have a math library available. I explained them how to do that using Newton's approximation, which was good enough for the problem at hand.

    In my experience, being completely unable to handle this kind of problem without using a library function is not something I'd like to see in my fellow team members.

  • mrs_helm (unregistered) in reply to Jeff

    Actually, it was a test to see how patient and creative you are when your superiors give you completely unrealistic project specs. Which happens often at many, many employers.

  • Sockatume (unregistered) in reply to Poster #sqrt(2)

    "Now you've done it and insulted sqrt(2), claiming that it does not even exist."

    Yeah, you don't want to piss of sqrt(2). He's been working out. Stomach crunches mostly. His physique is completely ab-surd.

  • (cs) in reply to Sockatume
    Sockatume:
    The interviewer doesn't want to know how the candidate *thinks* he would react to a problem outside of his training. The interviewer wants to know how the candidate would *actually* react. Apparently in this case it's to rage out of the office.

    I'd love to see his take on the Kobiyashi Maru.

    ("Interview 2.0"? Problems like that have been a standard part of technical interviews for decades.)

    Rage?

    Yes, Interview 2.0 questions have been around for a long time; but they've been mostly pointless for a long time too.

    I have found, mostly through sheer repetition, that certain things done by interviewers during an interview are (at least in my case) pretty good indicators that I don't want the job. I used to try my darnedest to answer such questions, only to get the job and realize I should have run away. After a while, you just learn to recognize the clues.

    Does it apply in every situation? Of course not. Are there times when I will try and answer such questions? That depends on how they are framed.

    But just because you're in an interview doesn't mean you should put up with pointlessness. It wastes your time, tells you a great deal about the interviewer and possibly what the job would be like were you to accidentally get it. It's not an absolute rule, but at least in my own experience, is usually a reasonably reliable indicator.

  • golddog (unregistered) in reply to snoofle++
    snoofle++:
    When you give an amateur programmer a problem, their first impulse is to roll their own solution.

    A pro goes to the language libraries first, the in-house code base second, the world of pre-written solutions third, then asks "has anyone else poured some thought into this problem" before inventing his own wheel.

    Snoofle, I think you bailed 5 seconds early. Based on your answers I would have been offering you a job in the next breath.

    It's also amazing how differently people perceive the same interaction.

    Last time I was on the interview trail, a person asked how to reverse the characters in a string (C#, asp.net). I suggested using String.reverse.

    "Well, what if that wasn't available?"...We then talked a bit about creating a method to do so, null-checking, what's their requirements for a cases like that or empty string. I may have even mentioned extension methods to avoid the null problem.

    Anyway, I got home, called the recruiter and said that I didn't think it had gone very well, as the interview just kind of ended after that.

    Twenty minutes later, she called back and said they loved me, asking if I had time that afternoon to meet with the VP-type guy for a final interview.

    Strange how I thought that part went really badly, and they thought it went well, apparently. Never thought that they might be going for, "does this guy not reinvent the wheel?" until I saw snoofle++'s answer.

  • (cs) in reply to ammoQ
    ammoQ:
    Back in 1994, the programmers responsible for maintaining a legacy ERP systems asked me how to calculate the cubic root of a number, because they were using COBOL and apparently they didn't have a math library available. I explained them how to do that using Newton's approximation, which was good enough for the problem at hand.

    In my experience, being completely unable to handle this kind of problem without using a library function is not something I'd like to see in my fellow team members.

    So they were able to ask a co-worker? Nobody said I was completely unable to handle it; only that I couldn't do it in the 10ish seconds you have to answer an interview question before the silence becomes awkward.

  • Anonymous Coward (unregistered) in reply to snoofle
    snoofle:
    the 10ish seconds you have to answer an interview question before the silence becomes awkward.
    There's your problem... Interviews can't have questions that require more than 10ish seconds of thought?
  • (cs) in reply to myke
    myke:
    the real wtf is to consider Carmack's formula for solving sqrt.
    Come one, the first port of call for any mathematical problem is most definitely the Quake code. It's all in there.

    BTW, I imagine the dialog would have continued like this: Me: I'd try to remember or work out Newton's formula. Interviewer: Assume Newton was never born. Me: Then we wouldn't be here.

  • (cs)
    It's going to like Siri

    That could get interesting, what if this turned into something more? Would Siri go out on a date with it?

  • (cs) in reply to snoofle
    snoofle:
    ammoQ:
    Back in 1994, the programmers responsible for maintaining a legacy ERP systems asked me how to calculate the cubic root of a number, because they were using COBOL and apparently they didn't have a math library available. I explained them how to do that using Newton's approximation, which was good enough for the problem at hand.
    So they were able to ask a co-worker?

    No, they were able to ask an expensive consultant ;-)

    Nobody said I was completely unable to handle it; only that I couldn't do it in the 10ish seconds you have to answer an interview question before the silence becomes awkward.

    Well, maybe something along the lines of "approximation" would have been good enough for an answer. Just walking away is a sign of a short-tempered personality, you should work on it.

  • ping floyd (unregistered) in reply to Jeff
    Jeff:
    Me: How does my ability to pontificate about unrealistic problems in an artificially constrained setting under unusual pressure relate to the projects for which you are hiring?

    Interviewer: I want to see how you think.

    Me: I think I want to work somewhere that is evaluating me for my technical skills, not my game show skills.

    Sorry, Jeff, but we have some lovely parting gifts for you!

  • (cs) in reply to Anonymous Coward
    Anonymous Coward:
    snoofle:
    the 10ish seconds you have to answer an interview question before the silence becomes awkward.
    There's your problem... Interviews can't have questions that require more than 10ish seconds of thought?
    Of course they can, but based upon personal experience, I've noticed that if you don't answer very quickly, the interviewer starts acting like you can't do it at all and need hints, as opposed to a minute or two to just think it through. It doesn't matter if you answer correctly, you look like you aren't a good fit. At that point, if the interviewer becomes somewhat aggressive, it tells me that they are a) impatient, b) unrealistic (not everyone who doesn't know something can figure it out in an instant) and c) at least for me - not someone I want to work with/for
  • Sebastian Buchannon (unregistered) in reply to TGV

    Assume you weren't even asked the question and this interview isn't actually happening. You are back at home. A path leads to the North and the South.

  • (cs) in reply to ammoQ
    ammoQ:
    Just walking away is a sign of a short-tempered personality, you should work on it.
    After all the stories I've posted about my present client, if I had even the slightest short-tempered personality, I doubt that I'd still be working here.

    Usually, the walking-away is in response to more than one warning sign. This was just the last bit of pointlessness I was willing to tolerate. The previous questions all caused alarms.

    As I said earlier, it turned out that my PHB-radar was dead-on with this guy.

    Besides, if I had taken that job, I wouldn't be working HERE!

  • Pluvius (unregistered)

    The neverending "you can't win" questions always remind me of the bear joke.

    "Hey, Jim, what would you do if you were in the forest and you met a bear?" "I'd back away slowly." "But it's mad, it attacks you!" "I shoot it." "You don't have a gun!" "I run away." "It runs faster than you!" "I climb a tree." "It climbs better than you!" "I jump in the river." "It swims faster than you!!" "Listen, Mike, whose side are you on, mine or the bear's?"

    And the punchline variation:

    "I'd hide." "It's much better than you at hiding and you'll never find it again!"

  • A.S. (unregistered)

    The WTF in the square root of stupid is that the candidate didn't understand that one workable solution (that doesn't involve a formula) would be an algorithm based around recursion. I think the interviewer learned more than the interviewee.

  • David (unregistered) in reply to ammoQ
    ammoQ:
    Just walking away is a sign of a short-tempered personality, you should work on it.

    Au contraire: some of us are proud of the fact that we do not suffer fools gladly. Sometimes this can hurt a fools feelings. Isnt life tragic?

  • David (unregistered) in reply to Pluvius
    Pluvius:
    "Listen, Mike, whose side are you on, mine or the bear's?"

    And the punchline variation:

    "I'd hide." "It's much better than you at hiding and you'll never find it again!"

    And the other punchline variation:

    "Id pick up a handful of shit and fling it at the bear." "What if there is no shit?" "There will be!"

  • jaybird (unregistered) in reply to golddog
    golddog:
    It's also amazing how differently people perceive the same interaction.

    ...

    Strange how I thought that part went really badly, and they thought it went well, apparently. Never thought that they might be going for, "does this guy not reinvent the wheel?" until I saw snoofle++'s answer.

    I had a similar experience when interviewing for a job after graduation.

    At school we'd learned to use those automated design tools with round-trip code generation. Rational Rose being the prime example.

    In the job interview, they asked me what I thought about tools like that. I had listed it on my resume, and they used it within the company.

    So I was honest. I told them I didn't think they were very practical beyond "toy" scale projects. They were great for academia but I didn't feel they would be useful beyond a very general design session. Often you realize mid-way through coding that the design you drew out just isn't going to work, and you need to redo things. Change method names, change class relationships. Trying to "round trip" between the design tool and your code IDE would take too long. Better to hash out the broad-strokes design in the tool, then code and test, and then when things are relatively stable, reverse-engineer from the code to generate your final UML diagrams for the documentation.

    I was bracing for the worst, but everyone in the room was smiling. Apparently I had just described their exact frustrations with the new processes being pushed down from upper management. They were impressed that my answer was realistic, well-reasoned, that I didn't completely trash-talk the tool or its usefulness, nor did I unrealistically embrace it.

    I got the job!

  • zxms (unregistered)

    Am I crazy, or could you not have just done this? Math.pow(x, 0.5)

  • Jack (unregistered) in reply to English Man
    English Man:
    Yeah. I mean tell them you don't know a formula but it's clear they want you to try and figure it out. This isn't a dumb "how many piano tuners are there" question, but an attempt to see if you can do maths.
    I don't "do maths". That's what computers are for.
  • Spaatz (unregistered) in reply to Anonymous Coward

    If the interviewer is using his communications skills at full throttle, then I certainly wouldn't like to work with/for him! If that's his best about explaining the requirements, I cannoy imagine what kinf of hell he makes for others when he's workign with a real project.

  • qux (unregistered) in reply to zxms
    zxms:
    Am I crazy, or could you not have just done this? Math.pow(x, 0.5)
    What if there were no power function?
  • ¯\(°_o)/¯ I DUNNO LOL (unregistered)

    For those who still don't see the WTFery of the square root thing, how about this. A guy is interviewing to be a carpenter.

    Interviewer: If you had to put two pieces of wood together, how would you do it? Carpenter: I guess I could nail them together, or maybe glue. I: But what if you didn't have any nails or glue? C: I'd go out to Home-O-Rama and buy some. I: But what if there was no Home-O-Rama? C: Then I'd go to a hardware store. I: But what if there were no such thing as nails or glue? How would you make them? C: Can I have some of what you're smoking?

    Yeah, maybe he could have come up with a different question, but using square root as the subject was like asking a carpenter how he would make nails if they hadn't been invented yet.

    Besides, how many of you even use square roots in your day-to-day work? I've been programming for decades and never had to do something that used square roots.

  • (cs)

    The ancient Babylonians had a square root algorithm:

    y(n+1) = (y(n) + x/y(n))/2
    

    This series converges on sqrt(x).

    If that doesn't shut him up, leave.

  • Brendan (unregistered)

    The real WTF is expecting someone to come up with a square root function during an interview. Maybe some people could remember enough about it to figure it out, but I'd say that candidate's answers were perfect. Is the next question going to require the candidate to invent calculus on the spot too?

  • Larry (unregistered) in reply to qux
    qux:
    zxms:
    Am I crazy, or could you not have just done this? Math.pow(x, 0.5)
    What if there were no power function?
    What if there were no math?
  • (cs) in reply to Anonymous Coward
    jonnyq:
    Anyone who comes up with a lame attempt at approximation to figure out a square root without checking a reference...
    Isn't the answer $10 per window. If it's good enough for Google...
  • My name is unimportant (unregistered) in reply to English Man
    English Man:
    Yeah. I mean tell them you don't know a formula but it's clear they want you to try and figure it out. This isn't a dumb "how many piano tuners are there" question, but an attempt to see if you can do maths.

    More import would be an attempt to see if you write proper Englishes.

  • Carl (unregistered)
    I want to kill this whole cloud thing
    Me too. Where can I invest in your startup?
    It will be an intelligent network that will be completely client-focused
    How would you code that if there were no library functions? No google? No books?

Leave a comment on “Trouble With Founders, the Lost Candidate, and More”

Log In or post as a guest

Replying to comment #:

« Return to Article