I was rejected from an interview for python when I was asked how I would remove the nth element from a list. It's python so I said I'd pop the index. I was told that since pop doesn't do that in other languages, that was the wrong answer and that I needed to write my own code... So yea I've got the python version of your story.
Yeap. I believe there is a different mentality when doing code interviews. The mentality is that we live in stone age and only the most trivial code is available in the language. So no fancy methods like pop or push.
Worse was that they acknowledged that pop would have been great for removing the last element. Just that I was not allowed to pass it an index because languages like java didn't accept it. So it was that it couldn't be done in language that is not used at that company so we won't let you do it in language that is used at that company.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I was rejected from an interview for python when I was asked how I would remove the nth element from a list. It's python so I said I'd pop the index. I was told that since pop doesn't do that in other languages, that was the wrong answer and that I needed to write my own code... So yea I've got the python version of your story.
Yeap. I believe there is a different mentality when doing code interviews. The mentality is that we live in stone age and only the most trivial code is available in the language. So no fancy methods like
pop
orpush
.Worse was that they acknowledged that pop would have been great for removing the last element. Just that I was not allowed to pass it an index because languages like java didn't accept it. So it was that it couldn't be done in language that is not used at that company so we won't let you do it in language that is used at that company.