| Kurumo ( @ 2009-02-25 00:39:00 |
Tales from interviews
Me: Please describe an algorithm you would use to search for a particular value in a sorted array.
Candidate (MS in CS): <in fits and starts, describes and writes pseudo code for binary search>
Me: What is the running time of this algorithm in terms of O-notation?
Candidate: <brightly> n^2
Me: <falling of a chair> Pardon?..
Candidate: no, wait.. That would have to be 2^n
Me: <chokes on coffee>
Fini
Me: Please describe an algorithm you would use to search for a particular value in a sorted array.
Candidate (MS in CS): <in fits and starts, describes and writes pseudo code for binary search>
Me: What is the running time of this algorithm in terms of O-notation?
Candidate: <brightly> n^2
Me: <falling of a chair> Pardon?..
Candidate: no, wait.. That would have to be 2^n
Me: <chokes on coffee>
Fini