Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's the test. It's one I stole from an online test practice site but IMO it actually works well on a number of levels:

Give me a routine takes in an unsigned integer, pick any size you want, and returns TRUE if the binary representation has two consecutive 1s in it.

    Test data: 9 = 1001b = FALSE, 13 = 1101 = TRUE.
I'll even give them an example function prototype:

    bool adjacent_bits(uint32 x);
As I see it there are multiple ways you can write this and I really don't care how you do it. If you start with a simple case (say, a for loop), get it working, then realize you can optimize it...that's even better. It even optimizes down further to a single inline math operation.

The key is that I can see you understand bit shifting and a bit operator in C. If you've done this kind of work as your resume claims, you should be somewhere in zone on this without too much struggle.

I've seen candidates write triple-nested for loops. Bizarre interlocking bools trying to make a state machine. Hard-coded numbers that kill portability. Calls to printf where I asked for a boolean return. Attack ships on fire off the shoulder of Orion...

Perhaps, like you said, this helps weed out the people that just played with the GUI to configure something when I need people that got a driver working down at the register level. So I'm sticking with the test for now.



Oh yeah, that should be easy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: