I just phone interviewed with a company for a graduate software developer position and was asked the following questions. I should add that the company concerned are not a database vendor.

  1. How does a query optimiser work?

  2. If a database was performing badly how would you use the performance logs to find out the problem.

I have asked whether they ask such questions of all candidate software developers (graduate or experienced) in a first phone interview. They replied that they like to test their candidates knowledge of database development.

I want to write to the company to say that these questions are unreasonable to ask at a software developer interview and to request that my interview be done over.

I would like to check the reasonableness of the following assumptions

a) Those questions cannot be fairly classified as database development questions.
b) I think the questions are appropriate for a DBA interview but wholly unreasonable for a software developer interview (experienced or not).
c) The first question is only relevant to a database vendor.
d) The second question is not fair because software developers typically don't deal with database performance logs as that is the job of the DBA.

Perhaps some of you will be kind enough to comment on my assumptions or may have any other suggestions, before I write to the company.

  • 23
    I'd rather prefer to hire a developer that can answer those questions fairly, than one that can't. But I'm not going to decide only based on that. Commented Feb 7, 2011 at 20:31
  • 14
    We had an interviewee once so unhappy with his interview that he invoiced us for an hour of consulting time. We had already passed on him, but we're glad he followed up to reinforce our decision. :-)
    – payne
    Commented Feb 7, 2011 at 20:43
  • 18
    delete from candidate_list where username="user607018"; Commented Feb 8, 2011 at 0:20
  • 44
    @user607018 I think one of your problems here is your assumption that a job interview should be "fair", like a test in school. That's not correct; A job interview is just a check to see if they want to hire you. If they didn't mention database optimisation/performance at all in the ad, then that's a different story, they've let you waste time applying for a job you can't do, but otherwise fairness doesn't come into it at all. It's a common misconception when going from the artificial world of school to the real world of actually getting things done.
    – MGOwen
    Commented Feb 8, 2011 at 1:32
  • 16
    If you ever have to write SQL queries you must know the answers to that questions. Otherwise you'll end up writing crappy queries, and someone else will have to clean them up after you. So, questions are fair and justified.
    – SK-logic
    Commented Feb 8, 2011 at 12:33

22 Answers 22


If I were an interviewer (which I sometimes am) and received a letter from a candidate complaining that the questions were unfair and they wanted a do-over, I'd thank my lucky stars that we dodged that bullet and immediately move the application to the "reject" pile. Acting like this only shows you to be a complainer, and not having the "can do" attitude that one looks for.

a. the questions were reasonable to ask for the topic of database development.
b. false. Anything to do with software development is fair game to be asked. Keep in mind that getting a wrong answer does not automatically disqualify you for the position (or other positions in the company); it may just help to classify you as someone who wouldn't be the best fit for a database-oriented job.
c. false.
d. false. First of all, there may be no dedicated DBA; second, a software developer must be aware of a broad range of issues which could affect performance (and accuracy), and have at least a high-level understanding of database management.

Take this as a lesson that there are things that you don't yet know. Now you know what to study for next time.

  • 31
    +1 for "now you know what to study." The LAST thing an employer wants is a staff that has their "not my job" speech perfected.
    – Dave
    Commented Feb 7, 2011 at 20:42
  • 7
    +1 - would upvote +100 if only I could... way too many "developers" these days know squat about databases and how they work - yet they use them all the time...
    – marc_s
    Commented Feb 7, 2011 at 21:47
  • +1 You should expect ANYTHING during an interview. It's their game, their interview and their company
    – Mike the Monkey
    Commented Feb 7, 2011 at 21:48
  • I'd give more upvotes if I could too, you said what I wanted to say only more tactfully. I will also point out that questions you may not be expected to know the answer for are sometimes asked to see how you respond under pressure. But I found nothing odd about these questions at all if database development is a significant part of the job.
    – HLGEM
    Commented Feb 7, 2011 at 22:22
  • 5
    Additionally I would say that "How does a query optimiser work?" doesn't necessarily mean that they want you to be able to build a query optimiser from scratch. It may mean they want to check your understanding of at what point the optimiser runs, when dealing with stored procs, adhoc SQL queries, etc. This is absolutely relevant knowledge for a developer that writes code that hits a database. Commented Feb 8, 2011 at 1:02

