2 ms·
Indeed, in college I was interviewing for a job, and the interviewer asked how I would determine the length of a null terminated string, and I thought I nailed
by tlrobinson 18y ago
Indeed, in college I was interviewing for a job, and the interviewer asked how I would determine the length of a null terminated string, and I thought I nailed it by giving a typical "while(*(str++)) c++;" implementation.
The "right" answer was just to use strlen()...
- nostrademons 18y agoI had a job interview once where the question was "find all descendants of a DOM node with a certain tag name, and return them in document order." I thought for about 30 seconds, and then wrote up on the board: element.getElementsByTagName(tagName); That was what he was looking for. ;-) Of course, then he had me do it out as if getElementsByTagName didn't exist.