The Trouble with SQL Joins Job Interview Questions
April 24th, 2010
Many of the jobs (developer, tester, manager, tech writer, support, and so on) at technical companies like Microsoft, Google, and Amazon require at least a basic knowledge of SQL joins. So, it’d be natural to assume that interview questions about joins are common. And they are up to a point. The trouble is that meaningful interview questions about SQL joins are almost impossible to ask. Let me explain. Consider each of these three obvious interview questions.
1. Describe SQL joins.
2. Given the SQL table definitions below, write a SQL query which does XXX.
3. Given the SQL table definitions and data below, what do each of the following queries return?
There are two problems with question #1 (”Describe SQL joins”). First of all, even if someone can describe joins, that doesn’t mean they can use joins in a practical way. Second, there’s no completely standard set of definitions so a description of joins by one SQL expert may not match a different description by another expert. For example, should a description of joins include natural joins and self joins? So, why not ask a more difficult question like #2?
There are two problems with question #2 (”Given the SQL table definitions below, write a SQL query which does XXX”). First, the interviewer would have to list a ton of table definitions in order to create even simple SQL tasks (meaning a typical left outer join). This makes the interview question useless if the interview is being conducted by phone. And if the interviewer sends the question to the candidate by e-mail, there’s no way to ensure that the candidate figures out the answer without help. Second, there are hundreds of possible answers to even the simplest join question, making any candidate’s answer very difficult to evaluate even by a SQL expert, and impossible to evaluate by a non-expert (like a recruiter). So, why not ask something like question #3 which will have a specific answer?
There is a problem with question #3 (Given the SQL table definitions and data below, what do each of the following queries return?) In addition to a ton of table definitions you’d have to have even more data listed. We have questions similar to #3 in the Volt training classes at Microsoft, and the setup is a full page of definitions and data just for a few problems. As with question #2, this means question #3 cannot be asked over the phone, and if asked by e-mail, even an absolute beginner could simply type the definitions, data, and query question into a SQL client and get the answer.
So, even though a recruiter or interviewer needs to know a candidate’s knowledge of SQL joins, there is no good way to ask good interview questions. Unless an interview takes place in person and the interviewer has SQL table definitions and data ready, you are unlikely to get “good” SQL join interview questions. Most interviewers and recruiters I know rely on subjective questions about a candidate’s experience.
Entry Filed under: Interviewing
Trackback this post