2 ms·
Your confusion is the exact problem my friend had. After some nudging the interviewer rephrased it to be a linked list of finite but unknown length. The issue
by Smerity 16y ago
Your confusion is the exact problem my friend had. After some nudging the interviewer rephrased it to be a linked list of finite but unknown length.
The issue was more that when my friend didn't get it within about a minute the interviewer decided the interview was over and hung up abruptly. If the question is "select a random element from a linked list of finite but unknown length that you can traverse only once" then yes it's at least solvable but I don't think it's a reasonable interview question to demand in less than a minute when the question was additionally ill formed to begin with.