• ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to Larry
    Larry:
    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?
    Imagine there's no math No electricity Imagine all the people Banging rocks together

    You may say that I'm a cultist But I'm not the only one I hope someday you'll join us And the world will die as one!

  • fing lam (unregistered)

    Along the lines of those conceptual dreamers, I once posted a question to a perl discussion board. I said my boss had directed me that his web site must always appear at the top of every search result page, and would someone send me a perl function to do that. Oh boy did that ignite a fun flamefest.

  • A Nerd With a View (unregistered) in reply to Jeff

    That last one bugs me, and not for the usual WTF reasons.

    A square root is easy to calculate, if you know anything at all about any of the standard algorithms you should have learned in college.

    In fact, the algorithm is a simple game of "guess the number," and if you can't write a "guess the number" algorithm in less than 5 minutes, you should be coding CSS templates for cybersquatters, not developing enterprise software.

    If you can't think on your feet enough to answer a question like that, perhaps you really are not the man for the job.

  • DES (unregistered) in reply to My name is unimportant
    My name is unimportant:
    English Man:
    [...] an attempt to see if you can do maths.

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

    Since “maths” is the correct idiom in British English, it is arguably more correct than “math”.

  • Ohle (unregistered) in reply to snoofle
    snoofle:
    Why? The guy wanted an exact value, not an approximation.

    If I asked you to come up with a formula for something you honestly didn't know how to calculate, you might approximate, but you won't get it exact.

    I'd be impressed if you came up with a square root function that returns exact values. Feel free to use any reference you like.
  • Erik (unregistered)
    If I was conducting interviews for a programmer position, I'd immediately fail any candidate who didn't know Newton's method and was unable to come up with it (or a similar successive approximation method) on the spot. It is blindingly obvious, and trivial to implement.

    I'd probably also fail any candidate who didn't, at some point, suggest Math.exp(Math.log(x) / 2). And even if Math.log() isn't available, you can easily compute a rough lower bound of log(x) through successive division, as an initial guess for successive approximation.

    If you ever, for any reason, find yourself in a situation where you your developers need to do complicated approximations of floating-point numbers, and you value their willingness to turn to a vaguely-recalled Newton's method as their first step, you have failed so completely that I can only hope that you aren't writing code for any crucial features of my life.

  • Will (unregistered) in reply to DES
    DES:
    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.

    You write that in the language of your choice and then make a CORBA call in your Java.

  • moz (unregistered) in reply to Brendan
    Brendan:
    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?
    Maybe; it's not that hard so long as you know how to work out the area of a rectangle.

    The interview question sounds to me like one which would be fine for a job where you're likely to come across some mildly complicated mathematics, and the answer suggests that snoofle would not be comfortable with that.

    Not sure why such a successful interview question found its way onto this site, though.

  • Recursive Reclusive (unregistered) in reply to StMarc
    StMarc:
    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.
    Yes, this isn't about finding a square root, it's about exploring how you'll go about finding a solution. By all means mention that it's a solved problem, but then go on to having a go at it.

    It's been really sad to read this thread. It gives me the impression that many programmers don't what their library functions actually do, or why the patterns they've memorized work.

  • (cs) in reply to snoofle
    snoofle:
    coder guy:
    It seems to me that anyone who can't even come up with a lame attempt at successive approximation to figure out a square root without running to a reference isn't fit for a programming job.
    Why? The guy wanted an exact value, not an approximation.

    If I asked you to come up with a formula for something you honestly didn't know how to calculate, you might approximate, but you won't get it exact.

    Ummm, you failed math class too, eh? For all but a trivial set of numbers, there is no exact, closed-form solution to sqrt(x).
  • DES (unregistered) in reply to Erik
    Erik:
    If you ever, for any reason, find yourself in a situation where you your developers need to do complicated approximations of floating-point numbers, and you value their willingness to turn to a vaguely-recalled Newton's method as their first step, you have failed so completely that I can only hope that you aren't writing code for any crucial features of my life.

    You're cute. And also an idiot—unless you intentionally misunderstood the point of the interview question.

    Come to think of it, you're an idiot either way.

    FWIW, I've worked with various SOLAS equipment vendors. If I told you even half of the stuff I've seen, you'd never set foot on an ocean-going ship again.

  • Sockatume (unregistered) in reply to snoofle
    snoofle:
    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.

    Begging your pardon, but free of context there's no reason for the reader to conclude any of that. If you were interviewing to be a code monkey, then clearly a problem-solving question is a waste of yours and the interviewer's time, but the post provided no context. Free of context it's a natural assumption on the part of the reader that a problem-solving question was pertinent to the job.* The archetypal problem solving question asks the interviewee to solve a standard problem ab initio.

    *"I went to an interview, and this guy asked me what programming languages I knew! WTF?!"

    -beat-

    "Wait, did I mention it was for Burger King?"

  • Sockatume (unregistered) in reply to snoofle
    snoofle:
    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.

    It's an interview, not a date. If you need time to think about your response, you can ask for it instead of sitting mutely. Heck, most places will let you go to town on their whiteboard while you figure out a problem.

  • Mike (unregistered) in reply to Anoldhacker

    Less wrong attempt in Java:

    public static double sqrt(double val)
    {
    	final double aprox = 0.0001;
    	double tryH = val > 1 ? val : Integer.MAX_VALUE;
    	double tryL = 0;
    	double res = Double.NaN;
    	while(tryH - tryL > aprox && val >= 0)
    	{
    		res = (tryH + tryL) / 2.0;
    		if(res * res > val)
    			tryH = res;
    		else
    			tryL = res;
    	}
    	return res;
    }
    
  • neminem (unregistered) in reply to Recursive Reclusive
    Recursive Reclusive:
    It's been really sad to read this thread. It gives me the impression that many programmers don't what their library functions actually do, or why the patterns they've memorized work.
    I'm fully willing to admit that, in many cases, I don't, and I'm completely fine with that. Would it help me to know them? In some cases, yes, and in those cases (where the API isn't perfect and I have to know why, in what cases, and how to fix it), I do try to know. But should I remember every random bit of mathematical trivia I've needed to use once or twice, just to impress people with my smartness? I can't think why.

    Unlike taking a square root, my job does involve some manipulation of pdfs - and I generally trust that our pdf library works without needing to know exactly what it does. Except when it fails, in which case, at that point, I look into why it's failing (which requires learning more about its code, and often the pdf specification, which is enormous.)

    If I had to work out how to approximate a sqrt by myself, I could probably do that. If I had to tell someone right now how to approximate a sqrt, I wouldn't be able to. I don't think I even ever learned it, but there's a lot of math I have learned and then completely forgot because I haven't used it for anything in like 7 years - I took a semester of Linear Algebra, a semester of MultiVs and a semester of DEs, but I'm not an engineer and I don't do 3d graphics, so what good did that do me after I graduated? (And stuff I learned in high school, other than basic algebra with does come up daily in really any kind of programming, would have been forgotten even longer ago. Sad, but true.)

  • RFmich (unregistered)

    How would I calculate the square root of a number during the zombie apocalypse?

    Use Newton Raphson's method for finding roots of x**2-n=0 Somewhere I should have some old 8080 assembly handy for that....if fixed point arithmetic is ok.

    For the cyclist? Well I wouldn't want the interview to be proceeded by a programming test either... preceded I could live with.

  • (cs)

    Has anyone yet mentioned that the interviewer wasn't asking for an exact value? If not, I think we need someone to create thirty math-porn posts repeating the same thing over and over again...

  • Glenn Lasher (unregistered)

    I view the square root question as a valid problem solving question. No doubt you would encounter problems in actual work where there is no existing valid solution, or at least you can't find one. It's not going to be square root, of course, but the fact remains.

    If you were a math wiz, of course, then there are two solutions I know of, one using a specific algorithm I won't describe now, the other involving manipulating exponents and logarithms.

    BUT! If you asked, instead, what the tolerance was (only perfect squares have rational results, so no tolerance means no solution), you could use a binary search to find a square root that falls within it. This is the approach I would have used.

  • Tim (unregistered) in reply to Anoldhacker

    This is actually the point. I've run interviews similar to this, where I ask the candidate to implement a basic library function.

    The point is NOT to reinvent the wheel, nor to encourage NIH behavior.

    The point is to see how a candidate thinks. How they handle edge cases. How they respond when flaws are pointed out in their code.

    I would expect a binary-search solution for anyone without a strong math background (there are algorithms for calculating square root, but I don't expect a candidate to know them offhand). As you've pointed out, there are problems with the first-pass implementation. When you point them out (what about negative numbers? What about numbers between 0 and 1?), you learn a lot about the candidate. How they respond to criticism of their code, how they would approach fixing their code to work, etc.

    Again, the point is NOT to implement a production system in an interview. That would be silly, it's an interview. The point is to see how a candidate thinks and adapts.

    The candidate was unnecessarily rude an obnoxious. I wouldn't want an arrogant jerk like that.

    That said, the Interviewer should have approached it better, and simply said "We'd like you to implement a sqrt() function".

  • Sockatume (unregistered) in reply to neminem
    neminem:
    But should I remember every random bit of mathematical trivia I've needed to use once or twice, just to impress people with my smartness? I can't think why.

    You're not asked these questions to demonstrate that you know the answer! You're asked them to show that you can think!

    Okay, sure, some people don't want to do that kind of work, but don't expect a pat on the back for taking the attitude of "I don't know the answer, therefore the question is stupid". That attitude will get you doing grunt work for the rest of your life.

  • (cs)

    For the founders: http://www.escapistmagazine.com/articles/view/comics/critical-miss/9811-Steampunk-Feminists-Vs-Zombies

    For the math Nerds (I don't have much time to elaborate):

    while (x%2 == 0) {y =* x/2;} while (x%3 == 0) {y =* x/3;} ... continue loops using prime numbers until you are happy... ... repeat until you are at a high enough prime number to be happy. you answer will be y sqrt(x), with x being a prime number. ps... this is what I remember from high school so I may be wrong.

  • Ryan (unregistered)

    Step 1: Kill this "cloud" thing Step 2: ? Step 3: Profit

  • Tony (unregistered) in reply to Jeff

    A bit esoteric, but not an outrageous question.

    The interviewer was probably looking for the guy to tell him out to write an iterative program that approaches the value with an error tolerance for when it was reached.

    Where X is the original value R' = (X + R / X) /2 Error= X - R'^2 While Error > some limit, let R = R', lather rinse repeat.

    I'm sure there are good formulas out there and having access to google would help, but surely someone should be able to figure out a solution by taking convergent averages.

  • LogosMio (unregistered) in reply to DES

    If I were conducting interviews for a hiring manager I'd immediately fail any candidate who took such an asinine position as you. I've been writing software for 24 years (professionally for 21) and the only time in my life I've ever had to use Newton's method was 23 years ago in a college course.

    Knowing Newton's method, fully understanding Newton's method, being able to implement Newton's method... those are all things of limited value and more limited usefulness beyond very specific applications and positions. Even for specific positions working on specific applications which might make use of these concepts I wouldn't rule out a candidate just because he wasn't aware of them. Ideas can be taught and learned.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to A Nerd With a View
    A Nerd With a View:
    If you can't think on your feet enough to answer a question like that, perhaps you really are not the man for the job.
    The problem isn't being able to do that (again, not that I have ever needed square roots or any complex maths in any programming I've been paid to do since my first computer job in my senior year of high school back in 1981), but the insulting way in which the question was continued with the completely stupid "What if there weren't any bookstores"?

    Before that question was asked, things were going fine. After that question was asked, the interviewer showed himself to be an idiot, plowing forward with his plan regardless of how stupid it sounded. In other words, pure PHB-ism. Since an interviewer is typically going to become your boss or co-worker, you had better be pretty damn desperate for employment to be subject yourself to months or years of that.

    If he had laughed while asking that (telegraphing that he was joking), that would have been cool. But to seriously continue past a point where basic foundations of our civilization would have to fall apart first?

  • foo (unregistered) in reply to Ohle
    Ohle:
    snoofle:
    Why? The guy wanted an exact value, not an approximation.

    If I asked you to come up with a formula for something you honestly didn't know how to calculate, you might approximate, but you won't get it exact.

    I'd be impressed if you came up with a square root function that returns exact values.
    int sqrt4 ()
    {
      return 2;  // exact value, mathematically proved
    }
    Feel free to use any reference you like.
    Any?

    Feel free to fuck Akismet whenever you like.

  • Adam (unregistered)

    Shouldn't you be able to come up with an algorithm to approximate a square root? That doesn't seem like that egregious of a question to me.

  • (cs) in reply to Anonymous Coward
    Anonymous Coward:
    snoofle:
    That tells the interviewer how I think in terms of things pertinent to the job.
    Do you walk out of interviews whenever posed any problem to solve that's not directly pertinent to your job?
    Damn skippy! I get on my bicycle and go home!
  • (cs)

    The point is, a programmer should be able to figure out how to compute a square root without using references. It was a perfectly legitimate question. He didn't ask, "How would you compute a square root as efficiently as possible," he asked for you to produce some method for computing the square root of a number.

    Hell, you could have answered "I'd go in a loop and exhaustively check the square of every possible number and see which one is closest to the true root," and you would have technically solved the problem.

    Maybe a lot of people don't know, off-hand, how to compute a square root, but what grade do they teach that in? 5th? 6th? Starting from first principles, i.e. the definition of what a "square root" is, you could have produced a solution by sheer brute force.

    If you can't even do that, or can't be bothered to, why should anyone believe you can produce a solution to a novel problem for which there are no references already?

  • Fredrik (unregistered) in reply to snoofle
    Why? The guy wanted an exact value, not an approximation.

    If I asked you to come up with a formula for something you honestly didn't know how to calculate, you might approximate, but you won't get it exact.

    Math.sqrt() wont give you an exact value either.

    If the candidate can't even blurt out binary search would be a really bad sign for me. That's somebody who knows nothing pf algorithms and only know how to combine library calls.

  • Spewin Coffee (unregistered) in reply to DES

    I disagree. Taking resources away from programmers for trivial tasks is a serious insult to the programmer if they've been writing software long enough. Also, interviews are two-way streets: You are evaluating them as much as they are evaluating you.

    For programmers who have been writing software for more than 10 years, find a different avenue of evaluation such as looking at the source code they've published and systems they have built. I don't know who snoofle is, but I like his attitude toward this ridiculous question. Frankly, snoofle should have identified the "I'm going to restrict you to the exact answer I have in front of me" question sooner and walked away sooner. I certainly would. Then again, I would also hand the interviewer my business card and say something like, "Keep this card. When you are tired of hiring people who don't know how to actually write software, call me. I'll train your employees how to select and interview programmers and weed out the garbage from the good ones as well as train you on how to keep good programmers around. Programming jobs are different from most other jobs. My consulting rate is $200/hr, but well worth the cost."

  • neminem (unregistered) in reply to smxlong
    smxlong:
    If you can't even do that, or can't be bothered to, why should anyone believe you can produce a solution to a novel problem for which there are no references already?
    Because, unless your job is -really- out there, the vast majority of problems that don't already have exact solutions, are still -related- to other problems that have solutions. So even if I knew there would be a novel solution required, I'd still want to see what other similar questions had been asked and answered before I started off on my own path. (And of course, sometimes you get lucky, and a problem you think is unique to you, actually isn't.)

    Regardless, I feel like if you want an interviewee to answer a question with some other answer than "I'd implement this using an algorithm that I know exists on stackoverflow and/or a math textbook, but which I don't have memorized", you should ask a question whose exact answer is unlikely to exist on stackoverflow and/or a math textbook. (Even if it's related to one that is, you can still see how they think.)

  • (cs) in reply to DES
    DES:
    If I was conducting interviews for a programmer position, I'd immediately fail any candidate who didn't know Newton's method and was unable to come up with it (or a similar successive approximation method) on the spot. It is blindingly obvious, and trivial to implement.

    I'd probably also fail any candidate who didn't, at some point, suggest Math.exp(Math.log(x) / 2). And even if Math.log() isn't available, you can easily compute a rough lower bound of log(x) through successive division, as an initial guess for successive approximation.

    (to those who complained that Newton's method does not give an exact value: where does it say that the interviewer expected an exact value? in any case, with a few exceptions, the floating-point representation of a number will always be an approximation of the actual value.)

    As for Carmack's method: assuming it can be implemented in Java (it can't—not without a lot of contortions), it can easily be derived from first principles if you know basic algebra and the layout of IEEE 754 floating-point numbers. If you don't know the layout, you can easily figure it out by looking at the binary representation of a handful of test values.

    So TRWTF is that the candidate refused to even try to think of an answer, then blamed the interviewer for asking him a question he should have been able to answer but wasn't.

    [image]
  • mbe (unregistered)

    Depending on the job the square root thing isn't that unreasonable. It is not that it demonstrates a useful piece of code you would normally write, but it demonstrates that you can look at a bit of math and do some numerics if necessary. My own ugly hack without looking at any references certainly wont win any prices, but I think it is a reasonable attempt during an interview:

    double sqrt(double x) {
        /* guess will be the square root in the end, I hope! */
        double guess = x;
    
        if(x < 0.0)
            /* ERROR */
    
        /* Start with guess below what it needs to be */
        while(guess*guess > x + EPS)
            guess *= 0.5;
        /* Then increase guess by small increments until it is close enough */
        while(guess*guess < x - EPS) {
            double step = guess;
            while((guess+step)*(guess+step) > x)
                step *= 0.5;
            guess += step;
        }
        return guess;
    }
    

    It's no Newton-Rhapson, but I suspect it will work.

  • foo (unregistered) in reply to smxlong
    smxlong:
    If you can't even do that, or can't be bothered to, why should anyone believe you can produce a solution to a novel problem for which there are no references already?
    Don't you remember the words of the wise prophet Alex: Programming should be boring. Novel problems are for nerds. Real business programmers aren't expected to solve them. Even trying to is evil, since either a solution exists somewhere and you must reuse it, or no solution exists and the problem is unworthy of solving. What you must do is move data around, from client to server, from server to client, from the web or the destop to the database, from one format to the other and back, etc. You must known how to use XML-Lib, HTML-Lib, *SQL-Lib, WoodenTable-Lib, and all that stuff. Thinking about solving problems makes you suspect. You could be an insurgent, or as we say nowadays, a terrorits. Used any maths recently, more than counting items in a row? You're really dangerous and should be watched. (Not by us, you know by whom.)
  • mbe (unregistered) in reply to mbe

    Hehe, I somehow failed to see the number of comments, so I am way late. Also one of the mistakes I make above has already been pointed out in an earlier try. You live and learn. But the more I look at it the better I like this interview question, just within the realm of things one can do on the fly, while being almost guaranteed to make some mistakes that one can then discuss (letting the interviewer see that you don't get rattled by such things).

  • (cs)

    To all who think I was rude/arrogant/whatever:

    You weren't there and didn't hear this jerk and his condescending attitude. Yet you've made lots of assumptions about mine. Fascinating.

    FWIW: I happen to be one of those folks who sometimes hears something and has a brain-software-glitch and gets flustered. I usually don't think quickly on my feet, so if thrown a question on something I don't happen to know, it takes me few minutes to reset. As I said above, I figured it out in a few minutes afterward.

    For those of you who obviously missed it: I walked out because the guy was a jerk, not because of the question.

  • ctd (unregistered)

    The sqrt() question is no worse than any of the "How Would You Move Mount Fuji?" type questions (which Microsoft is famous for featuring in their interviews). In this case, do you understand enough algebra & algorithms to put together a simple sensible function to solve a typical (albeit atypically-limited) problem?

    Not a WTF. His response of walking out, however, was.

  • Mithrandir (unregistered)

    The thing with the square root question is that it filters out above a certain level of competence.

    Obviously it filters out anyone without the wit to even try successive approximation. But it also filters out those who know just enough about numerical programming to know that rolling your own numerical algorithms is a really bad idea, not because of efficiency but because of the vagaries of floating point numbers.

    If you want sqrt for any scientific purpose, you really need to know what it does with the last digits of precision. You want stable behavior - you want the last sig fig to increment at the right rate relative to the argument. Successive approximation will not give you that stable behavior.

    If I were desperate enough for the job, I'd have proceeded beyond that point to ask the interviewer why I needed a square root, try to find out if they actually cared about square roots or if it was just Interview 2.0 crap. Only once I was satisfied that the interviewer would be comfortable with any old square root would I do successive approximation (and my first approximation would come from "shift right until it's 1, then shift left half as many times").

  • ME2 (unregistered)

    The correct answer to the Square root question is obviously:

    How does having me re-implement standard library functions bring in revenue to this company?

    You god damn geekass bastards.

  • Tom (unregistered) in reply to Sockatume
    Sockatume:
    Heck, most places will let you go to town on their whiteboard while you figure out a problem.
    It has been a very long time since I wrote code on a whiteboard. Give me a computer (preferably one with all my stuff available and customizations loaded) and then you can test my ability to do my job.
  • Malcom (unregistered)
    M: I'm not a math whiz; I'd drive to a bookstore and get a book on how to do it. I: What if there were no bookstore?
    M: Pop up a window and ask the user to grab a calculator and input the answer.
  • Mike (unregistered) in reply to Jeff

    Yep I agree. If not having access to technical books or the internet is a common occurrence here than I probably won't be very good at developing software for you. Perhaps you should remove calculators and computers from your accounting department too.

  • Ralph (unregistered)

    Windows 8 is full of messages like "slide your finger across the screen" even if you're using a desktop, not a tablet.

    From what I've seen in this business, I can almost guarantee that is the quality work of a CS grad who is great at reimplementing basic math functions on the whiteboard during interviews.

    For some types of programming jobs, you don't even need to know what a square root is, much less how to calculate one.

  • JohnFx (unregistered)

    Then shit got real: What if there were no NUMBERS!?!?!

    "First I'd create a number wheel function that could instantly calculate the square root of a given number. Then I would throw away that wheel and create a new wheel that does the exact same thing. Repeat for each project."

    Do you have any questions for us: "How would you compensate me for the work I do here?.... Yeah, but what if there were no checks?....What if there were no banks?....what if money hadn't been invented? Sorry, I'm not convinced you are prepared to pay me in a timely manner."

  • Nagesh (unregistered) in reply to snoofle
    snoofle:
    To all who think I was rude/arrogant/whatever:

    You weren't there and didn't hear this jerk and his condescending attitude.

    I'm here, and I'm reading the article, and what the article describes (after being run through the usual WTF embellishment engine, I assume) is a slightly inept interviewer who for some strange reason couldn't just come right out and say he want to see a solution being developed from scratch, and a completely full-of-himself candidate who must have been willfully ignoring the clear hints that the development of a solution from scratch is nevertheless plainly what the interviewer wants to observe.

    That is what the article, as posted, describes. Whether the description in the article has any discernible relation to any real interview you or someone else has been in, is sort of beside the point.

    When we hire developers, we expect them to be able to solve novel problems that are orders of magnitude more complex than approximating a square root. We also expect that they will need orders of magnitude more time than there's available in an interview to do so, however. So in order to get some kind of handle on how they'll handle actual problems, we ask them to solve some toy problems that (by experience) can usually be solved within the available time.

    Good toy problems tend to be ones that have prepackaged solutions readily available, but it's not the solution the interviewer wants -- it's how the candidate constructs solutions.

    A candidate who deliberately refuses to demonstrate his solution-construction skills during the interview is not one we'd want to hire.

  • (cs) in reply to vwiggins
    vwiggins:
    The second one has made me really sad. I get lost all the time, especially if I'm nervous. If someone judged my ability as a developer based on my inability to learn left from right or find my way around a place I've never been before I'd be horrified.

    Um, he was being judged on his prima donna attitude, his walking out on the interview, and his refusal to take a test. Nobody was judging him for his ability to find the place. In fact, he did find the place, he just left to never return. And the writer of the story noted how he understood why he looked lost.

  • William (unregistered)

    I see on your resume that you have 6 years experience designing data structures. Before we get into that, could you recite the capital cities of New York, Maryland, and Vermont? Because I'm sure they talked about that one day in third grade.

    No fair using the Internet. Or a map.

    Anyway, if during an interview you're asked to code a math function, and that isn't the skill you're interested in marketing, it makes perfect sense to move along... either to the next question, or if they continue in the same vein, to the next job.

  • ctd (unregistered) in reply to snoofle
    snoofle:
    You weren't there and didn't hear this jerk and his condescending attitude. Yet you've made lots of assumptions about mine. Fascinating.

    I'll second Nagesh's comment.

    The description sounds like a perfectly normal interview, with a little normal confusion over the point of the question. The question itself represents the essence of the job: not everything you'll be required to develop has a cookbook solution ready for you to just look up, you'll have to conjure up your own solutions (imperfect but sufficient as they may be).

    Yup, sometimes I'll glitch and get flustered too. Glitching and flustering on something which is perfectly normal for the job ("here's a simple but unsolved problem, go solve it") isn't a good sign; insofar as I've been known to do so at inopportune times is my problem, not the questioner's.

    'tis good to develop the social skill of tactfully saying "your question is valid and I'm capable of answering it, but I'm suffering a brain fart right now - how 'bout we come back to this one." If you'd just redirected the discussion for a few minutes, you'd have given the answer. I had a notable case when interviewing at Microsoft years ago: given a comparable question and comparable "brain-software-glitch", I told the interviewer "I know I'm completely missing a simple solution that you're looking for, but I'm just gonna plow ahead with a line of reasoning and let's see where I end up." (Didn't get the job, but did seem in line as a final contender.) In another interview, I knew they'd pull the "write code on a whiteboard" line, so I brought a notebook computer, and explained "writing code on a whiteboard sucks and so does writing code while someone stares at me, so I'll just write it on this computer while you go ahead and ask me other questions and I multi-task". (Got an offer, but got a better offer elsewhere.) Learned to do those after completely blowing several otherwise successful interviews due to mental misfires.

    The article says nothing about the guy being a jerk. The guy who walked out in response to a representative question typical of the work, well...

  • Niels (unregistered) in reply to Anoldhacker
    Anoldhacker:
    This should be considered a good example of precisely why you don't do things like this yourself. The square root of x for small x is much larger than x. The quick return is not needed for non-negative numbers, and if it were, the boundary would be EPSILON * EPSILON. (And no, the square root of -1.0 is NOT even close to 0.0.)

    Yes, my degrees are in mathematics, and I did floating point validation in the '90s. Seriously, don't try this at home, kids.

    (The way that we actually compute floating point square roots is fun. We look up the first several digits for the inverse square root, and then refine it based on polynomials designed to cancel the error term, usually quadratically. Once there is enough precision, you multiply back the original value to get the square root. Yes, you want a real proof that the algorithm works.)

    Heh yeah, I was pretty sure there was some glaring problem with it, but I also did try to come up with it as fast as possible.

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