Tag Archive: questions

SQL Server Interview Questions and Answers – Book Review

I read a lot of technical books – stuff on SQL Server, VMware, storage – and they all start to blend together.  Within the first few pages of reading SQL Server Interview Questions and Answers by Pinal Dave and Vinod Kumar, though, it jumped out and grabbed me because it’s really different.

Just kidding. When I'm talking to a recruiter, I read The Art of War

This is gonna be the year I get a better job, I swear. I'm outta this hole.

When buying this book, you need to appreciate it for what it is: a series of questions and answers.  No more, no less.

There’s almost no code, no syntax – and believe it or not, that’s refreshing.  It’s just plain English dialog.  That’s not to say the book is shallow, either, because it touches on topics that all of us could stand a refresher on.  This book works really well for its purpose in much the same way that Applied Architecture Patterns works; it doesn’t teach you as much as it just exposes you to subjects.  From there, it’s up to you to follow the trail if you’re interested in the topic, and that’s where Pinal and Vinod break new ground.

Check out this quote from page 50:

“What is a filtered index?  A filtered index is used to index a portion of the rows in a table.  This means it applies a filter on an INDEX which improves query performance, reduces index maintenance costs, and reduces index storage costs when compared with full-table indices.  When we see an index created with a WHERE clause, then that is actually a Filtered Index.  (Read more here http://bit.ly/sqlinterview27)”

The “read more here” part is actually in the book, and it links to one of Pinal’s intro posts about filtered indexes.  Just like all of Pinal’s posts, it includes clear, easy-to-follow script examples and screenshots.  Having said that, if you don’t like Pinal’s blog, you’re probably not going to like the book either.  The book has less technical details than the blog, and there are grammatical/editing issues.  That kind of thing doesn’t bother me as much with this book because of its intended market – it’s just a series of questions and answers.

Will The Answers Help or Hurt the Interview Process?

In my DBA interview questions and SQL developer interview questions blog posts, I went out of my way not to include the answers.  I wanted to give managers some starting points for questions that they could use to filter out candidates, but I didn’t want to give unqualified candidates a leg up in the interview process.  Those blog posts are consistently popular in Google searches, but based on the search terms being used, I know the candidates are looking for ways to cheat the interview process.  Therefore, my first concern going into this book was, “Are unqualified candidates going to sneak into jobs by reading this book?”

I don’t think that’s going to be a problem because the book is more of a refresher than a cheat sheet.  As I read the questions, I found myself nodding and saying, “Yep, that’s a great way to answer that question, but if somebody doesn’t understand the underlying concepts, they’re still going to fail the interview as soon as somebody drills down.”  An interviewer can see past the fakers just by asking, “And how have you used that concept in your work?”  The book also doesn’t stand alone as a complete interview process: managers still need to ask candidates to whiteboard concepts or reverse engineer a stored procedure to see what it’s doing.  Frankly, if somebody walked into an interview with this book memorized start to finish, and they didn’t have any other skills whatsoever, they’d still be more qualified than a lot of candidates I’ve interviewed.

My second concern about the book was that an incorrect or poorly-worded answer might cause a good candidate to miss out on a job.  If a non-SQL-savvy manager asked questions verbatim out of this book and expected verbatim answers, the book could lead to problems.  Some of the book’s answers are open to interpretation – for example, on page 41, the book asks, “What is OLTP?”  The book’s answer doesn’t match with what I would give, nor with Wikipedia’s definition.  Some of the answers are more clear-cut, though, like when page 54 says there’s a limit of 256 tables per query, and that’s wrong.  I’d recommend keeping the book’s online errata handy.

I get really nervous about the thought of a manager relying on this book’s answers as their only gauge of a candidate’s knowledge.  However, I’ve been through interviews like that myself – having a disagreement with a manager about the answer to a particular topic – and that’s a place that should be inside every DBA’s comfort zone.  We work with developers, project managers, and end users who have all kinds of incorrect assumptions about technology, and they’ve got books or blog posts to back up those assumptions.  We have to be able to back up our own answers, and sometimes that means saying to a manager, “We both believe we’re right – can you pop open a search engine and let’s check the latest documentation on SQL Server from Microsoft itself?”

Is This Book Just for Job Candidates?

I also bet that any of my readers will learn at least one thing reading this book, and it’ll drive you to go dive deeper into a particular topic.  I’d already learned something by page 34 when the book covers the order of the logical query processing phases: FROM, ON, OUTER, WHERE, GROUP BY, CUBE | ROLLUP, HAVING, SELECT, DISTINCT, ORDER BY, TOP.  I read that and a little light went on above my head – I’ve seen this kind of thing before, but I hadn’t thought about it in years, and it inspired me to go hit Google and learn more about the phases again.

The funny part about this book is that I like all of the questions, most of the answers for accuracy, and the rest for provoking thought.  I know that wasn’t the original intent, and it’s a hilarious thing for me to write in a book review, but there it is.

This book is a good starting point for MCITP test-takers, too.  The questions give you an idea of your qualifications because when an answer doesn’t feel natural to you, you can go drill down into the web to learn more about the topic.  If a topic feels like a no-brainer to you, then you probably shouldn’t waste time studying MCITP information about that topic either.

You can buy SQL Server Interview Questions and Answers for about $10 at Amazon, and Amazon Prime members with Kindles can read the Kindle version for free.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

Website - Twitter - Facebook - More Posts

Top 10 SQL Server DBA Interview Questions

I’ve put together my best questions to ask during an interview when I’m hiring a senior database administrator for Microsoft SQL Server or Oracle.  I don’t expect any DBA to ace all of these – I’m not looking for easy questions, but rather for the top ten questions, tough challenges to let the really good DBAs shine during the job interview.

10. Solve the FizzBuzz problem with SQL code.

Here’s a quote of the FizzBuzz problem:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Challenge the DBA to do this on a whiteboard with pseudocode.  The code doesn’t have to be perfect syntax, but we’re looking for the ability to solve this problem clearly and quickly.  I’d ask this of any type of DBA, production or development.

There’s countless ways to do this, but I’m almost not as concerned with their technical accuracy as I am with the way they approach the problem itself. Do they get excited? Do they scribble out a few different ideas? Are they stunned at the thought of having to actually write T-SQL? Do they make excuses?

9. I’m a manager, and you’re my Senior DBA. Explain to me why we shouldn’t switch to MySQL or Oracle.

A senior DBA should have a basic grasp of the advantages and disadvantages of the major database platforms.  They’ve probably answered this question before, too – if not from a manager, then from a developer who’s whining because they think Platform X is better than Platform Y.

I also want to see senior DBAs that can clearly explain a very political concept without taking it personally.  My ideal DBA knows when his platform isn’t the right fit, and has no problem suggesting other ideas.

8. I’m a developer. Explain why I need a unique key on my table.

And really pretend that you’re a developer.  If you’re a DBA manager, bring in one of your toughest developers to play bad cop.  Challenge them – does it really improve performance or manageability?  How do you know?  Is it just your opinion, or where’s the proof?

If they can explain it in clear, easy-to-comprehend terms, that bodes well for their ability to communicate with other teams.  Speaking of inter-team communication…

7. A project manager needs a new SQL Server. What do you ask her?

Use a brochure from any third party application (like Microsoft Project Server or Blackberry Enterprise Server) and say the project manager wants to set this up.  I want the DBA to ask questions like:

  • How big will the database be?  (Leading to questions about whether we can add the database to an existing server)
  • How critical is the database?  (Leading to questions about clustering, disaster recovery, high availability)
  • What’s the company standard on virtualization?  (Can we save money by using a virtual server)

If the senior DBA candidate comes back with a shocked look and doesn’t know where to begin, then they haven’t done a lot of deployments.  That might be fine if your shop rarely does new deployments, or if you’re hiring a development DBA, but they still should have some basic knowledge about sizing.

6. When and where does the local user group meet?

I’m not asking if they regularly attend, I’m not asking if they speak, I’m not asking if they run for office.  At the senior DBA level, I’d just be thankful if they were at least vaguely aware that user groups existed.  Huge massive bonus points if they’ve been involved with the community, and I’d skip the next question.

5. Can you give me references from other DBAs and developers who aren’t at your company?

I want to know that they’ve got at least a couple of people they can call when the going gets rough and the servers catch fire.  These other references could be mentors, or could be people they’ve mentored or just worked with along the way.

I expect to get terrified looks, and I’d answer those by saying, “I don’t want to raise any red flags by calling people at your current employer, and I’m sure you know people who’ve left your company and moved on.  I just want to talk to people who’ve worked with you on projects or on problems.  I won’t ask for your level of technical competency, because these other guys can’t judge that.  I just want to know you’ve interacted with them.”

I know, it’s creepy, but here’s the problem: there’s a lot of fakers out there with all the right answers, but no actual experience.  At the senior level, for somebody with five or more years of experience, they have to have met other people who can at least verify they’re database administrators.

4. How do you learn new things?

When new versions of database servers come out, how do you prefer to learn how to use ‘em?

Ideally, I want to hear a DBA say they build their own server under the desk when the beta comes out, and start hammering it and getting their arms around it long before it gets released.  Not everybody has that much time, though – they might be stretched to the breaking point at their current job, with barely enough time to get their work done, let alone train on new versions.  In that case, I like to level-set them by saying, “You’re coming to work here because we’re not that kind of shop.  I want you to keep your knowledge current.  How much time per month do you need to keep current, and how would you do it?”

Some DBAs learn best by going to offsite training classes, and can’t budget their time well enough or maintain a train of thought to learn inside the office.  As a manager, you want to know that before you hire the person, so you can build that training budget into their salary.  (You don’t want unqualified employees, do you? Yeah, you probably do – I’ve worked for you, ha ha ho ho.)

3. What third party database tools are your favorites?

If somebody’s been doing database administration long enough to claim the title Senior DBA, they’ve built up a little wish list of database management tools they’ve seen along the way. Tool types might include:

  • Data modeling
  • Change management
  • Backup compression
  • Performance monitoring
  • Alerting

If they had a $X tool budget for their workstation, how would they spend it?  Forget corporate standards – I want to know what tools they’d use if they could pick on their own.  I’m not asking what software they’ve had experience using, because they might work somewhere so cheap that they’re restricted to native tools only.  They have to have at least seen some ads for products that looked cool, though.

I might follow up with questions about tools we were using in-house already by saying things like, “We’re currently using Product X for monitoring.  Have you seen it?  What’d you think of it?”

This does two things: it gives me an outside opinion about other tools out there that my DBAs could be using to do a better job, and it tells me how much the job candidate has seen.

2. Ask stressful questions.

In one of the earlier questions, you probably found an area of weakness for the DBA’s knowledge – heck, nobody’s perfect.  Go after that weakness.  Challenge it, make them uncomfortable, and really push their buttons.

This is your one chance to see how they handle stress before the brown stuff actually hits the fan.  Ideally, a senior DBA is someone who’s had their cage rattled more than once, and they’re comfortable under the gun.

No, don’t use an actual gun during the interview – but that reminds me of a plastic slot machine I used to keep on my desk at the office.  When you pulled the lever, it shot water straight at you like a squirt gun.  Always fun to see how somebody handled that one, but I wouldn’t let job candidates pull the lever.  That’s a little overboard!

1. Why are you here?

Zoom out to the big picture.  Tell me why you’re in this chair right now.

Is this some sort of career plan? Have they heard good things about the environment from another employee? Are they looking for an employee discount on products?  (It doesn’t work at wine & spirits companies, just for the record.)  Or are they just desperate?  Nothing wrong with desperation, but remember that desperate employees are desperate for something, and you’d better find out what it is.  If they’re desperate for money, it’s going to color the judgements they make.  I’m not worried about someone stealing data and selling it as much as I’m worried about someone taking the job and then bailing out shortly thereafter for just a little more money from somebody else.

Top DBA Interview Questions That You Don’t See Here

I’ve seen DBA managers asking questions about tough challenges that had come up recently in the shop, such as, “Pretend you have horrible TempDB contention, really seriously bad load, and you have to fix it.  What do you do?”  The candidate would then name off all kinds of answers while the DBA manager sat back and said, “Nope.  Didn’t work.  Tried that too.  Nope.”  The DBA manager feels more and more smug while the candidate feels more and more frustrated, and the end result is a DBA manager that thinks the candidate isn’t good enough for the job.

The problem with that scenario is that the DBA manager expects the candidate to be able to answer a question that had already stumped their own staff.  I always want to grab that manager and say, “Look, if I was interviewing YOU with this question, you’d have failed, because you couldn’t figure it out in sixty seconds either!”

If you’re going to ask a candidate a technical question, my rule of thumb is that it should take your existing staff the same length of time to answer the question.  If a technical challenge took your staff three days to figure out, then you should expect the job candidate to take that same length of time to answer the question!

Want help interviewing your DBA candidates?  Check out our services.

Brent Ozar PLF Team

Brent Ozar PLF is a boutique consulting firm focused on understanding your environment and strategy. We partner with you to objectively identify pain points and develop solutions that align to your business goals. Your experience comes first; we share our knowledge and expertise to help you.

Twitter - Facebook - More Posts

Top 10 Questions To Ask During an Interview

Stop!  Before you accept that cushy job, make sure it’s actually as cushy as you think it is.  Managers have a long line of questions to ask in an interview, but what about you as a candidate?  What questions should you ask?

Here’s my top ten questions to ask before taking an IT job:

10. What happened to the last person in this position?

Did they quit, did they get promoted, did they die of a stress-induced heart attack, what?  Rarely is a position created completely from scratch, and you want to know why the last person left so you can avoid their fate.  If they’d been around for less than a year, I would ask the same question about their predecessor as well.

9. Have you had any layoffs in the last year?

Nobody’s going to tell you if layoffs are scheduled for the future, but you can at least ask about the past.  Maybe they did a round of layoffs and they’re perfectly positioned for future growth, but maybe they’re spiraling down the toilet.

8. What’s the on-call rotation schedule?

Will you be sharing the pager with someone, on call one week per month, or on call at all times?  If you’re on call, do you get a company laptop and wireless aircard to be able to respond, or do you have to hoof it to the nearest desktop, or heaven forbid, the office?  And to follow that up…

7. In the last year, how many times has the on-call person been called?

From 1997 until 2008, I was on call 24/7 – but I got maybe one call per month.  That kind of load is do-able, but if the on-call phone is ringing every other night at midnight, forget it.  Or at least budget psychiatry bills in with your expenses.  Speaking of expenses…

6. Is there a training or travel budget for this position?

In your struggle up the career chain, you’ll reach a point where suddenly you’re expected to do a little learning on the company dime in order to keep your skills sharp.  It never hurts to ask.  If the answer is no, ask if you would be paid your salary while attending an industry conference like the week-long PASS Summit on your own dime.  I know employees who have to take vacation time to attend these conferences, and that really hurts.

5. Can I access online tools to do my job?

More and more companies are barring employees from surfing the web.  This isn’t just a quality-of-life issue – although allowing Twitter would be nice – but it can also make life tougher when troubleshooting an IT problem.  The best help is on the web, not in Books Online.

4. Can I schedule vacations around the holidays?

I’ve worked in IT shops where everybody wanted to take vacation around Christmas week or New Year’s, but the low guys on the totem pole weren’t allowed to do it.  Seniority dictated the vacation schedule, so the old pros got the holidays off while the new kids on the block got shafted.  It shouldn’t dissuade me from taking a job, but it’s something to think about.

3. How important is my work to the company?

I’ve worked in shops where my database platform was the black sheep of the family, the platform of last resort.  I’ve worked in shops where it was seen as highly visible and mission critical.  The more valued this position is, the more you’ll be seen as an asset to the company – and less likely to be looked over at raise time, or worse, laid off.

2. What’s the telecommuting policy?

Database administration lends itself really well to working from home.  Denny Cherry and I sit around our houses most of the time, while some folks are cursed with driving in to the software factory every day.  Telecommuting cuts your expenses, increases your productivity, and raises your quality of living.  Some companies get it, and some don’t – but ask before you start.  This is one of those policies that probably isn’t going to change after you take the offer.

1. What does “success” look like for this position?

Here’s how I like to phrase this to my future manager: “90 days after I start, if you’re talking to your boss about what a great job I’ve done in my first 90 days, what kinds of things are you raving about?  What are the tasks that you wish this new employee could accomplish?  What would make you the proudest?”

The answer to this isn’t written in the job description.  We’re talking about things that will make your manager jump up and down with excitement, things that will make you a seriously valuable employee, and things that you want to put first on your task list when you start.

And a Bonus Question: Will I have to sign any non-compete agreements?

In IT, the answer to this is often yes, and they can be pretty restrictive – especially at consulting companies.  It’s not uncommon to sign away your rights to work for any competitors or any clients for years after you leave the company.  In a tight market or in a small town, that can pretty much eliminate your job options.  Better to find out ahead of time rather than after you’ve already accepted the offer, quit your old company, and started filling out your new hire paperwork on your first day at the new job.

More Articles on Interview Questions

If you liked this, here’s a few more of my posts about interview questions for job candidates:

Brent Ozar PLF Team

Brent Ozar PLF is a boutique consulting firm focused on understanding your environment and strategy. We partner with you to objectively identify pain points and develop solutions that align to your business goals. Your experience comes first; we share our knowledge and expertise to help you.

Twitter - Facebook - More Posts