I think it is a fair question (and it sounds like one that Google probably asks). :) The point of the question appears NOT to truly test your detailed knowledge of database queries and such, but more to watch how you would approach and solve a problem. The ability to do a task you've already done before is necessary, but the ability to think on your feet and approach a new problem is a vital skill.

When presented with a question like that, if I'm lacking in the specific knowledge of the given database, I think a fair response would begin, "Well, I don't have a lot of experience with that technology in specific, but in general I would look through the performance logs to find operations that are performed most frequently and attempt to rank them by processing time. That way I could gauge which operations are the most expensive and might be good candidates for optimization."

You don't need any specific technical knowledge for the answer above but it shows your interviewer that you are ready to solve a new problem.

  • 4
    Alternately, it may be that the company does prefer developers with some knowledge of query optimization. My wife isn't a DBA, but she's done a lot of good work optimizing queries. The DBAs are too busy to optimize all the queries that could use it. Commented Feb 7, 2011 at 22:12

If fair or not fair isn't the question, they hire so they make the rules and are allowed to ask whatever they want (ok not everything, but almost everything ;))

And if you still want the job I don't think you'll do yourself a favour if you write them.

  • Technically they can ask you anything, it's up to you to answer or not (and if they ask you something completely foolish, you don't want that job anyway).
    – o0'.
    Commented Feb 8, 2011 at 16:23

A very common strategy in job interviews is to ask a question that is beyond the level of the position being interviewed for and seeing how a candidate muddles through. With the questions asked you could be reasonably expected to answer something like:

Well, my knowledge of databases is rudimentary but I think it goes something like this...

Or even:

Sorry that's well outside my expertise, I'd need to check on the details of performance logs with a DBA

In general I would expect entry level candidates to have at least a basic understanding of how databases work and to also have a "I don't know but I'll try and learn" attitude.

If you had made an honest attempt and they ended the phone call immediately then you would have real reason to feel hard done by, but as it is I'd say you should learn how to appear confident while admitting you don't know things.


I know interviewers who don't consider an interview complete unless they can find some semi-relavant technical question(s) that the candidate can't answer. The goal is to see how the candidate deals with that type of question.

Admitting that they don't know? Good. Making up spin/BS for an answer? The door.


IMO, Software developer and DBA roles are not well categorized in many companies. You generally need to know atleast some parts of Databases as well if you are a software developer. So, questions seem fair to me, provided they are not asked for a fresher.


I think this is fair. I don't work at a database vendor but knowing how to read query plans (and performance logs, to a lesser extent) is VERY important. Knowing how the query optimizer works is also good to know.

In response to your bullets:

a) Huh? Sure they're related to database development and if you are writing code and your program needs to query for data, then it's relevant.

b) Not really. A DBA had better know the answers but a good developer should know an answer too. I wouldn't expect as highly detailed an answer as from a DBA but I'd expect something. And if a developer doesn't know, I just might accept as an asnwer "I'd ask the DBA to teach me" if the dev was still relatively new to database work.

c) No it's not. It's relevant to anyone that is concerned about the performance of their database queries. If you don't care about how fast your queries run, then you can ignore this. Your clients, who have increasingly worse performance on their websites, on the other hand, may disagree.

d) Maybe. Not all developers see the performance logs, but if there's a problem you can expect a DBA to email you the relevant parts and explain the problem if you don't know how to interpret it. At the very least, a developer should be able to look at a query plan and see the basic problems (Full Table Scan => Bad, Quick Index Scan => Good).

