Interview Questions

  • I can do it in a single line of code, so I could put it in a single function or statement vs a table, but seven REVERSE() seems a bit much. But it does work, as long as there's two backslashes. Though I've done string manipulation for decades, oddly this is my first time using T-SQL's Reverse(), so I'm just happy that it works. I'd guess less than half an hour to do it from scratch.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • Sean Lange (6/7/2016)


    Jeff Moden (6/7/2016)


    Eric M Russell (6/7/2016)


    They're asking the wrong type of questions for a job interview.

    I think it's a great question. It shows whether or not you actually know much about string manipulation. It's not a difficult question and, once I know if someone can actually get the current date and time (something like 80% have failed that simple question), then I move on to things like this. Both DBAs and Developers need to know simple stuff like this.

    I actually used that in our last round of interviews. "Can you state one way you might get the current system time using t-sql?". This was a developer position but we do all of our own queries. Out of about 20 we had one person who gave the very shocked and nervous "getdate?".

    The other I like to ask is "what are some steps we can use to prevent sql injection". I got the most creative answer ever recently. After sitting there in obvious pain and being totally silent for nearly two full minutes (no exaggeration) the interviewee stated something to the effect of "we can leverage sql injection to improve the performance". :w00t:

    I had an interviewee tell me "I haven't used SQL injection recently, but I'm sure I can pick it back up pretty easily"...

    - 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 (6/9/2016)


    Sean Lange (6/7/2016)


    Jeff Moden (6/7/2016)


    Eric M Russell (6/7/2016)


    They're asking the wrong type of questions for a job interview.

    I think it's a great question. It shows whether or not you actually know much about string manipulation. It's not a difficult question and, once I know if someone can actually get the current date and time (something like 80% have failed that simple question), then I move on to things like this. Both DBAs and Developers need to know simple stuff like this.

    I actually used that in our last round of interviews. "Can you state one way you might get the current system time using t-sql?". This was a developer position but we do all of our own queries. Out of about 20 we had one person who gave the very shocked and nervous "getdate?".

    The other I like to ask is "what are some steps we can use to prevent sql injection". I got the most creative answer ever recently. After sitting there in obvious pain and being totally silent for nearly two full minutes (no exaggeration) the interviewee stated something to the effect of "we can leverage sql injection to improve the performance". :w00t:

    I had an interviewee tell me "I haven't used SQL injection recently, but I'm sure I can pick it back up pretty easily"...

    That's hilarious!!!

    _______________________________________________________________

    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/

  • GSquared (6/9/2016)


    Sean Lange (6/7/2016)


    Jeff Moden (6/7/2016)


    Eric M Russell (6/7/2016)


    They're asking the wrong type of questions for a job interview.

    I think it's a great question. It shows whether or not you actually know much about string manipulation. It's not a difficult question and, once I know if someone can actually get the current date and time (something like 80% have failed that simple question), then I move on to things like this. Both DBAs and Developers need to know simple stuff like this.

    I actually used that in our last round of interviews. "Can you state one way you might get the current system time using t-sql?". This was a developer position but we do all of our own queries. Out of about 20 we had one person who gave the very shocked and nervous "getdate?".

    The other I like to ask is "what are some steps we can use to prevent sql injection". I got the most creative answer ever recently. After sitting there in obvious pain and being totally silent for nearly two full minutes (no exaggeration) the interviewee stated something to the effect of "we can leverage sql injection to improve the performance". :w00t:

    I had an interviewee tell me "I haven't used SQL injection recently, but I'm sure I can pick it back up pretty easily"...

    Awesome story! I assume he's also "picking up" a payroll check somewhere else :).

    SQL DBA,SQL Server MVP(07, 08, 09) "Money can't buy you happiness." Maybe so, but it can make your unhappiness a LOT more comfortable!

  • GSquared (6/9/2016)


    Sean Lange (6/7/2016)


    Jeff Moden (6/7/2016)


    Eric M Russell (6/7/2016)


    They're asking the wrong type of questions for a job interview.

    I think it's a great question. It shows whether or not you actually know much about string manipulation. It's not a difficult question and, once I know if someone can actually get the current date and time (something like 80% have failed that simple question), then I move on to things like this. Both DBAs and Developers need to know simple stuff like this.

    I actually used that in our last round of interviews. "Can you state one way you might get the current system time using t-sql?". This was a developer position but we do all of our own queries. Out of about 20 we had one person who gave the very shocked and nervous "getdate?".

    The other I like to ask is "what are some steps we can use to prevent sql injection". I got the most creative answer ever recently. After sitting there in obvious pain and being totally silent for nearly two full minutes (no exaggeration) the interviewee stated something to the effect of "we can leverage sql injection to improve the performance". :w00t:

    I had an interviewee tell me "I haven't used SQL injection recently, but I'm sure I can pick it back up pretty easily"...

    I'm sure he could too.

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

  • Eric M Russell (6/7/2016)


    Luis Cazares (6/7/2016)


    Was I too late for April fools' day?

    This is what happens when you trust a forum to answer questions that you should answer on your own.

    I could have given a real answer, but this is an example of the reasons behind my disclaimer. I wouldn't want someone that uses something without at least understanding how it works or at least point to some documentation for it.

    If I was interviewing this person, I wouldn't mind if the answer is incorrect as long as it demonstrates knowledge on string manipulation and creativity to solve problems.

    I personally would put string manipulation using T-SQL in the same category as programming a row-by-row cursor; I don't consider it to a core competency for a T-SQL developer. I'd ask questions about joining, grouping, ranking, indexing, isolation, and execution plans before I would test someone's knowledge about string manipulation, but then again I'm typically sitting in on a panel interview and can only ask maybe a half dozen questions. So I typically bypass the Programming 101 stuff and zoom in on what I really expect from senior level database developer.

    It's a good topic for a forum discussion, I'm just saying it's not a good interview question within the context of a SQL Server Developer/DBA position.

    In my opinion I think this is a pretty reasonable position to hold, I might not be able to provide the file part of a path in an interview despite having done it in production simply because if I don't routinely use a function, theres a good chance I'm going to have to look up the function definition and parameters. I do realise that this could cost me in interviews though, but if I have to produce code without using language references I might not be a great match for that position so I guess it would work out anyways 🙂

  • patrickmcginnis59 10839 (6/9/2016)


    Eric M Russell (6/7/2016)


    Luis Cazares (6/7/2016)


    Was I too late for April fools' day?

    This is what happens when you trust a forum to answer questions that you should answer on your own.

    I could have given a real answer, but this is an example of the reasons behind my disclaimer. I wouldn't want someone that uses something without at least understanding how it works or at least point to some documentation for it.

    If I was interviewing this person, I wouldn't mind if the answer is incorrect as long as it demonstrates knowledge on string manipulation and creativity to solve problems.

    I personally would put string manipulation using T-SQL in the same category as programming a row-by-row cursor; I don't consider it to a core competency for a T-SQL developer. I'd ask questions about joining, grouping, ranking, indexing, isolation, and execution plans before I would test someone's knowledge about string manipulation, but then again I'm typically sitting in on a panel interview and can only ask maybe a half dozen questions. So I typically bypass the Programming 101 stuff and zoom in on what I really expect from senior level database developer.

    It's a good topic for a forum discussion, I'm just saying it's not a good interview question within the context of a SQL Server Developer/DBA position.

    In my opinion I think this is a pretty reasonable position to hold, I might not be able to provide the file part of a path in an interview despite having done it in production simply because if I don't routinely use a function, theres a good chance I'm going to have to look up the function definition and parameters. I do realise that this could cost me in interviews though, but if I have to produce code without using language references I might not be a great match for that position so I guess it would work out anyways 🙂

    As a programming language, SQL suffers from the same plight as HTML, there are a lot of people who claim to know how to use it, fewer people have practical experience, and very few can craft SQL at a professional level.

    If hiring someone to write T-SQL code, I want them to know:

    - normalization

    - how to solve problems using set based logic

    - logical joins (inner, outer, cross)

    - how locking, isolation level, and blocking works

    - the difference bertween a covered and non-covered index and why it matters

    It can take years of practical experience to learn that, and when you find someone who understands at that level, then you want to hire them. Beyond that; it's also helpful if the candidate has industry domain knowledge, which again takes years to accumnulate.

    But string manipulation; that's a 2 minute lookup on Google.

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

  • Eric M Russell (6/9/2016)


    patrickmcginnis59 10839 (6/9/2016)


    Eric M Russell (6/7/2016)


    Luis Cazares (6/7/2016)


    Was I too late for April fools' day?

    This is what happens when you trust a forum to answer questions that you should answer on your own.

    I could have given a real answer, but this is an example of the reasons behind my disclaimer. I wouldn't want someone that uses something without at least understanding how it works or at least point to some documentation for it.

    If I was interviewing this person, I wouldn't mind if the answer is incorrect as long as it demonstrates knowledge on string manipulation and creativity to solve problems.

    I personally would put string manipulation using T-SQL in the same category as programming a row-by-row cursor; I don't consider it to a core competency for a T-SQL developer. I'd ask questions about joining, grouping, ranking, indexing, isolation, and execution plans before I would test someone's knowledge about string manipulation, but then again I'm typically sitting in on a panel interview and can only ask maybe a half dozen questions. So I typically bypass the Programming 101 stuff and zoom in on what I really expect from senior level database developer.

    It's a good topic for a forum discussion, I'm just saying it's not a good interview question within the context of a SQL Server Developer/DBA position.

    In my opinion I think this is a pretty reasonable position to hold, I might not be able to provide the file part of a path in an interview despite having done it in production simply because if I don't routinely use a function, theres a good chance I'm going to have to look up the function definition and parameters. I do realise that this could cost me in interviews though, but if I have to produce code without using language references I might not be a great match for that position so I guess it would work out anyways 🙂

    As a programming language, SQL suffers from the same plight as HTML, there are a lot of people who claim to know how to use it, fewer people have practical experience, and very few can craft SQL at a professional level.

    If hiring someone to write T-SQL code, I want them to know:

    - normalization

    - how to solve problems using set based logic

    - logical joins (inner, outer, cross)

    - how locking, isolation level, and blocking works

    - the difference bertween a covered and non-covered index and why it matters

    It can take years of practical experience to learn that, and when you find someone who understands at that level, then you want to hire them. Beyond that; it's also helpful if the candidate has industry domain knowledge, which again takes years to accumnulate.

    But string manipulation; that's a 2 minute lookup on Google.

    But for anybody who actually writes sql it is so trivial it shouldn't be an issue at all. I tend to side with Jeff on this one. As an early question in an interview it isn't bad at all. In fact, I wouldn't even care really if the result was correct. If they can just rattle off a few string manipulation functions with zero thought then you can immediately tell they have actually done this stuff. If this is somebody writing code I would like to know they are fluent right out of the gate. If they couldn't at least come up with something reasonable I don't care how much they know about the rest of the valid items you listed. As a code writer if you can't handle the 101 or maybe 201 you are not likely going to be a very strong 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/

  • Sean Lange (6/9/2016)


    Eric M Russell (6/9/2016)


    patrickmcginnis59 10839 (6/9/2016)


    Eric M Russell (6/7/2016)


    Luis Cazares (6/7/2016)


    Was I too late for April fools' day?

    This is what happens when you trust a forum to answer questions that you should answer on your own.

    I could have given a real answer, but this is an example of the reasons behind my disclaimer. I wouldn't want someone that uses something without at least understanding how it works or at least point to some documentation for it.

    If I was interviewing this person, I wouldn't mind if the answer is incorrect as long as it demonstrates knowledge on string manipulation and creativity to solve problems.

    I personally would put string manipulation using T-SQL in the same category as programming a row-by-row cursor; I don't consider it to a core competency for a T-SQL developer. I'd ask questions about joining, grouping, ranking, indexing, isolation, and execution plans before I would test someone's knowledge about string manipulation, but then again I'm typically sitting in on a panel interview and can only ask maybe a half dozen questions. So I typically bypass the Programming 101 stuff and zoom in on what I really expect from senior level database developer.

    It's a good topic for a forum discussion, I'm just saying it's not a good interview question within the context of a SQL Server Developer/DBA position.

    In my opinion I think this is a pretty reasonable position to hold, I might not be able to provide the file part of a path in an interview despite having done it in production simply because if I don't routinely use a function, theres a good chance I'm going to have to look up the function definition and parameters. I do realise that this could cost me in interviews though, but if I have to produce code without using language references I might not be a great match for that position so I guess it would work out anyways 🙂

    As a programming language, SQL suffers from the same plight as HTML, there are a lot of people who claim to know how to use it, fewer people have practical experience, and very few can craft SQL at a professional level.

    If hiring someone to write T-SQL code, I want them to know:

    - normalization

    - how to solve problems using set based logic

    - logical joins (inner, outer, cross)

    - how locking, isolation level, and blocking works

    - the difference bertween a covered and non-covered index and why it matters

    It can take years of practical experience to learn that, and when you find someone who understands at that level, then you want to hire them. Beyond that; it's also helpful if the candidate has industry domain knowledge, which again takes years to accumnulate.

    But string manipulation; that's a 2 minute lookup on Google.

    But for anybody who actually writes sql it is so trivial it shouldn't be an issue at all. I tend to side with Jeff on this one. As an early question in an interview it isn't bad at all. In fact, I wouldn't even care really if the result was correct. If they can just rattle off a few string manipulation functions with zero thought then you can immediately tell they have actually done this stuff. If this is somebody writing code I would like to know they are fluent right out of the gate. If they couldn't at least come up with something reasonable I don't care how much they know about the rest of the valid items you listed. As a code writer if you can't handle the 101 or maybe 201 you are not likely going to be a very strong candidate.

    I don't understand, if you don't care if its right, and additionally the applicant can apply zero thought to it and its still acceptable, whats the takeaway for the next time I'm interviewing an applicant? Sounds like you're agreeing with Eric except for when you say you aren't LOL

  • patrickmcginnis59 10839 (6/9/2016)


    I don't understand, if you don't care if its right, and additionally the applicant can apply zero thought to it and its still acceptable, whats the takeaway for the next time I'm interviewing an applicant? Sounds like you're agreeing with Eric except for when you say you aren't LOL

    Because there's so much to evaluate in a piece of code: format, functions used, programming mind-set, creativity, etc.

    When implying that the solution is not correct, I'd expect minor errors such as getting a slash instead of removing it or having parameters inverted in a function or miss a parenthesis. Something that would be debugged if allowed to do it in SSMS instead of paper.

    With so many places showing interview questions and answers about theory, some actual code is eye-opening.

    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
  • Luis Cazares (6/9/2016)


    patrickmcginnis59 10839 (6/9/2016)


    I don't understand, if you don't care if its right, and additionally the applicant can apply zero thought to it and its still acceptable, whats the takeaway for the next time I'm interviewing an applicant? Sounds like you're agreeing with Eric except for when you say you aren't LOL

    Because there's so much to evaluate in a piece of code: format, functions used, programming mind-set, creativity, etc.

    When implying that the solution is not correct, I'd expect minor errors such as getting a slash instead of removing it or having parameters inverted in a function or miss a parenthesis. Something that would be debugged if allowed to do it in SSMS instead of paper.

    With so many places showing interview questions and answers about theory, some actual code is eye-opening.

    Perhaps I didn't speak very clearly. Thankfully Luis is getting where I am coming from.

    If the applicant can sit down and start pounding out string functions that actually make sense (not made up names) but maybe some syntax issues, or reversed parameters as Luis said, this demonstrates a level of comfort. If however, they start with stuff like this:

    select substr(MIN(group_concat(MAX('MyStringValue')))

    Something like the above demonstrates they have zero clue how to even think about this. I realize this isn't even in the ballpark for the question at hand. It is merely demonstrating my point. There are so many things wrong in the above code I would immediately know that I don't care how much knowledge they have about normalization or locking. They don't have even a basic concept of a functional query. I use a lot of rudimentary type things to ferret out the people who can speak a great game and don't actually have any real substance. It also works the other way. I know that I don't usually interview well because I am not great at putting my ideas into words. If you asked me detailed questions about normalization or locking I would probably stumble all over myself. In reality I would hope I can at least hold my own on those topics.

    _______________________________________________________________

    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/9/2016)


    Eric M Russell (6/9/2016)


    patrickmcginnis59 10839 (6/9/2016)


    Eric M Russell (6/7/2016)


    Luis Cazares (6/7/2016)


    Was I too late for April fools' day?

    This is what happens when you trust a forum to answer questions that you should answer on your own.

    I could have given a real answer, but this is an example of the reasons behind my disclaimer. I wouldn't want someone that uses something without at least understanding how it works or at least point to some documentation for it.

    If I was interviewing this person, I wouldn't mind if the answer is incorrect as long as it demonstrates knowledge on string manipulation and creativity to solve problems.

    I personally would put string manipulation using T-SQL in the same category as programming a row-by-row cursor; I don't consider it to a core competency for a T-SQL developer. I'd ask questions about joining, grouping, ranking, indexing, isolation, and execution plans before I would test someone's knowledge about string manipulation, but then again I'm typically sitting in on a panel interview and can only ask maybe a half dozen questions. So I typically bypass the Programming 101 stuff and zoom in on what I really expect from senior level database developer.

    It's a good topic for a forum discussion, I'm just saying it's not a good interview question within the context of a SQL Server Developer/DBA position.

    In my opinion I think this is a pretty reasonable position to hold, I might not be able to provide the file part of a path in an interview despite having done it in production simply because if I don't routinely use a function, theres a good chance I'm going to have to look up the function definition and parameters. I do realise that this could cost me in interviews though, but if I have to produce code without using language references I might not be a great match for that position so I guess it would work out anyways 🙂

    As a programming language, SQL suffers from the same plight as HTML, there are a lot of people who claim to know how to use it, fewer people have practical experience, and very few can craft SQL at a professional level.

    If hiring someone to write T-SQL code, I want them to know:

    - normalization

    - how to solve problems using set based logic

    - logical joins (inner, outer, cross)

    - how locking, isolation level, and blocking works

    - the difference bertween a covered and non-covered index and why it matters

    It can take years of practical experience to learn that, and when you find someone who understands at that level, then you want to hire them. Beyond that; it's also helpful if the candidate has industry domain knowledge, which again takes years to accumnulate.

    But string manipulation; that's a 2 minute lookup on Google.

    But for anybody who actually writes sql it is so trivial it shouldn't be an issue at all. I tend to side with Jeff on this one. As an early question in an interview it isn't bad at all. In fact, I wouldn't even care really if the result was correct. If they can just rattle off a few string manipulation functions with zero thought then you can immediately tell they have actually done this stuff. If this is somebody writing code I would like to know they are fluent right out of the gate. If they couldn't at least come up with something reasonable I don't care how much they know about the rest of the valid items you listed. As a code writer if you can't handle the 101 or maybe 201 you are not likely going to be a very strong candidate.

    It is a trivial question in the sense that it can be easily googled, however, not everyone, even a very experienced T-SQL programmer routinely does string manipulation, so that's why I think it's a poor question for guaging a canididates proficiency with T-SQL.

    Here is an actual T-SQL related question that I sometimes ask at some point near the end of the interview.

    Let's assume we have a table called CustomerContact which contains two columns: CustomerID and ContactDate. I want you to write a SQL select statement that returns one row for each customer who was contacted three or more times within the month of November 2015. The columns returned should be: CustomerID, the total number of times the customer was contacted within that month, and the last contact date for the customer within that month.

    What I expect from the candidate is something equivalent to the following:

    select CustomerID, count(*) as ContactCount, max(ContactDate) as LastContactDate

    from CustomerContact

    where ContactDate >= '2015/11/01'

    and ContactDate < '2015/12/01'

    group by CustomerID

    having count(*) >= 3;

    It tests several different concepts within context, but it's still simple enough that a good developer will immediately understand what is being asked and know the solution. It also resembles the type of SQL problem the candidate would be expected to routinely solve on the job. If the candidate asks, I'll write it out on the white board, but really an experienced developer will know what to do just by lintening closely. If all I get back is crickets chirping, then they've failed. They simply couldn't survice Day 1 on the job, because this is exactly the type of requests that will come from the internal clients. How the candidate solves or responds to this question tells a lot.

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

  • Eric M Russell (6/9/2016)


    ...even a very experienced T-SQL programmer routinely does string manipulation...

    I guess that's the primary difference between what you and I think. We do a ton of ETL and, for the type of data we import, string manipulation is the key to extracting some of the data and validating the rest. Yes, it would be nice if they could send us more normalized data but they don't and the folks on their end apparently don't understand how. I can only imagine what the data in and structure of their tables actually looks like.

    --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)
    Intro to Tally Tables and Functions

  • I think the crux of the questions (whatever they may be) is to not only determine the experience of a candidate, but also to learn how they think. The thought process is how someone approaches solving a problem. IMHO, that's as important as anything.

  • Eric M Russell (6/9/2016)


    Sean Lange (6/9/2016)


    Eric M Russell (6/9/2016)


    patrickmcginnis59 10839 (6/9/2016)


    Eric M Russell (6/7/2016)


    Luis Cazares (6/7/2016)


    Was I too late for April fools' day?

    This is what happens when you trust a forum to answer questions that you should answer on your own.

    I could have given a real answer, but this is an example of the reasons behind my disclaimer. I wouldn't want someone that uses something without at least understanding how it works or at least point to some documentation for it.

    If I was interviewing this person, I wouldn't mind if the answer is incorrect as long as it demonstrates knowledge on string manipulation and creativity to solve problems.

    I personally would put string manipulation using T-SQL in the same category as programming a row-by-row cursor; I don't consider it to a core competency for a T-SQL developer. I'd ask questions about joining, grouping, ranking, indexing, isolation, and execution plans before I would test someone's knowledge about string manipulation, but then again I'm typically sitting in on a panel interview and can only ask maybe a half dozen questions. So I typically bypass the Programming 101 stuff and zoom in on what I really expect from senior level database developer.

    It's a good topic for a forum discussion, I'm just saying it's not a good interview question within the context of a SQL Server Developer/DBA position.

    In my opinion I think this is a pretty reasonable position to hold, I might not be able to provide the file part of a path in an interview despite having done it in production simply because if I don't routinely use a function, theres a good chance I'm going to have to look up the function definition and parameters. I do realise that this could cost me in interviews though, but if I have to produce code without using language references I might not be a great match for that position so I guess it would work out anyways 🙂

    As a programming language, SQL suffers from the same plight as HTML, there are a lot of people who claim to know how to use it, fewer people have practical experience, and very few can craft SQL at a professional level.

    If hiring someone to write T-SQL code, I want them to know:

    - normalization

    - how to solve problems using set based logic

    - logical joins (inner, outer, cross)

    - how locking, isolation level, and blocking works

    - the difference bertween a covered and non-covered index and why it matters

    It can take years of practical experience to learn that, and when you find someone who understands at that level, then you want to hire them. Beyond that; it's also helpful if the candidate has industry domain knowledge, which again takes years to accumnulate.

    But string manipulation; that's a 2 minute lookup on Google.

    But for anybody who actually writes sql it is so trivial it shouldn't be an issue at all. I tend to side with Jeff on this one. As an early question in an interview it isn't bad at all. In fact, I wouldn't even care really if the result was correct. If they can just rattle off a few string manipulation functions with zero thought then you can immediately tell they have actually done this stuff. If this is somebody writing code I would like to know they are fluent right out of the gate. If they couldn't at least come up with something reasonable I don't care how much they know about the rest of the valid items you listed. As a code writer if you can't handle the 101 or maybe 201 you are not likely going to be a very strong candidate.

    It is a trivial question in the sense that it can be easily googled, however, not everyone, even a very experienced T-SQL programmer routinely does string manipulation, so that's why I think it's a poor question for guaging a canididates proficiency with T-SQL.

    Here is an actual T-SQL related question that I sometimes ask at some point near the end of the interview.

    Let's assume we have a table called CustomerContact which contains two columns: CustomerID and ContactDate. I want you to write a SQL select statement that returns one row for each customer who was contacted three or more times within the month of November 2015. The columns returned should be: CustomerID, the total number of times the customer was contacted within that month, and the last contact date for the customer within that month.

    What I expect from the candidate is something equivalent to the following:

    select CustomerID, count(*) as ContactCount, max(ContactDate) as LastContactDate

    from CustomerContact

    where ContactDate >= '2015/11/01'

    and ContactDate < '2015/12/01'

    group by CustomerID

    having count(*) >= 3;

    It tests several different concepts within context, but it's still simple enough that a good developer will immediately understand what is being asked and know the solution. It also resembles the type of SQL problem the candidate would be expected to routinely solve on the job. If the candidate asks, I'll write it out on the white board, but really an experienced developer will know what to do just by lintening closely. If all I get back is crickets chirping, then they've failed. They simply couldn't survice Day 1 on the job, because this is exactly the type of requests that will come from the internal clients. How the candidate solves or responds to this question tells a lot.

    Well on the same line of trying to determine if this is a good question or not, maybe not everybody does queries with aggregation either. The argument against string manipulation just doesn't hold up to scrutiny. As with any element of sql server, or even just t-sql, there is the possibility that somebody really experienced doesn't have any experience in some area. I would never use only a single question anyway, that would be silly. I would honestly be shocked if there was somebody who as you say is really experienced and maybe doesn't do a lot of string manipulation couldn't solve such a simple question.

    Your argument about it not being a good question because it is so simple doesn't work for me either. As Jeff has mentioned and I have recently witnessed something as trivial as getting the current system time eludes many people. Talk about easy to google. But their inability to produce an answer is a pretty good indication they don't have much depth. Same with strings. Anybody who has been around t-sql or development in general for any length of time has had to wrestle with strings at some point. It isn't a bad litmus test in that if they can't come up with something it might be a good indicator they are not very experienced.

    _______________________________________________________________

    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/

Viewing 15 posts - 31 through 45 (of 111 total)

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