Fizz Buzz interview questions for phone screens?

  • We're trying to find basic SQL interview questions where the candidate can answer over the phone. There are surprisingly a large number of candidates who can't answer simple query questions.

    We've asked a variant of the Fizz Buzz question over the phone and we're just expecting to hear "CASE statement" and "modulus" from them.

    Another simple question without them needing to write anything down is, List duplicate values in a table. We just basically need to hear "Group By <field>" and "having count(*) > 1".

    Any other basic querying questions for over the phone? We already have an assortment of standard non-querying questions such as diff between union and union all. We're bringing in several people that can answer some sql questions but apparently can't write queries so we need to do a better job of phone screening with querying questions.

    Thanks!

  • I would suggest not bothering with Fizz Buzz. That one is old and overused. Anybody who is preparing for interviews runs across that one and has a canned response. Change up the Fizz Buzz and ask them how they would solve the standard Fizz Buzz problem in t-sql with no loops and no cursors.

    I assume you are looking for sql developers based on your comments.

    Maybe things like the difference between truncate and delete.

    Briefly explain what an index is and why they are useful.

    Then you can always ask the gibberish question. Something that sounds plausible but is not. Things like "tell me about a time you had to read the transaction log to rollback a transaction that was committed a few days ago". Or "do you know how to restore a database using the Append option".

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • You could ask for a query with a LEFT JOIN that need a filter on the right table, knowing that you would look for the condition to be specified on the ON clause and not on the WHERE clause or getting a subquery instead of a table.

    It's hard to think about actual querying questions that can be made over the phone. I would suggest a written test before the actual interview.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Sean Lange (6/5/2013)


    I would suggest not bothering with Fizz Buzz. That one is old and overused. Anybody who is preparing for interviews runs across that one and has a canned response. Change up the Fizz Buzz and ask them how they would solve the standard Fizz Buzz problem in t-sql with no loops and no cursors.

    I assume you are looking for sql developers based on your comments.

    Maybe things like the difference between truncate and delete.

    Briefly explain what an index is and why they are useful.

    Then you can always ask the gibberish question. Something that sounds plausible but is not. Things like "tell me about a time you had to read the transaction log to rollback a transaction that was committed a few days ago". Or "do you know how to restore a database using the Append option".

    We just had a in-person interview (he had passed the phone screen with questions like difference between clustered and unclustered index, diff between temporary table and table variable, etc) but in person, he was not able to do our variant of Fizz Buzz (given a numbers table, output 'x' if divisible by 3, y if divisible by 5 and z if divisible by 3 and 5). He understood using a case statement but he had never used modulo (%). This was a guy with years of supposed SQL experience. On further questions, he was proposing while loops instead of set based operations. It seemed like he understood some concepts but simply couldn't code. Which is why I'm looking for query questions rather than conceptual questions.

  • floresg2 (6/5/2013)


    Sean Lange (6/5/2013)


    I would suggest not bothering with Fizz Buzz. That one is old and overused. Anybody who is preparing for interviews runs across that one and has a canned response. Change up the Fizz Buzz and ask them how they would solve the standard Fizz Buzz problem in t-sql with no loops and no cursors.

    I assume you are looking for sql developers based on your comments.

    Maybe things like the difference between truncate and delete.

    Briefly explain what an index is and why they are useful.

    Then you can always ask the gibberish question. Something that sounds plausible but is not. Things like "tell me about a time you had to read the transaction log to rollback a transaction that was committed a few days ago". Or "do you know how to restore a database using the Append option".

    We just had a in-person interview (he had passed the phone screen with questions like difference between clustered and unclustered index, diff between temporary table and table variable, etc) but in person, he was not able to do our variant of Fizz Buzz (given a numbers table, output 'x' if divisible by 3, y if divisible by 5 and z if divisible by 3 and 5). He understood using a case statement but he had never used modulo (%). This was a guy with years of supposed SQL experience. On further questions, he was proposing while loops instead of set based operations. It seemed like he understood some concepts but simply couldn't code. Which is why I'm looking for query questions rather than conceptual questions.

    Looping is unfortunately one of those things that just doesn't seem to go away in sql. So many people don't know how to do many things any other way. Often this is because they have never been exposed to it. This can generally be taught to people that are intelligent.

    Not understanding modulo with years of experience however is pretty scary. :w00t:

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • so much of it depends on how it was presented, also;

    As a veteran of more than a couple of posts here,

    How well the question is phrased directly affects how well it gets answered; you'd know if somethings wrong with the question if a high percentage cannot find the root of the question.

    I prefer interview questions asking for explanations, like can you explain what is or how to to get a feel for what a person knows or not.

    I never heard of the FizzBuzz as an interview question until maybe a year ago here; but certainly know how to use modulous..

    I never heard of the c# term "boxing" until recently also, but certainly knew how to cast objects to specific datatypes.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (6/5/2013)


    so much of it depends on how it was presented, also;

    As a veteran of more than a couple of posts here,

    How well the question is phrased directly affects how well it gets answered; you'd know if somethings wrong with the question if a high percentage cannot find the root of the question.

    I prefer interview questions asking for explanations, like can you explain what is or how to to get a feel for what a person knows or not.

    I never heard of the FizzBuzz as an interview question until maybe a year ago here; but certainly know how to use modulous..

    I never heard of the c# term "boxing" until recently also, but certainly knew how to cast objects to specific datatypes.

    I personally despise questions that ask for definitions. Like "boxing". Does it matter if you know the actual word for it? I never have really wrapped my head around the particular term. I always get some strange image in my head of C# objects wearing gold robes and mouth pieces getting ready to duke it out. 😉

    Some definitions are fine but digging into somewhat obscure terms is just ridiculous. I tend to not interview very well because I often don't know the textbook term for things that I all the time as second nature.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange (6/5/2013)


    sk them how they would solve the standard Fizz Buzz problem in t-sql with no loops and no cursors.

    Using recursion? or would you class it as a loop? if so then how?

    surely you'd grant a bonus point for recursion at least 😛

    Dird


    Dird

  • Dird (6/5/2013)


    Sean Lange (6/5/2013)


    sk them how they would solve the standard Fizz Buzz problem in t-sql with no loops and no cursors.

    Using recursion? or would you class it as a loop? if so then how?

    surely you'd grant a bonus point for recursion at least 😛

    Dird

    Take a look at this articles

    The "Numbers" or "Tally" Table: What it is and how it replaces a loop.[/url]

    Tally Table Uses - Part I[/url]

    Tally Table Uses - Part II[/url]

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • floresg2 (6/5/2013)


    He understood using a case statement but he had never used modulo (%). This was a guy with years of supposed SQL experience.

    How often have you used modulo in genuine work code (not quiche)? web scripting doesn't count. I don't see why you would ask such a question. It's a long over-used programming question which now only tests whether a person has Googled answers to interview questions to try & deceive you.

    The most difficult thing about a FizzBuzz question is the acting involved in pretending that you're actually thinking of the answer.


    Dird

  • Dird (6/5/2013)


    floresg2 (6/5/2013)


    He understood using a case statement but he had never used modulo (%). This was a guy with years of supposed SQL experience.

    How often have you used modulo in genuine work code (not quiche)? web scripting doesn't count. I don't see why you would ask such a question. It's a long over-used programming question which now only tests whether a person has Googled answers to interview questions to try & deceive you.

    The most difficult thing about a FizzBuzz question is the acting involved in pretending that you're actually thinking of the answer.

    I actually used it just yesterday on a post to a thread on this very site. I will see if I can find it.

    I also used in a proc I was working just a few days ago for something at work.

    This one...http://www.sqlservercentral.com/Forums/Topic1459823-392-1.aspx

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Dird (6/5/2013)


    Sean Lange (6/5/2013)


    sk them how they would solve the standard Fizz Buzz problem in t-sql with no loops and no cursors.

    Using recursion? or would you class it as a loop? if so then how?

    surely you'd grant a bonus point for recursion at least 😛

    Dird

    I would say that is a loop. A tally table can do this quite easily though.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Personally--and I mean this only as constructive criticism--I've always felt that phone interviews are more a time saving screening tool for the employer than a valid method for evaluating a candidate.

    If I was applying for a job as a broadcaster or something in customer support where a person's communication skills are the essence of the job requirement I would expect an employer to be focused on that area.

    If we're talking about SQL developers, I'm not sure one's phone skills are the most relevant job requirement. Yes, sure, communication skills can be important. More in some companies than in others. I worked in computer support for years and I've talked total computerphobics through the steps of hard drive installation or recovering a crashed Windows box. Very few can rise to that level for long and it is soul-draining to stare at the wall all day with the voice of some stranger talking in your ear. I lean heavily toward the introvert and only through will power do I manage to interact with other people. That's one reason I moved into software development. I love SQL development because it doesn't require much in the way of talking.

    At my office we have a young woman web designer who is an absolutely brilliant artist. Yet she talks at a whisper and is just not comfortable talking to people. She's in an office across the hall from me and yet we rarely communicate verbally. If she had been screened by a telephone interview I doubt we would now employ her valuable skills. I have no idea why some people are shy and others boisterous, but I think an entire pool of potentially valuable brain-power is lost by too much emphasis on the phone interview. I think we've all dealt with the quick-talking know-it-all who really might know-it-all and sound great on the telephone or even at a live interview but is simply the biggest pain-in-the-behind to work with.

    I really didn't mean this to be a rant, but to me it seems that trying to determine an applicant's development potential by means that really have little direct correlation to what an actual development job requires is simply counter-productive.

    Now, if you've stayed with me this far, I suppose I could offer a few suggestions to actually address your question. Hmmm...let's see.

    - Dump the modulo question. I've used that operator a lot over the years but I could certainly live without it. Some really good programmer has just for some reason never run across that term so now he's no good? I think learning to use the modulo operator is simple enough. I read the SQL Server newsletter every day just so I can find that occasional pearl and jump up screaming "holy crap! I never thought of that!"

    - OK, I'll quit being so snarky. I think a good phone-type question is to find out what the potential employee has done (recently) and is doing to be a better developer. What resources does he read? What kind of work ethic does he have? Is he trying to improve or does he swoosh through the exit at 5:01 and head for the couch to watch Entertainment Tonight? If it's just a job and nothing more then that hire might do fine for awhile but eventually such people wind up wanting more and more for less and less. Much preferable is the candidate/employee who would almost do the job for free because they love it so much.

    - Go for character, work ethic, and other life skills which you as an employer have little control over. Sure people can lie glibly over the phone about such generalities, but then if you bring in such a person after a phone interview it's likely you will see their true nature. I'd much rather take a chance with, for example, a Marine veteran with character who needs training (maybe even a lot of training) in TSQL over some 29-year-old frat boy still living in his parent's basement and spending most of his time playing on his X-box. Programming can usually be taught but teaching character, now that's not an employer's job even if it was possible.

    - OK, I'll give in and offer some "technical" questions. What is a query and what's the basic structure(SELECT, FROM, WHERE) so you know the two of you are if nothing else talking about some form of SQL. This is one case where even with my bias against phone interviews that if he answers "a what?" then it's time to call the next person on the list.

    - Maybe ask about the difference between a table, view, procedure, and function. Not some weird gotcha about the difference between a scalar vs table-valued function but rather you just want to know how much THEY know about the basic elements of SQL. But even then, like I said, you can teach SQL easily enough to someone who is eager and willing to learn.

    - Whew! I'm tired. This advice-giving is hard work! 😉

      

  • Luis Cazares (6/5/2013)


    The "Numbers" or "Tally" Table: What it is and how it replaces a loop.

    The problem with that is you'd have to create the table separately, when you said do it in tsql I read it as one action :s This is how you do it =P no way you'd do it over the phone though:

    begin

    WITH generator

    AS (SELECT 1 AS id

    UNION ALL

    SELECT id + 1

    FROM generator

    WHERE id < 100)

    select case

    when (id %15)=0 then 'FizzBuzz'

    when (id%3)=0 then 'Fizz'

    when (id%5)=0 then 'Buzz'

    else cast(id as varchar)

    end

    from generator

    end


    Dird

  • Sean Lange (6/5/2013)


    Dird (6/5/2013)


    I would say that is a loop. A tally table can do this quite easily though.

    But then you have to create some pointless table and populate it. If you can't use a loop at all then which chump wants to insert 100 rows by hand -_ I added a cooler solution above this.


    Dird

Viewing 15 posts - 1 through 15 (of 66 total)

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