• Bubblicious (unregistered) in reply to DES
    DES:
    You're cute. And also an idiot—unless you intentionally misunderstood the point of the interview question.

    Regardless of your talent or ability, I would have failed you based on your people skills. After reading your responses, it's increasingly apparent you're unable to get along with your peers.

    You could be the 2nd coming of Sir Isaac Newton, but I would not recommend hiring you. You would only manage to piss off all our coworkers, clients, and customers. You would alienate our team within our company and make our work much more difficult to accomplish.

    I think the only work environment suitable for you is a solitary office in Antarctica where your nearest coworker is several thousand miles away. Not to worry though. You'll receive drop shipments of supplies on the first day of every month. You can upload your completed work via file transfer over HAM radio.

  • Dave the Snave (unregistered)

    Come on, the interviewer was trying to see how the candidate would react to difficult situations. Clearly the candidate on this occasion was a quitter.

  • (cs) in reply to no laughing matter

    [quote user="no laughing matter sqrt(x) is monotonic when x >= 1. However for non-monotonic functions a binary search will fail.[/quote]

    I will fail you on two points.

    Firstly sqrt is monotonic even for x < 1. It is strictly increasing as f(x) > f(y) whenver x > y. It doesn't matter that, below 1, sqrt(x) > x.

    Incidentally, the derivative of sqrt(x) = 0.5/sqrt(x) which is always > 0 and therefore we know it is monotonic for x > 0.

    The second point I will fail you on is that binary search will not work on a non-monotonic function. If you have two values a and b, and your function is continuous at all points between a and b, and f(a) < y and f(b) > y then there must be at least one point x between a and b such that f(x)=y. There might be more than one but there always must be at least one.

    binary search won't work if you have two start points a and b such that f(a) and f(b) are both > y even if there happens to be a solution in between so if y is a (local) minima (or local maxima) there is no way to find it with binary search. Newton Raphson will possibly get you there, secant will also fail.

    The point is that, when you take the halfway point between and b, you will either have hit a solution or you will still have a pair of values that wrap your target (a and (a+b)/2 or (a+b)/2 and b) even if your y-range is now bigger than it was before.

  • (cs) in reply to Narpas
    Narpas:
    Regarding "What's the Square Root of Stupid?"

    throw std::invalid_argument( ""Stupid"" is not valid input for square root );

  • Warbo (unregistered)

    @snoofle

    They were probably waiting to hear "Newton-Raphson iteration, with d(sqrt)/dx = 2x". My guess is they were testing whether you went to high school. Looks like you failed...

  • Buddy (unregistered) in reply to Warbo
    Warbo:
    @snoofle

    They were probably waiting to hear "Newton-Raphson iteration, with d(sqrt)/dx = 2x". My guess is they were testing whether you went to high school. Looks like you failed...

    They would like to hear things like this:

    • handling < 0
    • handling 0
    • normalizing for < 1
    • simplifying the problem to 1 <= x < 2 by removing the exponent
    • getting a first approximation
    • using Newton's on x
    • divide the exponent by two
    • put the exponent back in
    • correct for odd exponents
    • undo any normalization for < 1

    This is a complete procedure for the square root function in the real domain. Say stuff like this and they'll be impressed.

  • Mark Wilden (unregistered)

    I would've gone back and forth with snoofle for a while, up until the point where it was obvious he wasn't interested in 1) writing a square root function (it's not rocket science), or 2) answering the question the interviewer was actually asking.

  • bob_long_nose (unregistered) in reply to Spewin Coffee
    Spewin Coffee:
    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."

    The correct answer would have been "I probably couldn't do it." r "I could come up with something but it wouldn't be pretty, brute force for example."

  • Wyrd (unregistered)

    Leaving was definitely the right move. I don't know exactly what that interviewer's game was, But he struck me as highly manipulative. Especially that stupid "we're not through yet" crap at the end.

    It seems like he was just trying to establish dominance by making you feel weak. With that kind of attitude what kind of programmers do you suppose he's able to retain? Certainly no one good. just a bunch of people who are trying to say "yes you're right, sir" all the time. And then that interviewer guy will wonder why they can't hire a good programmer and blame the programmers.

    -- Furry cows moo and decompress.

  • Wyrd (unregistered) in reply to Mark Wilden

    Please tell me how to write sqrt(). And remember don't use Google. If you don't have the formula already memerized at the time that you read this, then I'm gonna have to count that as a fail.

    -- Furry cows moo and decompress.

  • The Business man's view (unregistered)

    So I've interviewed countless people, managed various types in various settings, and the game game works the same EXCEPT when it comes to computer people.

    If a non-tech person shows up for an interview, they do their best to impress. When a tech person shows up, they all have entitlement issues and think they are infallible.

    The normal procedure goes along the lines of the candidate trying to impress the interviewer and making them feel like this person belongs on the team.

    The normal procedure when hiring a tech guy is trying to impress them and convince them they belong on the team.

    This stuff takes time to get used to. Tech people are dangerous, because they control you assess and your access to them. But because there is such demand for skilled PC guys, they have the upper hand. Most of them seem to think they are better than what they actually are however.

  • MadCow42 (unregistered) in reply to Pluvius

    or the other option...

    "I'd reach down, grab a pile of poop and throw it at the bear."

    "What if there were no poop?"

    "Oh, there would be by this point..."

  • gumby (unregistered)

    "What if there were no one to ask?"

    Ummm.... I appreciate the idea of seeing how someone thinks and can deconstruct a problem, but at some point, there has to be someone to ask - the client/manager/customer/user/someone.

    If there's no one to ask, there's no one to verify if it's right or not, so I'll just return 0 or null and move on.

  • Captain (Ab)Surd (unregistered) in reply to coder guy

    I agree. I would've calmed the submitter down and given him the problem again as finding the f^(-1)(x) where we had a black box for computing f(x). Then tell him that f(x) was in fact x^2 and he's solved my square root problem after all and watch his head explode. Then tell him to GTFO obviously.

  • CFO Idiot (unregistered)

    How about this awesome code (written by a CFO):

    public static double findTheGoddamnSqrt(double num) { int godamnAnswer = 0; while (++godamnAnswer * godamnAnswer != num); return godamnAnswer; }

    Concise and to the point and wastes a lot of time like the stupid question

  • Verbok-5 (unregistered) in reply to jonnyq

    Ya, well - depending on how clever he wants this programmer to be , determines the appropriateness of the question. As for the Zombie apocolypse , that is a non-real event and a non-real 'number'... [Lolz]

  • Simon (unregistered)

    (In response to the square root of stupid)

    M: I'd approximate the number one digit at a time. I: What if you couldn't do that? M: I'd, uh... guess randomly? I: What if you had no random number generator? M: I'd weep and cry out. I: What if... you had no mouth?

  • itu (unregistered) in reply to snoofle

    If your story is true you were really really rude and stuck up for no reason. Every computer science freshman should have an idea of how to successively approximate a function to arbitrary precision, at least with methods as inefficient as binary search.

    However your "you might approximate but you won't get it exact" thing shows you know nothing about what that means.

    The problem is hardly unrealistic. It's a trivial function everyone knows about and the question tests very simple computing ability.

  • jmc (unregistered) in reply to snoofle

    $eps = macheps() # calculate machine epsilon somehow

    def sqrt(x) val = x

    if (x >= 1)
        while (val*val > x)
           val = val - $eps 
        end
    else
        while (val*val < x)
           val = val + $eps 
        end
    end
    
    return val
    

    end

    This is basically as exact as your computer can handle (accurate to a step maybe). It will take forever to calculate a single value, but will work nonetheless.

  • eric bloedow (unregistered)

    i keep thinking of a similar "square root of stupid" style interview in a much later story on this site...the interviewee finally snapped and said, "well, then i would ask YOU how to solve the problem, since YOU are obviously the only person who knows the answer!"

  • (>#'0')> (unregistered)

    The square root guy (the interviewee) is a moron. Math isn't some arcane folk art requiring millennia of rote memorisation. Frankly he didn't deserve the job and thank God he didn't get it. The LAST thing the interviewer was looking for was a memorized formula.

    The sqrt function is monotonically increasing and smooth. Square roots of even powers of two are trivial to calculate. Therefore, choose the nearest two even powers of two, then perform a binary search between these two bounds using the inverse function (x^2) until the desired level of accuracy is reached.

    There. I've demonstrated that I can approach a problem logically and come up with a solution in a short space of time, and communicate it effectively. It doesn't have to be the perfect solution, it just has to demonstrate that you're not a stuck-up, temperamental moron, and he failed the test.

    Fuck's sake people.

  • JamesPaync (unregistered)
    Comment held for moderation.
  • TheresaTut (unregistered)

    Willingly I accept. The theme is interesting, I will take part in discussion. I know, that together we can come to a right answer.

    guardianship tied to sex machine

  • MarilynRexum (unregistered)

    I shall afford will disagree with you

    circumspection bondage machine porn

  • Jacobobz (unregistered)
    Comment held for moderation.
  • Alexanderfmj (unregistered)
    Comment held for moderation.
  • Oxana (unregistered)
    Comment held for moderation.
  • Eddiegah (unregistered)

    https://ricardorizo60988.nizarblog.com/7498800/Бесплатный-чат вебка знакомства бесплатно https://alexiscawo77765.goabroadblog.com/8700287/Бесплатный-чат вебка онлайн бесплатно https://zanderfcxr89999.verybigblog.com/8716722/Онлайн-девушки-из-твоего-города вебки бесплатно http://jasperqnia11100.bleepblogs.com/10708233/Бесплатный-чат бесплатно девочки на вебках вебка эротика бесплатно бесплатные игры с вебкой [url=http://martinwitd09753.bloginder.com/10363558/Горяч&

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