Pergunta de entrevista da empresa Informed

Given a matrix print the elements in spiral order.

Resposta da entrevista

Sigiloso

2 de abr. de 2020

I used an array of directions and a visited set and ran through the matrix in spiral order changing the direction in a round-robin way. He asked me to run the code after I wrote it. There were a few errors in the outcome, so I corrected them myself and finally, it was a working code. I think this was extremely unprofessional. An interviewer who is not capable enough to look at the code and tell whether it is perfect or not asks you to run the code to check the correctness, should not judge the candidate for not writing the perfect code in one go. I have interviewed with many companies and none of the good ones ask you to run the code in an interview. If the interviewer is good enough he can point out the mistakes looking at the code itself. It was extremely frustrating when I got to hear in my feedback that the way I approached the problem was not good. I have solved much harder questions in my data structure rounds. I politely asked them to give a detailed feedback for this round through an email, however they didn't reply to my email, which I think is unprofessional again to not to reply to the candidate who has given so many hours of his time interviewing with your long process.