The Efficient Testing Interview Question

February 20th, 2010

Recently I heard a really interesting interview question that was used at a technical company. I don’t know the answer, but as I’ll explain shortly, that’s not the point. The question goes like this. Suppose you have N lines of code (say 1,000,000 or so). Each line of code may be good with some probability p (say 0.95) or may have a bug (p = 0.05). You have test cases that can test any number of adjacent lines (for example, you can test lines 25-30, or you can test just line 17, and so on) but the result of a test is pass if all lines are good and fail if one or more lines have bugs. What is the most efficient way to test all N line of code? So, as always, an interviewer expects you to qualify the question, because there is a lot of ambiguity as the question is stated. For example, what does “most efficient” mean? Next, the interviewer wants to see how you go about examining the question – the correct answer is mostly irrelevant. Anyway, I have no idea what the answer is, but I’m guessing that the most efficient strategy must involve the probability p.

Entry Filed under: Interviewing


Calendar

September 2010
S M T W T F S
« Aug    
 1234
567891011
12131415161718
19202122232425
2627282930  

Most Recent Posts