Since you're fresh out of school and you may not have covered this stuff in your classes, you could answer saying "I would talk to a more senior dev or DBA and ask for assistance in understanding this". Interviewers might accept that since it shows at the very least that you're willing to learn new things, as you haven't had the experience yet to find them out. The other option is to go and learn them on your own.

Good luck on the next interview!


They're perfectly entitled to ask what they want. You may not have covered these topics in your college curriculum but that doesn't mean other interviewees haven't or have enough interest in the topic to go beyond the curriculum. They're looking for the best. I hope you at least tried to answer the questions and didn't get all defensive. If I was them and got a whiny letter from you, you'd be blacklisted.

  • 2
    Or for that matter, just because it wasnt covered in school does not mean the company doesnt need those skill! Commented Feb 7, 2011 at 22:08
  • 3
    And if the candidate somehow did get a second chance, expecting the same question (or even anything vaguely similar) would be a major fail. One thing I do to defeat question-sharing (especially favoured by recruiters) is vary the "odd" question quite significantly. Next time expect something about phone integration or barcode scanning.
    – Мסž
    Commented Feb 8, 2011 at 3:34

Software development is a multidisciplinary profession. I don't think you'll get any mileage asking for a do-over of your interview. "Reasonable" in this context is whether a given company would eliminate you from consideration only on the basis of your lack of DBA skills. Asking the question is perfectly reasonable.

The further you progress in your career, the more you will need to know. If you're wondering why a software developer should care about query optimization, consider application design. New projects often involve data modeling discussions. This will lead to normalization discussions, which lead to database design work. Good design principles flow down to implementation. Bad/ineffective designs at the architectural level have consequences that are often expensive to remediate.


The concept of "fair" doesn't matter here. This is a job interview.

They can't reject you based on your skin color, religion, ethnicity, or a few other such things. But they can reject you for any other reason, as stupid a reason as the color of shoes you wore to the interview. And you might never know the true reason.

It's important to be resilient when interviewing. I understand the inclination to over-analyze, and I've done it myself often enough. But the best thing to do is accept that life isn't fair, and keep enough interviews in the pipeline that you don't have to hang all your hopes on any one of them.


Like others have said, the questions are completely valid. However, it would be odd if the interviewer decided whether to hire you entirely on the basis of those questions. Maybe they wanted to listen to you reason about a subject you might be unfamiliar with, and that's a valid interview technique.

If I was hiring, I wouldn't rule you out if you said "I'm sorry, I don't know that much about query optimizers, but I can learn". I would rule you out if you started whining about the questions, though.


Dude, let me tell you straight up : there is no way around Databases as a Software Developer. Every single project that I have been involved so far took up at least half of the development time. DB design is a integral part of Software Development and the more you know, the better you can solve the problem. Also, don't be flustered by the type of questions and it's context to much. Most of the time, employers just want to see if you are able to think on your feet to solve the problem at hand or if you have the confidence to at least say something sensible about the matter. With you being a graduate, they realize that they will actually have to spend time teaching you all these things anyway, but they want to know if you will be worth the time and effort. Stay sharp and modest!

  • I'm a developer and I haven't touched a database in years. Some of us don't do CRUD webapps. That said, for many (perhaps even most) roles your argument holds. Commented Dec 9, 2011 at 15:53

I want to write to the company to say that these questions are unreasonable to ask at a software developer interview and to request that my interview be done over.

What in the world do you think will happen if you send that letter? Do you imagine that they'll say "Hmm, this candidate has a point. We should have him back, and let's ask him easier questions"? I guarantee you they won't. In fact, what they will do is pass around the letter and have a laugh.

Get over your sense of entitlement. You are going out in the real world.

How do you figure the questions about databases are unfair? You think that programmers don't need to know databases, but this company apparently does. That's why they're asking the questions! Interviewers don't ask questions just for the hell of it. They ask the questions to find out if you know the things that they need. If you don't know what they need, then you're not the right person for the job.

If you don't want to learn about databases, that's fine, but don't whine if some company doesn't want to hire you. You are not owed a job.

  • 1
    I'd upvote a million times if I could
    – HLGEM
    Commented Jun 16, 2011 at 14:49

