Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I take interview for my company. During interview I've faced many candidates having 1 to 3 years of experience in their field. Typically, they had experience in C#, Java, J2ME, iOS and similar platform. Few had working experience in C and/or C++. I'm a C++ programmer but typically I don't ask very C/C++ specific questions during interview. I test their ability to write and understand programs.

I did observe that many candidates have basic knowledge about programming. They understand and can write easy programs in their chosen language. They can solve most of the problems I ask. To my surprise, most candidates fail in specific type of question: bitwise thinking. They fail to write a code that swaps MSB with LSB of a 16 bit integer (like, given 0xABCD, make it 0xCDAB). They fail to write code that toggles a bit in an integer. Etc. If I show them the code involving bitwise operation and ask them to write what the code does, they fail to answer, given that I tell them to ask me if they've any question about syntax.

I found that they fail to understand that inside computer memory every number can be thought as decimal, hexadecimal, binary, or in any other base. Some of them got scared if I show an example in binary.

There is no doubt that when we'll hire these candidates, they won't be working with bits - at least directly. They don't need to solve any bitwise problems while working in our company. And their performance is promising at what they do. But I can't think about a programmer who can't think bitwise.

Should I discard these candidates? Or give them a chance?

share|improve this question
10  
So you want us to tell you whether or not to reject people based on your personal biases? You already sound like you have it out for them. Does your company write anything that really cares about bit-level operations? You know that writing software is a lot more than just that sort of low-level thinking? – birryree Feb 23 '12 at 4:16
6  
They don't think it, because it's generally not relevant. Why don't you think at the atomic level? Sounds absurd doesn't it? – Aaron McIver Feb 23 '12 at 4:23
3  
I developed line-of-business applications for years without the need to perform a single bitwise operation (other than flag masking, which doesn't really count when you can copy-paste code). I do use them a lot at my current job, but not all jobs need this. – Robert Harvey Feb 23 '12 at 6:08
2  
Given one +ve vote, as I don't agree that this should be -ve voted. – Manoj R Feb 23 '12 at 6:09
2  
@Monoj - likewise. Just because the answer is "no - don't discard these candidates and don't ask them irrelevant questions" doesn't mean this question is a bad one. The downvote button is not an "I answer no" button. It's also not an "I disapprove of your actions" button. – Steve314 Feb 23 '12 at 7:12
show 3 more comments

5 Answers

up vote 20 down vote accepted

You've mentioned that solving bitwise operations is not a skill that people at your company will need to do their jobs. You should therefore not even be asking about it.

share|improve this answer
I agree with this! I find some people like to ask questions as remotely distant from the actual job as possible, because they want to, I don't know, feel a candidate's helplessness. I was one of two people in some interview, and the other interviewer asked the candidate a question that made him struggle so much (and not really related to anything we did), and the candidate was basically begging for us to give him another shot. – birryree Feb 23 '12 at 4:27
2  
@Donotalo. You may be thinking too narrowly. OS developers obviously need to know how an OS works. Database front end folks, maybe not so much. The field is fractionating, and none of us can know everything. How much of the software stack that you use everyday do you understand at a professional level? – Charles E. Grant Feb 23 '12 at 6:40
1  
@Donotalo. You seem to think that low-level operations are some sort of measure of intellect. This is wrong. The concepts are not particularly difficult to grasp. It may be the case that many programmers do not know them, but this is usually because it is not relevant to their work, not because they are incapable of learning. If, in the future, programmers can bring value to their business without knowing how operating systems or compilers work, then why would it matter if they know these things or not? – MatthewKing Feb 23 '12 at 6:43
1  
@Donotalo, 100 years from now? Heck, today most programmers dont know a lot about whats going on down below at the compiler and bit/byte level. That doesnt mean they arent programmers, it just means they specialize in other programming topics. – GrandmasterB Feb 23 '12 at 6:46
1  
I thought understanding binary is very basic and all programmers should know that. I need to change my mind. Thank you. – Donotalo Feb 23 '12 at 6:52
show 5 more comments

Software development is a huge and diverse field now. For some jobs, not knowing bitwise operations would be completely disqualifying. For others it is close to irrelevant. My personal mantra is that you must understand at least one level of abstraction beneath the level you usually work at. I write bioinformatics code in C and C++, so you can bet that I know about bit level operations. However, if your line of work is writing web front ends for databases, then the bits and bytes may be less relevant, but you'd better understand HTTP and the relational db model. This is particularly true for folks who have only been working for a few years.

One of the best programmers I ever worked with was a SQL guy who'd gone to a trade school. Once day in conversation, I was stunned to learn that he had no idea how floating point numbers were represented on computers. You probably don't want him writing your financial modeling software, but then you probably don't want me designing your databases.

When you are hiring junior people (and 1-3 years is still pretty junior in my book), don't just try to clone yourself. Try to come to an honest appraisal of whether they can do the job or not.

share|improve this answer
1  
For someone not to know about mantissas and exponents etc because he knows better than to use floats for financial calculations and so has no interest in the representation makes a lot of sense to me. Someone who knows in detail how floats work, yet works entirely on financial code - I'd suspect they're using floats where they really shouldn't be. Why would you still know a lot about something you never use? There are no doubt financial calculations that need floats, but most of the time you should count in integer pennies/cents/whatever rather than pounds/dollars/whatever. – Steve314 Feb 23 '12 at 6:59
1  
@Steve314 that's why I referred to financial modeling rather than financial record keeping. I was thinking of stuff like Black-Scholes and Martingales. Believe me all that stuff is done in floating point. – Charles E. Grant Feb 23 '12 at 7:23
2  
Using a 64 bit int to represnt cents still leaves in the order of 100000 trillion dollars of representation. - it will be a few years before anyone needs mrore than that, and by then well be uing 128 bit systems – mattnz Feb 23 '12 at 7:25
@mattnz, maybe it would have been clearer if I'd written financial engineering rather than financial modeling. The sort of software I was trying to allude to has nothing to do with tracking pennies, but rather expected earnings on a bond given some sophisticated statistical model of fluctuations in the bond market. Stuff wall street hired physicists to do, rather than accountants. – Charles E. Grant Feb 23 '12 at 7:44

For me, it's like someone applying to be a baker who can only make cake from a mix. Maybe that's all you need for the job, and maybe you're very good at it, but you've intentionally neglected some foundational aspects of your profession, which says something about your devotion and aptitude.

I also presume you ask your developers to occasionally learn something completely new related to their job. Learning from your colleagues is a critical part of our job description. Therefore, even if they have not used bitwise operators before, I would expect someone to be able to learn them in an intelligent manner with some coaching. Our software doesn't use exceptions at the moment, but that doesn't mean we will never use exceptions in the future, and I'd expect an applicant to be able to muddle through in an interview with some coaching. If you don't have a rudimentary understanding of a concept, how will you know to brush up on it if it ever turns out to be the best tool for a task?

I'm not just one of those people being harsh who has never been in a position like this. I interviewed for a C++ job once with very rusty knowledge of the syntax for specifying classes and their relationships. I was asked some very tough questions along those lines, which I didn't know the answers to, but I got the job because I demonstrated I could figure it out with some coaching. It's not too much to ask.

share|improve this answer

The candidate who can answer this could be given extra edge, but the candidate who can not answer that should not be neglected altogether.

If there is a candidate who do not know bitwise operator but knows the time complexity of heap and hash, i will consider the candidate. This is what he/she will be doing on daily basis, and I expect him/her to be proficient in that. I may ask bitwise operator questions just to see the thinking pattern. But will give less weight to it.

It may be useful if you have two very similar candidates, and have to choose only one. Both answered all the questions properly. In this case may be this can be helpful.

share|improve this answer

I don't think you should discard applicants just because they are not well versed in bitwise operations, but you might want to pay more attention to why they aren't well versed in particular skills you may take for granted. A fifteen minute talk with them about their programming experiences and training (possibly including college courses, but only if relevant) may explain more about why they know what they know, which in turn could lead you to better understand exactly what they know and whether they could be relevant to your project than asking arbitrary questions that you would expect "a typical programmer" to know.

It is not surprising if a person has been an industrial Java and .NET programmer all their life (possibly a music major in college, missing out on system architecture, and OS theory), and didn't know how to swap variables in place using bitwise operations. It could be OK, and possibly even better, depending on your needs.

share|improve this answer
Oh, now I see why everybody seems to be angry at me. I never asked anyone to 'swap variables using bitwise operators'. I don't look for that sort of skill. I don't like them to memorize every tricks. What I ask is fairly simple, you can re-read my post. Yet, people at programmers are thinking that's exactly what I asked! – Donotalo Feb 23 '12 at 5:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.