Here are some SQL Server Interview Questions

  • Jeff Moden (5/16/2015)


    I was interviewing one person who claimed over 10 years working as a Senior DBA and "tuning experience". Here's how the clustered index segment went.

    Me: Tell me all that you know about Clustered Indexes.

    Candidate: I've never used Clustered Indexes before.

    Me: Wow! How come?

    Candidate: Because you can only use them on Clustered Servers and I've never worked on those before.

    Just shoot me.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Jeff Moden (5/16/2015)


    I was interviewing one person who claimed over 10 years working as a Senior DBA and "tuning experience". Here's how the clustered index segment went.

    Me: Tell me all that you know about Clustered Indexes.

    Candidate: I've never used Clustered Indexes before.

    Me: Wow! How come?

    Candidate: Because you can only use them on Clustered Servers and I've never worked on those before.

    I don't want to believe you.

    But then again. When I was interviewing for a junior SQL developer position, I once had a minor argument with a senior level DBA who got his cluster and non-cluster definitions mixed up. After the interview, I called the senior who I worked under to clarify so sanity reasons. He simply responded with, "Not all DBA's are created equal."

    I didn't get the job.

  • Jeff Moden (5/16/2015)


    GilaMonster (5/15/2015)


    David Webb-CDS (5/15/2015)


    You gather the customer, the developer, the network guys, the storage guy, and the server guy in a conference room. They all swear that nothing has changed. Which one is lying?

    None of them.

    Actually, that's the correct answer because they all honestly believe that nothing changed.

    And they might even be right.

    Massive, sudden changes in performance like the one described are often due to plan changes, sometimes mixed with stale or inaccurate statistics. Especially bad when there's no stable plan for the query.

    I've seen several cases before where nothing out of the ordinary happened and performance went through the floor. One time it was because the first call to the procedure in the morning was with an atypical parameter value and the plan generated and cached was not at all appropriate for the more normal parameter values, another time it was because the stats had got just far enough out of date that the optimiser generated a plan optimal for 1 row and when the query was executed 50 million rows went through it. In neither case had anyone made any changes to the code, database, network or storage between when the query ran fine and when it ran poorly.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Jeff Moden (5/16/2015)


    I was interviewing one person who claimed over 10 years working as a Senior DBA and "tuning experience". Here's how the clustered index segment went.

    Me: Tell me all that you know about Clustered Indexes.

    Candidate: I've never used Clustered Indexes before.

    Me: Wow! How come?

    Candidate: Because you can only use them on Clustered Servers and I've never worked on those before.

    DId you manage to keep a straight face?

    Was that the last question in the interview?

    Tom

  • GilaMonster (5/17/2015)


    Jeff Moden (5/16/2015)


    GilaMonster (5/15/2015)


    David Webb-CDS (5/15/2015)


    You gather the customer, the developer, the network guys, the storage guy, and the server guy in a conference room. They all swear that nothing has changed. Which one is lying?

    None of them.

    Actually, that's the correct answer because they all honestly believe that nothing changed.

    And they might even be right.

    Massive, sudden changes in performance like the one described are often due to plan changes, sometimes mixed with stale or inaccurate statistics. Especially bad when there's no stable plan for the query.

    I've seen several cases before where nothing out of the ordinary happened and performance went through the floor. One time it was because the first call to the procedure in the morning was with an atypical parameter value and the plan generated and cached was not at all appropriate for the more normal parameter values, another time it was because the stats had got just far enough out of date that the optimiser generated a plan optimal for 1 row and when the query was executed 50 million rows went through it. In neither case had anyone made any changes to the code, database, network or storage between when the query ran fine and when it ran poorly.

    In one of those cases, the first call in the morning was new/different. That's a change which I think the customer should have recognised - of course it's best to design things to be customer-proof, but ....

    Tom

  • TomThomson (5/17/2015)


    Jeff Moden (5/16/2015)


    I was interviewing one person who claimed over 10 years working as a Senior DBA and "tuning experience". Here's how the clustered index segment went.

    Me: Tell me all that you know about Clustered Indexes.

    Candidate: I've never used Clustered Indexes before.

    Me: Wow! How come?

    Candidate: Because you can only use them on Clustered Servers and I've never worked on those before.

    DId you manage to keep a straight face?

    Was that the last question in the interview?

    Knowing how recruiters interrogate their candidates after an interview, I make the whole thing sound very friendly and I never give the candidate a clue as to whether they're right or wrong. So far as I was concerned, though, the interview was over. So I wouldn't have to talk much and just out of pure curiosity, my last question in that interview came right after that question.

    Me: It says on your resume that you've got some pretty decent tuning experience. Tell me about that and your most successful tuning work.

    The rhetoric that followed was just as uninformed with his greatest tuning experience being to buy a backup package that had compression to speed up the backups.

    --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)

  • TomThomson (5/17/2015)


    That's a change which I think the customer should have recognised

    Why? When the system has several thousand users, how could we possibly expect the customer's representative to know that the first user to hit that part of the app that morning entered atypical parameters (and it was a search screen)?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Jeff Moden (5/14/2015)


    This one is actually true.

    Me, the interviewer: As the Lead Developer on this project, we're very interested in someone that understands and can easily do conversions between various numbering systems, which is why we're interested in you. For example, we need someone that can look at, say (as I write in on the white-board), 1416 and convert it to decimal in their head. What's the answer?

    Candidate that has been verified to have a PHD in Mathematics: I don't know. I'd need my calculator or a piece of paper and pencil.

    Did he find his own way there?

    Although - to be fair, given how long he'd have spent over the past several years clarting about with the greek alphabet, he may well have forgotten what a number is.

    I'm a DBA.
    I'm not paid to solve problems. I'm paid to prevent them.

  • Jeff Moden (5/16/2015)


    I was interviewing one person who claimed over 10 years working as a Senior DBA and "tuning experience". Here's how the clustered index segment went.

    Me: Tell me all that you know about Clustered Indexes.

    Candidate: I've never used Clustered Indexes before.

    Me: Wow! How come?

    Candidate: Because you can only use them on Clustered Servers and I've never worked on those before.

    These folks who know how to suit up and bluff their way past the recruiter and HR arn't completely useless. For example, he would make an excellent fall guy.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • Eric M Russell (5/18/2015)


    Jeff Moden (5/16/2015)


    I was interviewing one person who claimed over 10 years working as a Senior DBA and "tuning experience". Here's how the clustered index segment went.

    Me: Tell me all that you know about Clustered Indexes.

    Candidate: I've never used Clustered Indexes before.

    Me: Wow! How come?

    Candidate: Because you can only use them on Clustered Servers and I've never worked on those before.

    These folks who know how to suit up and bluff their way past the recruiter and HR arn't completely useless. For example, he would make an excellent fall guy.

    I've actually learned that it's not that at all. First, we know that HR can't filter candidates so we don't bother them with the IT recruiting process. Second, the same actually holds true with the recruiters. They're not stupid. They're just ignorant of what being a DBA or Developer is actually all about. It's not even the fault of the candidates. They're just ignorant, although I will admit that I'm totally amazed and the level of ignorance and what appears to be a total lack of intellectual curiosity about the main subject of their own career path.

    I'd write an editorial about it except these same people are the ones that probably don't even know what SQLServercentral is and it would never reach them.

    On that note, I've been spoiled by the heavy hitters on this site. I keep thinking that's the norm rather than the exception. I keep forgetting about the people asking the questions.

    --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)

  • andrew gothard (5/18/2015)


    Jeff Moden (5/14/2015)


    This one is actually true.

    Me, the interviewer: As the Lead Developer on this project, we're very interested in someone that understands and can easily do conversions between various numbering systems, which is why we're interested in you. For example, we need someone that can look at, say (as I write in on the white-board), 1416 and convert it to decimal in their head. What's the answer?

    Candidate that has been verified to have a PHD in Mathematics: I don't know. I'd need my calculator or a piece of paper and pencil.

    Did he find his own way there?

    Although - to be fair, given how long he'd have spent over the past several years clarting about with the greek alphabet, he may well have forgotten what a number is.

    I'm still amazed by this one. I could be wrong but this one was akin to asking someone applying for an "A" IT job and them not knowing how to login to a computer. It's also why I put no stock in the alphabet soup after someone's name. To be honest, I was totally disgusted. I could NOT believe that a PHD in Mathematics with a lengthy programming background on his resume couldn't answer such a fundamental question.

    --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 (5/18/2015)


    andrew gothard (5/18/2015)


    Jeff Moden (5/14/2015)


    This one is actually true.

    Me, the interviewer: As the Lead Developer on this project, we're very interested in someone that understands and can easily do conversions between various numbering systems, which is why we're interested in you. For example, we need someone that can look at, say (as I write in on the white-board), 1416 and convert it to decimal in their head. What's the answer?

    Candidate that has been verified to have a PHD in Mathematics: I don't know. I'd need my calculator or a piece of paper and pencil.

    Did he find his own way there?

    Although - to be fair, given how long he'd have spent over the past several years clarting about with the greek alphabet, he may well have forgotten what a number is.

    I'm still amazed by this one. I could be wrong but this one was akin to asking someone applying for an "A" IT job and them not knowing how to login to a computer. It's also why I put no stock in the alphabet soup after someone's name. To be honest, I was totally disgusted. I could NOT believe that a PHD in Mathematics with a lengthy programming background on his resume couldn't answer such a fundamental question.

    I am not surprised at all. I have seen this repeatedly.

    Interviewed a candidate for an admin DBA position. He advertised 12 years experience. He NEVER even installed SQL. Not locally, not in a test, not anywhere. He, literally, did not know anything.

    His job function for the past 12 years was to change backup tapes every day. That's it.

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • Michael L John (5/18/2015)


    Jeff Moden (5/18/2015)


    andrew gothard (5/18/2015)


    Jeff Moden (5/14/2015)


    This one is actually true.

    Me, the interviewer: As the Lead Developer on this project, we're very interested in someone that understands and can easily do conversions between various numbering systems, which is why we're interested in you. For example, we need someone that can look at, say (as I write in on the white-board), 1416 and convert it to decimal in their head. What's the answer?

    Candidate that has been verified to have a PHD in Mathematics: I don't know. I'd need my calculator or a piece of paper and pencil.

    Did he find his own way there?

    Although - to be fair, given how long he'd have spent over the past several years clarting about with the greek alphabet, he may well have forgotten what a number is.

    I'm still amazed by this one. I could be wrong but this one was akin to asking someone applying for an "A" IT job and them not knowing how to login to a computer. It's also why I put no stock in the alphabet soup after someone's name. To be honest, I was totally disgusted. I could NOT believe that a PHD in Mathematics with a lengthy programming background on his resume couldn't answer such a fundamental question.

    I am not surprised at all. I have seen this repeatedly.

    Interviewed a candidate for an admin DBA position. He advertised 12 years experience. He NEVER even installed SQL. Not locally, not in a test, not anywhere. He, literally, did not know anything.

    His job function for the past 12 years was to change backup tapes every day. That's it.

    You have to keep in mind that while this person is clearly not motivated to better themselves, it is also probably not a lie that they have 12 years experience as a DBA. If the title from their job is DBA and they have been changing backup tapes for 12 years it is wholly accurate. It is however still sad and obviously not a qualified candidate.

    _______________________________________________________________

    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/

  • On that note, I've been spoiled by the heavy hitters on this site.

    It must be said Jeff, that you are one of the heavy hitters on this site.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Sean Lange (5/18/2015)


    Michael L John (5/18/2015)


    Jeff Moden (5/18/2015)


    andrew gothard (5/18/2015)


    Jeff Moden (5/14/2015)


    This one is actually true.

    Me, the interviewer: As the Lead Developer on this project, we're very interested in someone that understands and can easily do conversions between various numbering systems, which is why we're interested in you. For example, we need someone that can look at, say (as I write in on the white-board), 1416 and convert it to decimal in their head. What's the answer?

    Candidate that has been verified to have a PHD in Mathematics: I don't know. I'd need my calculator or a piece of paper and pencil.

    Did he find his own way there?

    Although - to be fair, given how long he'd have spent over the past several years clarting about with the greek alphabet, he may well have forgotten what a number is.

    I'm still amazed by this one. I could be wrong but this one was akin to asking someone applying for an "A" IT job and them not knowing how to login to a computer. It's also why I put no stock in the alphabet soup after someone's name. To be honest, I was totally disgusted. I could NOT believe that a PHD in Mathematics with a lengthy programming background on his resume couldn't answer such a fundamental question.

    I am not surprised at all. I have seen this repeatedly.

    Interviewed a candidate for an admin DBA position. He advertised 12 years experience. He NEVER even installed SQL. Not locally, not in a test, not anywhere. He, literally, did not know anything.

    His job function for the past 12 years was to change backup tapes every day. That's it.

    You have to keep in mind that while this person is clearly not motivated to better themselves, it is also probably not a lie that they have 12 years experience as a DBA. If the title from their job is DBA and they have been changing backup tapes for 12 years it is wholly accurate. It is however still sad and obviously not a qualified candidate.

    In all fairness, for this guy to walk away from a cushy 12 year job that could have lasted into retirement and put himself back in the market takes at least some guts and resolve. Unless he was fired or layed off from his previous job, the fact that he's sitting in your office interviewing for another job is evidence that he's willing to branch out and better himself. He could know a lot about various DBA operational tasks, and is now looking to put this knowledge to practical use. However, is his objective is to land another job juggling backup tapes for a living, then, yes, he truely is a dim bulb.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

Viewing 15 posts - 76 through 90 (of 109 total)

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