How are these not fair questions? Developers work with databases. Dont you think they should at least be familiar with the factors that are involved in making database queries efficient and fast? Not every company has inhouse DBAs... and even if it does, that does not then take the responsibility of writing effective queries away from the developer.


If they ask the questions of all the candidates then they are fair - over and done.

Doesn't matter whether you feel the questions are appropriate to the position it only matters whether the prospective employer feels they are appropriate - and if they ask then its likely that they do (either because they reflect the skills required or because they've found that the responses they get tell them interesting things about the interviewee).

Lastly, you seem to have some strange ideas about the limits of a developer's remit - I have never (so far as I can recall in a 25 year career to date) worked with a dedicated DBA...

  • You've Avoided large corporate non-IT companies then :) You need to watch our for the DBA nazis in those!
    – ozz
    Commented Feb 8, 2011 at 13:53
  • @james "Avoided" is the wrong word - but yes... point is though that I've been a "developer" for the majority of that time and as such have required at least some DBA type skills (though I don't suggest that I am a DBA... but equally its not always necessary to be/have a dedicated dba for more modest projects, though recognising the gaps in one's skillset can be painful at times)
    – Murph
    Commented Feb 8, 2011 at 17:31

Looking at the questions, I think this is could be my company - we ask these types of questions to EVERY candidate as part a telephone interview. Always. It gives us a standard to work from.

Most of the responses above summarise it quite well...

a) We want people with broad experience not people who can only do a few things.

b) The questions are there to help us probe your knowledge, you may not know the answer fully (or at all) the questions are a starting point for you to expand upon your knowledge and experience.

c) Remember the interview is there for our benefit AND YOURS ... from the types of questions you should be able to get an idea of the role and the company and whether we fit with you and you fit with us...

d) it's job, if you do not get through the interview then grow up, stop whining and try better at the next interview.


Seems like they don't have a DBA, so they wanted you to fill that role as well. This is usual for small companies.

  • 6
    Just because a company wants a developer to understand how to fine-tune their database scripts does NOT mean they don't have a DBA. I'd rather have a developer who can optimized their own stuff rather than puking any SQL script onto the server and hoping a DBA gets to it. A DBA has more stuff to worry about than fixing your scripts all the time.
    – Kris
    Commented Feb 7, 2011 at 20:36
  • 1
    Not every company employs DBAs as such. Consider commercial developers who distribute software to clients. The clients may have DBA's, but the developers still need to write the queries that are used by their software efficiently. Commented Feb 7, 2011 at 22:10
  • I worked for a small company (about two dozen people when I joined) that didn't get real DBAs until much later. When I had a query go from half a minute to half an hour, I had to figure it out myself. Commented Feb 7, 2011 at 23:05
  • 1
    In any case, it's not unreasonable to want developers who know more than just programming.
    – Andres F.
    Commented Feb 8, 2011 at 13:34

I see absolutely nothing wrong with it. Why shouldn't a developer, especially if they end up working in the database, not be privy to such items?

Should a software developer not be aware of optimization software or how to access application event logs to figure out a performance issue? If so, why not the same for someone who is a database developer? Why can't they be one in the same?

If I were interviewing someone for a software development position that also had database development involved, you're damn right I'm going to make sure they are aware of not only what they're doing but that they can increase the performance of their code or existing code as a database can be a huge bottle-neck.

Instead of developing an attitude, perhaps a better course of action would have been "I don't know the answer but here's what I'd do to find it".


As others have pointed out, in an interview pretty much any sort of question is fair game as long as it doesn't touch some sort of legally protected area (e.g. age, race, sex, etc) and it's not unusual to have interviewers throw questions at you just to see how you react to the question and how you would go about trying to find a solution to the question. Additionally, since it appears that you are a recent graduate, they are a bit limited in regards to being able to ask you about your work experience and what sort of problems you have solved in a production setting. Thus, if the company does a lot of database oriented work the questions they asked may also be relevant to what the position you are interviewing would be doing.

