lars0 lars0

Niner since 2004


  • Zoe Goldring and Gretchen Ledgard - What is it like to interview at Microsoft?

    One example: 2,2,3,3,3,5,5,6,6,9,9
    Write a routine that finds the number in the above set that shows up an odd number of times. Do it _now_ without any reference. Do it while under the pressure of someone waiting for you to do it.

    The interviewer wants to see you use a hash in the solution.

    Are you sure about that?  If only one number in the list appears an odd number of times, then a much more efficient solution than a hash table is simply to take the XOR of all the numbers in the list.  I'd have assumed that's what they were looking for.  It's not really like MS to test whether you know specific APIs.