T-SQL Tuesday 174 - Your Favorite Job Interview Questions
T-SQL Tuesday is a monthly blog party hosted by a different community member each month. This month, Kevin Feasel (blog | twitter) asks us about job interview questions.
What is your favorite job interview question? There’s a lot of latitude in how you answer this, and as a spoiler, that’s the type of question I like a lot.
Kevin wrote quite a lengthy post in response to his own prompt, and you should go check it out when you’re done here.
As the Interviewer
When I’m interviewing candidates for a DBA or Database Developer role, I always ask this open-ended question:
I see from your resume that you’ve worked with SQL Server versions M through N. Over that span, what new feature or change to the platform have you really liked or disliked?
I’m not looking for anything specific here. I just want to know if you’re keeping up with changes in SQL Server over the years and exploring the newer features. T-SQL language features (like new functions), performance features/changes (Query Store, Intelligent Query Processing, scalar UDF inlining, etc.), or platform features (PolyBase, invoking external REST endpoints) - I’m not picky. Talk to me about the new stuff you’ve seen and what you’ve done with it or your difficulties integrating it with existing code.
If your answer is “oh, I was able to clean up so much ugly code when we got STRING_SPLIT()
in 2016, and then even more with STRING_AGG()
in 2017, and my queries ran so much faster too!”, we’re going to be BFFs. Or maybe you installed SQL Server 2022 on your laptop to play with sp_invoke_external_endpoint
and your takeaway was “I see what they’re doing here, but I don’t have a need for it myself” - that’s OK too! You don’t have to use or even like a new feature; knowing what tasks a particular tool isn’t appropriate for is just as valuable as - maybe even more valuable than - trying to force it into someplace it shouldn’t go.
Being an open-ended question, you might think that there’s no “wrong” answer. But there kind of is. If a candidate’s experience has spanned more than 2-3 versions and they cannot name any new feature, that’s not a great look. If you’re still writing T-SQL for SQL Server 2022 the exact same way you did for 2008R2. You aren’t looking at what’s new out there, and it looks like you aren’t interested in developing your skillset - you’ve stagnated.
As the Interviewee
Like Kevin mentioned in his post (with the idea borrowed from Brent Ozar), I like the “let’s do a code review” question. Sometimes it’s very easy to overlook something basic like “wait…this table doesn’t have a primary key, does it?” and I have to catch myself before I go too far into the weeds. But I’ll walk through the code, top to bottom, pointing out things that seem “off” to me and making a note of anything I should come back to after I’ve been through the rest of the code. Sometimes, a bit of code that seems funky at the beginning makes sense by the end. I try to talk through my thought process as much as possible here.
But this question has an added benefit to me as a candidate. Often, the code I’m asked to review will be pulled right from the company’s source repository, or look very similar to production code they have running. This gives me some insight into the code I might be working with. In one interview, I skimmed the code, looked up and said “you’ve managed to hit every one of my pet peeves in one stored procedure. Well done!” I got the job and before the end of my first week, I turned to my new colleague and said “oh, that wasn’t some contrived example you gave me in the interview, was it?”
Everyone Else!
I’m looking forward to the other responses to this month’s T-SQL Tuesday and getting new ideas for questions to ask the next time I’m interviewing candidates!