In regards to your assumptions:

a) Those questions cannot be fairly classified as database development questions.

Maybe, maybe not. If you are doing database development you are going to be using a query optimizer and plan from time to time to try and make sure there are no obvious issues with your queries. If the company has database administrators or experts that could review the queries they may not have the time to look at everything and they also wouldn't want to look at every poorly coded query. Likewise, it's also not unusual for developers to be responsible for maintaining their development environment, to include any databases and have the DBAs handle the production side of things.

b) I think the questions are appropriate for a DBA interview but wholly unreasonable for a software developer interview (experienced or not).

They likely would be appropriate for a DBA interview; but regardless, they are also topics that a developer should be familiar with if only at the level of being able to recognize where a problem might be and to do some basic troubleshooting themselves. Like I mentioned before, if the company has limited resources then they will want to make sure they aren't wasting peoples time with something that might be a basic issue.

c) The first question is only relevant to a database vendor.

Specific details may be vendor specific, but the general concepts can be applied anywhere and sometimes being able to show you understand the general concepts is all you need. If you don't want to get locked into a single development stack (i.e. LAMP) then you will need to be able to show during interviews that you understand the core concepts and are comfortable moving to different development stacks.

d) The second question is not fair because software developers typically don't deal with database performance logs as that is the job of the DBA.

This is generally true, but if part of your job is to write software for a given database that needs to be highly responsive then you are going to need to make sure you put forth a best effort in writing those queries so that a colleague that is an expert in a given area isn't being bogged down with poorly written queries. While you might not need to know the finer details of what the logs are telling you, you may need to be able identify obvious issues.

Hopefully all of this helps!


Just because you are a softare developer doesn't mean you should only know software developer topics. Having a wide variety of knowledge from server management to database technologies is actually a very useful skill to have as a developer. I would have no problems asking these types of questions to candidates. If they don't get them right, fine, that doesn't cross them off the list (I don't expect them to know everything), but if they are able to answer, that shows me that the developer is much more than just the typical skills-set programmer, and those are a rare breed.

  • +1, completely agree. And if instead, the prospective hire starts whining about the "unfairness" of the questions, they belong to the more common breed of do not hire.
    – Andres F.
    Commented Feb 8, 2011 at 13:36

I also have a similar dispute with a potential employer who asked me a question about a manhole cover. I ask you, what does the shape of a manhole cover have to do with programming!

  • 3
    What was the actual question about the manhole cover? I bet you it was a thought experiment created to gauge your ability to think and had nothing to do with manhole covers. Commented Feb 7, 2011 at 20:39
  • A good interviewer will ask you these kinds of questions to better understand how you think and problem solve. (Though the round-manhole question is a bit tired these days).
    – payne
    Commented Feb 7, 2011 at 20:41
  • 2
    It's a very common interview question: "Why are manhole covers round?" and the expected answer is supposed to be "so they can't fit into (and drop into) the hole." (and not any number of other reasonable reasons, such as "because the hole is round (because it's drilled round)" or "so you can roll the cover to move it after lifting it up (otherwise it either requires dragging, or two people to move)"
    – Jimmy
    Commented Feb 7, 2011 at 20:43
  • This question was probably similar to the # of golf balls that can fit into a bus question. There is not necessarily a right answer, but the interviewer wants to see how you think, how you would go about solving the problem. It is important to think aloud when being interviewed.
    – rockit
    Commented Feb 7, 2011 at 20:47
  • 2
    The statement is of course in jest, I doubt if anyone has used the famous manhole question in the past twenty year. The point is that in an interview, you follow the interviewers rules. If a question seems inappropriate, speak up then and explain your reasoning.
    – leeeb
    Commented Feb 7, 2011 at 20:48

Responses of the form Well I'm not sure but I would look it up by going to , and are also a good one. No one thinks you know everything but being able to look stuff up is a key skill