Re:Write A Function To Determine If A Number Is A Power Of 2
by tlrobinson on Monday October 18, 2010 @12:21PM
(#1804059)
Do people really expect interviewees to write tests during interviews? I've never seen that from either side of interviewing.
[ Parent
| on HN ]
Re:Write A Function To Determine If A Number Is A Power Of 2
by leif on Monday October 18, 2010 @12:34PM
(#1804125)
Yes. Microsoft asked me to verbally test my code (come up with a few examples and walk through the code), and Google asked me to describe a range of test cases to start with, and to decide if my code passed them.
They want to know that you know what sorts of inputs to start testing on (empty input, if that's valid, each obvious corner case (can you find all the corner cases quickly? This is a good skill to have), etc.) and that you can do this mentally a little before you compile and run the tests.
Re:Write A Function To Determine If A Number Is A Power Of 2
by tlrobinson on Monday October 18, 2010 @12:38PM
(#1804142)
Oh yeah, I've been asked to describe how I would verify my code was correct including edge cases, but I've never seen people actually write test code.