> I wrote a bubble sort in Grade 12 but I can't remember the details well enough
I'm not sure that I've ever written a bubble sort. Like I mentioned, this is a derivation purely based on the name of the algorithm and some vague recollections from my childhood.
>to write BUG-FREE code to do it on a whiteboard
Do you think that you'd want to work for an employer that expected bug free code to be written on a whiteboard? I wouldn't either. But I would work for one where if they noticed a bug in code that I wrote, we then talked about the bug and what the impact of that would be and fixed it. This shows communication skills, as well as the humility to be able to admit situations where you're wrong and take action to fix it.
> Nowadays if I want to sort, I use quicksort() or I use the accepted language way of sorting list.sorted() in Python for instance, or I write an ORDER BY clause at the end of my SQL statement. And so should you.
You know, a whiteboard coding task can be a good place to talk about alternatives. It's not just a place to jump straight to code solutions. If you're treating it that way you're missing out on a bunch of opportunity to sell yourself as a potential employee. All of the above are valid topics of conversation that show your skills and experience. They're not wrong. In a recent interview I was asked to solve something and my first response was "There's only 2000 or so cases, write a lookup table, move on with life, but you know that doesn't show that I can code, so here's the solution you're looking for that would fill that lookup table".
> Writing sort algorithm code is a dumb thing for a software engineer to do and I don't care if you have never heard of bubble sort because it is useless historical knowledge for everyone except historians.
Given that you want to understand how a person communicates when talking about and writing code, what would you ask instead?
>Just consider these whiteboard interviews as a way of warning you that the potential employer probably is not such a great place to work after all.
I don't think this is the case at all. The conversation you have in front of that whiteboard is significantly more telling than the presence of an erasable writing surface.