Re:Stanford CS9: Problem-Solving for the CS Technical Interview
by andoma on Sunday January 14, 2018 @08:03PM
(#16147649)
FWIW the second example of finding halfway points in https://web.stanford.edu/class/cs9/sample_probs/ListShufflin... is buggy. Crashes if the list have odd number of elements.
[ Parent
| on HN ]
Re:Stanford CS9: Problem-Solving for the CS Technical Interview
by stephencanon on Sunday January 14, 2018 @08:06PM
(#16147661)
"Your job is to write a function that accepts as input a pointer to a linked list with an even number of elements"
Re:Stanford CS9: Problem-Solving for the CS Technical Interview
by cabaalis on Sunday January 14, 2018 @08:15PM
(#16147713)
Would writing it to handle odd numbers of elements as well cause the employer to move forward with a different candidate?
Re:Stanford CS9: Problem-Solving for the CS Technical Interview
by lmartel on Sunday January 14, 2018 @08:55PM
(#16147872)
This may not have been a serious question but I'll give a serious answer: depending on the interviewer, you could get bonus points for going "above and beyond" or, yes, you could be penalized for "not reading the spec."
I've found that the best way to handle it in a conventional whiteboard interview is to mention it when appropriate and offer to add the functionality later.
"Now, here's the part of the code where I'd deal with odd N. Since we're guaranteed even N in the problem statement I'll skip this for now, but we can come back to harden this function later if you like."
Re:Stanford CS9: Problem-Solving for the CS Technical Interview
by SmirkingRevenge on Sunday January 14, 2018 @08:46PM
(#16147835)
Maybe. All other things being equal, they might need a reason to cut you, and hire the other guy.
If you failed to complete the problem or took longer than expected to complete it because of extra complexity entailed by a more "correct", out-of-scope solution, it may especially cost you - even if in the end, your solution was "smarter".
Maybe the other guy noted that there are a couple of ways to solve the problem, and asked a clarifying question about it.