Analytical Interview Questions

  • Do you still have the code for it?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Sorry Jobing.com had a rather predatory NDA (all concepts and ideas) and non-compete (3 years). Ginger says it is un-enforce-ably predatory though.

    Candidates should ask about things like this at interviews. My current job at Integreat / Med3000 gave me permission to publish universal-type scripts and things to free forums and such.

  • On the analytical SQL side:

    1. I am starting a new company and you have lined up most of your resources to do so, but am still deciding how to implement my idea, so I come to you. The idea I want to sell is vanity phone numbers to existing companies. That is - companies have a whole bank of numbers already in their inventory, and would like to be able to have access to all possible 7-letter words (in a variety of languages to be determined later) that will match their phone numbers. My product is to give them a way to find these words and help them market them, so I come to you for advice. The search tool must return stuff in real-time, and must be FAST. What do you propose I do?

    2. I have a large transaction logging table recording several thousand transactions a minute. It's a short term backup table while transactions are being set up and fulfilled, so at no time should there be a need to hold onto anything for more than three months; however the original creator of this process never put in any maintenance, so at this point the table now holds more than 4 Billion rows. The table cannot afford any substantial downtime, and it is supporting our major catalog, so it can't afford any major slowdowns either. How would you go about reducing the size of the table down to the 250M rows it should be? What will it take?

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • The problem with so-called "analytical problems" is that so very many of them aren't analytical at all, they are based on trivia.

    For example, the lamps one. Because it's been used by MS for years, it's all over the web. "Solving" it may or may not show any ability other than the l33t skillz of terminal Google abuse and trivia memorizing.

    Seriously, would you hire someone who knows how to do the "split groups of steel balls" problem (look it up if you don't know it), but who doesn't know how to write an outer join, over someone who goes, "Steel balls? Er... um ... well ... heck, I'll have to think about that", but who has published multiple excellent books on the subject of SQL, and has been an MVP for two or three centuries, etc., etc., etc?

    Even as a tie-breaker, with candidates who are otherwise indistinguishably skilled (or incompetent, your call), it's generally better to pick the one who you think will get along with the rest of the team better, or who wants a slightly lower paycheck, or any number of other, more direct, criteria. Heck, even though it may get me in trouble, given a choice of two equally skilled people, I'll pick the pretty girl over the ugly girl/whatever guy.

    Anything is better than, "how can use a bulldozer to separate two stacks of firewood, without turning the buldozer on, if your hands have been burned off and you've got a terminal case of dandruff?" or comparably silly problems. (For anyone curious, the answer to ALL such trivia/logic questions, is, of course, "42". Or, any number between 40 and 45, if it's a government job.)

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (7/14/2008)


    "how can use a bulldozer to separate two stacks of firewood, without turning the buldozer on, if your hands have been burned off and you've got a terminal case of dandruff?"

    that's the best interview question I've heard in a long while!

    for extra credit, how do you do it if the firewood is invisible?

    ---------------------------------------
    elsasoft.org

  • jezemine (7/14/2008)


    GSquared (7/14/2008)


    "how can use a bulldozer to separate two stacks of firewood, without turning the buldozer on, if your hands have been burned off and you've got a terminal case of dandruff?"

    that's the best interview question I've heard in a long while!

    for extra credit, how do you do it if the firewood is invisible?

    42i

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Stobbadino

    The best approach IMO is to set up some dummy tables with data, and ask the candidates to write SProcs and functions to return results. These need to be reasonably straightforward - depending on the level of developer you are looking for. Things like the second highest sales figure in a table is always a good one - that'll check for nested subqueries for example.

    A personal favourite of mine is to ask a candidate to write a SProc to determine somebody's age from their date of birth. This will show how much attention to detail they have. Anyone that sticks to datediff on the year probably shouldn't be hired.

    Another thing I've come across is to make sure that at least one column that will be needed in the dummy tables has a name with a space in it eg 'Sales Region'. It's interesting to see which candidates point this out when you are talking to them.

    Hope it helps

    Chris

    Do not write in this space.

  • Jeff Moden (7/11/2008)


    rameshchandra.a (7/11/2008)


    4.What are

    5.What is CTE(Common Table Expression) in Sql Server.

    It helps people who don't know how to write T-SQL. 😛

    Heh. They also help people who don't know how to READ sql (some of the recursive features can be convenient at times too.) We have some very junior people where I work that are just starting to learn SQL, so it is very important for the code to be as readable as possible (not to mention that fact that I am a fan of literate programming techniques and general refactoring to begin with).

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/

  • Hi,

    Thanks all for the replies, some very interesting thoughts and ideas 🙂

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • timothyawiseman (7/29/2008)


    Heh. They also help people who don't know how to READ sql (some of the recursive features can be convenient at times too.) We have some very junior people where I work that are just starting to learn SQL, so it is very important for the code to be as readable as possible (not to mention that fact that I am a fan of literate programming techniques and general refactoring to begin with).

    Absolutely... but be careful... I'm almost as big a fan for recursion as I am for CTE's... and like any form of RBAR (like recursion), it's totally unnecessary about 99.9% of the time.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (7/29/2008)


    timothyawiseman (7/29/2008)


    Heh. They also help people who don't know how to READ sql (some of the recursive features can be convenient at times too.) We have some very junior people where I work that are just starting to learn SQL, so it is very important for the code to be as readable as possible (not to mention that fact that I am a fan of literate programming techniques and general refactoring to begin with).

    Absolutely... but be careful... I'm almost as big a fan for recursion as I am for CTE's... and like any form of RBAR (like recursion), it's totally unnecessary about 99.9% of the time.

    I agree that recursion is overused and the same effect can often be achieved by better means, but it has its uses.

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/

  • GSquared (7/14/2008)


    Heck, even though it may get me in trouble, given a choice of two equally skilled people, I'll pick the pretty girl over the ugly girl/whatever guy.

    Yeah, this could cause problems.

  • For SQL Programming/Analytical questions Some of the standard ones are:

    1) How to Find top 3 maximum values in a column (ANS using TOP clause with ASC)

    Do you mean DESC? Wouldn't Top with ASC give you the lowest three values?

  • Jeff Moden (7/11/2008)


    Loner (7/11/2008)


    There are two rooms separating by a wall, one room has three lamps, the one one has three switches, can you tell how to find out which switch is for which lamp if you only allow to look at other room once. (Question from Bill Gates, he said if anyone can answer this question in five minutes, he would hire that person.) So far I asked many people this question, only one guy could answer this question within 5 minutes, he was a geek though.

    Judging by all the idiots that answered that question successfully that I've seen get hired over the years and still can't write SQL without cursors, while loops, and CLRs, I'd say that those types of questions are totally useless. If you want to find out how they think when programming... ask them some SQL questions...

    ... and see if the geek know's how to do it with 4 or even 5 lights 😉

    Send the intern

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

  • For an interesting take on the lamps-and-switches method of applicant screening, see book How Would You Move Mount Fuji? by William Poundstone. It delves into the Microsoft interview/applicant harrassment process in depth.

    By the way, I'm surprised that Bill suggests burning one's fingers as a solution. I'd have said "Turn all switches off. Wait 10 minutes (for cooling). Turn two switches on. Wait 10 minutes (for heating). Turn one of the two off and go check the lamps. On=on, off/cool=stayed off, off/warm=just turned off.

Viewing 15 posts - 16 through 30 (of 66 total)

You must be logged in to reply to this topic. Login to reply