Wow. NB to all interviewers: this guy's a cheat.
Wow. NB to all interviewers: this guy's a cheat.
I don't know if you interview people, but I do, and it's hard. I try hard to come up with questions that probe people's knowledge in specific ways and help discriminate between large ranges of ability. It's fucked up to try to ruin the information I'm getting by cheating without telling me.
If you hold the principled position that looking everything up during an interview is a reasonable way to demonstrate your competence, then you should come out and tell me that's what you're doing, so that I can make a decision which isn't based on lies of omission.
An interview should evaluate the skills one needs for the job, not puzzles that make you feel smart. Were I interviewing someone, I would happily accept an answer something along the lines of "that's been solved already, I would use an existing library so I can move on and solve my real problem" with regard to bitwise operators.
Software engineers are given problems to solve, and their job is to solve these problems efficiently. You don't always have the solution to every problem off of the top of your head. That's why programmers use Google, StackOverflow, and documentation as resources. The primary skill employers are looking for is learning how to learn new things quickly. And I believe I demonstrated that skill in my interview.
Also, I declined to mention this in the article, but after I finished that UTF encoding problem in my interview, the interviewer asked where I got the check-bit macro (he saw me paste it in). I told him I got it from StackOverflow. It didn't seem to concern him.
Interviewing is different from a real job. You need to show you can do more than look up solutions on the web.
I can't blame you for trying to cheat your way into a job and I certainly blame the interviewer for not seeing through your cheat, but make no mistake: you cheated.
in this instance that is absolutely not cheating.
If I asked you a question about manipulating Unicode, I am so obviously not looking to find out how quickly you learn things, and you know perfectly well I'm not. I'm finding out what you know about character encoding and string manipulation!
(Regarding your addendum, if you're actually honest about it in the interview I don't really take any issue with it. But I hope you would be honest about it before an interviewer has to ask you whether you cheated.)
That's a pretty important part of the story, and makes the situation very different. It also makes the interviewer seem a lot more competent. Trivia questions are useless in interviews, and the fact that you were able to quickly google it, recognize it as a relevant solution, and apply it correctly actually is demonstrating that you know how to learn things quickly (and that you have at least some familiarity with binary representations and manipulations). The average charlatan would just start copying and pasting in panic, which is usually pretty easy to pick up on.
Meanwhile, you can't pretend what you described in your post is really a moral position if you had not said anything. It might not have been strictly immoral as you really owe them nothing, but there's no shining principle demonstrated there.
My word of advice to you is this: study harder next time, be honest when they hit a gap in your knowledge (maybe they will offer to fill in that gap!), and don't Google on the phone. Interviews are like tests at school - closed book, unless stated otherwise.
But the fault is still with the candidate. It's unethical to get external help in an interview without telling the interviewer what you're doing, full stop, end of story. It doesn't matter if you don't think much of the question. Doing so screws up the interviewer's ability to actually compare you meaningfully to their other candidates.
If they want you to solve bit manipulation questions they could come up with something terribly obscure and difficult to explain or they could give you one that can be solved by anyone with the basic knowledge of bitwise operators a bit of problem solving. Having to Google this answer either shows failure on your behalf or the inability to actually sit down and address the problem critically before running off to find help from others (who will often be unable to help you on actual problems)
I also sincerely believe that the more you know about C bit manipulation (particularly the kind of manipulation you need to, e.g., figure out whether a UTF-8 encoding is nonminimal), the less unreasonable that Google search seems.
I've been a C programmer since 1994 and interviewed lord knows how many C programmers and I'd never flunk someone for looking this up, nor would I care if they told me if they had looked it up. Obviously, 'cletus feels differently, but I think he's wrong.