Interview Question #4 (2 minutes)

Question

Sample answer…

Transcript

Question

Next up, interview question number four.

What is a deadlock?

Answer

Here’s my sample answer for question number four.

A deadlock in SQL Server is a situation where queries have gotten into a lock conflict and none of the queries can make progress.

It’s kind of like you have two cars on a single lane road traveling opposite directions and they get stuck facing one another and there’s no place for them to turn off.

When queries have started in SQL Server, they don’t have the ability to reverse, so they’re just stuck.

SQL Server has a deadlock manager that periodically wakes up and identifies when queries are stuck like this with lock conflicts that they just can’t resolve and it will choose the lowest priority query and kill it off so that at least the other query or queries can make some progress.

Now, this is another knowledge question

Reminders that we already covered about knowledge questions:

  • Be as succinct as you can. You can’t answer every question in three words, but be succinct
  • If you’re not sure, it’s okay to guess but say, “I don’t remember 100%, but here’s what I think it is,” then mention what resources you would use to confirm that, be it code, websites, or Microsoft’s documentation