Awards


Top 10 Interview Questions to Ask Senior DBAs

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!

More Articles on Interview Questions

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

25 comments to Top 10 Interview Questions to Ask Senior DBAs

  • Well Done once again. You'd be amazed how many interviewees I tripped up with some simple questions about backing up the tail of the log and not detaching suspect databases. These 10 are great!

  • [...] Top 10 Interview Questions to Ask Senior DBAs Brent Ozar poses some great questions to ask DBAs (and that you might be asked as a DBA) during an interview. These are the good kind of interview questions, not the “how would you do XYZ” kind of questions. (My default response to the XYZ questions is often “Check Books Online”.) [...]

  • [...] Top 10 Questions to Ask Senior DBA job candidates | Brent Ozar – SQL Server DBA Good list of interview questions. (tags: interview database sql job career work dba) [...]

  • Great read Brent! Dunno if I'll qualify but the thought stimulation was great.

  • [...] Brent Ozar lists the Top 10 Interview Questions to Ask Senior DBAs. [...]

  • Scott Swank

    I really want to make sure that a senior DBA understands how the db works under the hood. Do they understand a statement's plan? What's a nested-loop join, what's a hash-join? When would you expect the optimizer to use an index and when would you not? How does skewed data prevent a single "best" statement plan? Are they familiar with query factoring ("with") and window functions ("over" "partition by" "order by")? How is MVCC implemented and what does it mean for read-consistent isolation?

    • I think that depends on the type of work the DBA is doing. I've worked with very senior production DBAs who wouldn't know the answer to anything related to MVCC because they live in server troubleshooting mode all day – building clusters, setting up log shipping, etc. I've worked with senior development DBAs who wouldn't know the first thing about SAN array setup for clusters, but they could talk MVCC all day long. There's a few different flavors of "senior DBA" (data warehousing, production, development, etc), and that determines the technical questions you ask.

      I based my question list here not on in-depth technical questions (because it varies so dramatically on the job function) but on things I want every DBA to be at least peripherally aware of.

  • Shiva

    Very Good questions. I was never asked on the questions on the FizzBuzz problem, So I decided to do it myself to evaluate my skills:

    Below is the SQL code, I was able to get the output of the FizzBuzz problem :

    declare @var as int ;
    declare @num as char(10) ;

    set @var = 1 ;

    while @var <101
    begin

    set @num =
    case
    when @var%3 = 0 and @var%5 = 0 then 'FizzBuzz'
    when @var%3 = 0 then 'Fizz'
    when @var%5 = 0 then 'Buzz'
    else cast(@var as char(10))
    end
    Print @num ;
    set @var = @var+1 ;
    end

  • Re: fizzbuzz: I came up with the following single statement. Interestingly, the statement is not good for a list that's much bigger than 100 because of CTEs built-in recursion limit of 100.

    with tmp(id) as
    (
    select 1 id
    union all
    select id + 1 from tmp where id <= 99
    )
    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(100))
    end
    from tmp

  • [...] you someone who has to hire a senior DBA? Brent Ozar has a list of 10 questions you can ask in the interview process. Good questions, [...]

  • 
    set nocount on
    
    declare @start datetime, @end datetime
    
    select @start = GetDate()
    
    select top 11000 identity(int,1,1) N
    into #tally
    from sys.all_columns sc1, sys.all_columns sc2
    
    create unique clustered index ixn on #tally(n)
    select  case N%5 + N%3
            when 0 then 'BizzBuzz'
                else case N%5
                when 0 then 'Bizz'
                        else case N%3
                       when 0 then 'Buzz'
                        else cast(N as varchar(10))
                        end
                end
    end
    from #tally t1  --tally is a table of one (int) column, containing numbers 1 - 11,000
    
    where N < 10001
    
    select @end = GetDate()
    
    select datediff(ms, @start, @end) as SetTheoryLoopTime
    
    select @start = GetDate()
    
    declare @i int
    set @i = 1
    
    while( @i < 10001)
    begin       
    
            if @i%3 = 0 and @i%5 = 0 print 'BizzBuzz'
            else if @i%5 = 0 print 'Buzz'
            else if @i%3 = 0 print 'Bizz'
            else print @i
    
            set @i = @i+1
    end
    
    select @end = GetDate()
    
    select datediff(ms, @start, @end) as whileLoopTime
    
  • I always ask DBA to write a sales report proc on the whiteboard with typical date time formatting in parameters and name concatenation with grouping issues. That may seem like a dev question, but I want DBA to be able to write a proc and talk about all the performance issues that come up based on this example. Indexes, clustering, filegroups, etc. It is amazing how deep you can go with a simple proc that a dev would care less about, but a DBA would.

  • AngryDBA

    Interesting. I’ve been on both sides of the interview chair and only some of your list is also on my list.

    Man, I don’t mean to sound harsh but..you’re an expert DBA? I’m guessing you wouldn’t survive one of my interviews. I only expect the candidates to get 50%. I’ve had them all too. PhDs, Masters in blah-blah-blah, Captain of the Patterns Team at Yale majoring in C#, writing joins since she was in Pampers. Uh huh.

    My goal isn’t to knock any candidate out, but if you show up at my door looking for a job and talkin’ tough about ‘how long it is’ you better be able to back that up because this is gym class and it’s time for a shower…

    All kidding aside–asking who I know will get you nothing. Why would I share my contact list with the likes of you? If you’re nice you might get to know some of my crew but only after I get to know you.

    Please note that I actually like your style in a lot of ways. Hell it’d probably be fun to have a beer.

  • AngryDBA – great question! I’ll answer it in tomorrow’s blog post (will be visible around 9am EST):

    http://www.brentozar.com/archive/2009/07/what-i-want-versus-what-i-can-afford/

  • John M

    Great questions Brent. I especially love question #6.

  • susan

    I accidently wen to this website. I am a programmer developer and there is a DBA opening at my work. I want to prepare on some common dba questions. do yuo have any?

  • PeteJin

    Thank you Brent. I’m preparing for a DBA interview. Hopefully, your questions will pop up.

    declare @num int
    , @fizz char(4)
    , @buzz char(4)

    set @num = 1
    set @fizz = ‘Fizz’
    set @buzz = ‘Buzz’

    while @num <= 100
    begin
    if (@num % 3 =0)
    begin
    if (@num % 5 = 0)
    begin
    print @fizz + @buzz
    end
    print @fizz
    end
    else if (@num % 5 = 0)
    begin
    print @buzz
    end
    else
    begin
    print @num
    end
    set @num = @num + 1
    end

  • Igor

    I wonder why do you wanna be a psycologist? Your questions and answer approach sometimes looks quite personal to me. Sort of: play by my rules or don’t play at all. You have good information here. Some times I think there is to much “you”, one has to filter out. For example, question 7 A project manager needs a new SQL Server. What do you ask her?… I think you have a particular scenario in mind you are not revealing. I would ask her, why does she need a new database. This would lead to the questions you are suggesting. Also this would partialy answer them, as she is the project manager and you are the DBA.

  • [...] technical interviews are effective, valuable or worthwhile. Brent Ozar in an article called Top 10 Interview Questions to Ask Senior DBAs mentions (as #2): Anything to put them under stress … This is your one chance to see how [...]

  • MDBA48

    I read you Top 10 Interview Questions to Ask Senior DBAs I want to know do you have the answer to these question so I can learn from this experince

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">