5 ms·
The only mistake the OP made was in acting like they hadn’t seen the question before, but other than that everything was fine. These code screen questions are u
by codechicago277 4y ago
The only mistake the OP made was in acting like they hadn’t seen the question before, but other than that everything was fine. These code screen questions are usually a basic gut check and the real evaluation comes later at the on-site. Honestly the interviewer did a bad job though because the question clearly gives an advantage to someone who has seen it before.
Once I had a candidate struggle with my screening question, flattening an array of nested arrays, and that’s fine because I normally use that as an opportunity to see how they ask questions and work together on finding a solution. But the candidate went silent for about 5 minutes and then came back with a perfect solution, using iterators, which are a pretty obscure JavaScript feature. I later found that exact code block on the MDN site, and I was pretty shocked at how brazen an action it was, because if they had just asked for direction and admitted they were struggling they could have still passed the interview.
- not2b 4y agoThere's a famous story about Gauss as a child (age 7 in some accounts) figuring out this trick when a teacher who probably wanted a break had the students add up the numbers from 1 to 100. He saw that you could combine numbers from the ends: 1+100=101, 2+99=101, and there are 50 pairs, so the answer is 5050.
- croo 4y agoGauss was cheating since he was born! He fixed math errors in his father accountant stuff at age 3.(according to wikipedia) if thats not an unfair advantage i dont know what is ;)
- SilasX 4y agoThere's also the joke that John von Neumann was given this task and "cheated" by just instantly adding all the numbers in his head the naive way, without having to write anything down.
- jacobolus 4y agoThe traditional story is about calculating the distance a fly (or bird?) travels if it goes back and forth between two trains. https://jcdverha.home.xs4all.nl/scijokes/10.html#Neumann_4 https://jcdverha.home.xs4all.nl/scijokes/10.html#Neumann_4
- MatthiasPortzel 4y ago> The only mistake the OP made was in acting like they hadn’t seen the question before This. Everyone in the thread is claiming no wrongdoing on the part of the author. If I was in this position, I would excitedly inform the interviewer that I had seen the question before and then quickly write down the answer. But that would look be a lot less impressive than OP’s acting as he pretended to come up with the perfect answer on the fly.
- selcuka 4y agoI would have done the same, but I can't blame the author either. He did come up with the solution on his own, after all.