Curious. What skills from the "return all elements from a matrix in a spiral order" make you a good mentor? Or say something about your skills keeping code clean?
(disclaimer: all of this is notwithstanding the fact that some people's brains shut down specifically during interviews/places where they feel under pressure, which I have nothing but sympathy for. Afaik that's an unsolved problem with coding interviews. I would always try to lower their stress but it is not a sure thing.)
A B
C D
E F
you are supposed to return A B D C E F, then if you cannot do this, I don't care about how clean your code is.If you ask me a question like this, I'm going to judge your company pretty harshly.
Having said this, I'd never hire a person that's not able to reason about this. Actually writing the implementation is really secondary