Interview Question #1 (4 minutes)

Part of "Troubleshooting Blocking and Deadlocks for Beginners (2 hours 10 minutes)"

Question

Here’s my answer

Transcript

Question

Ready for your first interview question? Here we go.

Why does blocking happen in a SQL Server?

Answer

Here’s how I would tackle this first interview question.

When queries run in SQL Server, they need locks to protect the data that they’re accessing. Sometimes multiple queries run at the same time, and the locks they need conflict with one another.

Say, one query may need an exclusive lock, and it just can’t play nicely with another query if they need a conflicting lock. So when that happens, one query will block another query.

This question is a knowledge type question

It’s not talking about experience, it’s talking about facts, so when you answer this you want to give some detail, but also have a balance, and try to be succinct. You can always stop and ask, “Would you like more detail about this?” if you feel that you’ve gone on for a while and find out if they want to hear more or if they’re satisfied with what you’ve said so far.

That can be a good way to get some verbal feedback on how you’re doing, and can help you feel more comfortable as well.

It’s OK to say you don’t know, but make that the start of an answer

On any kind of knowledge situation in an interview – a knowledge question– if you really don’t know the answer to what they’re saying, it is totally fine to say “I’m not sure,” or “I don’t know.”

However, don’t finish with “I don’t know.” Let that be the START of an answer, and firm up the answer with saying thoughts on: in the real world, if you were confronted with this, you know, you’re going to have, there’s going to be things you don’t know in the real world, that’s just normal.

What would you do to figure it out? It’s perfectly fine to fit that into an interview question as well.

“I am not sure what the answer is, but I think maybe I could find the answer online, in Books Online.”

If it seems like a knowledge question that’s going to be covered there, do you know the types of topics in Books Online that it’s about?

Is there something that you would test to figure it out? Could you write sample code to find the answer?

And even, is there a blog where you know there’s good references on this topic where you’d look, and you really think it’s a reputable source of information, right up the alley of this question.

If you don’t know, be honest.

Same thing if you’re guessing at the answer

Say, “Now I’m not 100% on this, “you know, I’m making kind of an educated guess here… Here’s what I think, and in the real world, I wouldn’t just go on my guess. In the real world, here’s what I would do to make sure of the answer before I tried to solve a problem about that.”

If you can’t remember everything when you get hit with these knowledge questions, don’t panic. Be honest, be confident, and use the resources that you have online.

You can even do something like refer to this course, and say, “Oh you know, “I did take this online course, “and I learned about monitoring for this. “I would go back and review “some of the information in there.” Give as many specifics as you can to let people know what you do know and how you learn more about tricky topics in SQL Server.