3 ms·
I'm curious, what was the trick question given to you by Microsoft Boulder?
by chncdcksn 10y ago
I'm curious, what was the trick question given to you by Microsoft Boulder?
- leeter 10y agoI don't recall the exact question, but I recall they were only looking for the answer that used bit manipulation. Which was not necessarily intuitive in the context.
- ekoontz 10y agoHm, perhaps counting number of bits set to 1 in a multi-byte array?
- leeter 10y agono, bit wise is logical there. I'm thinking it was duplicates or primes or some such.
- SilasX 10y agoI know a common one is how to switch the values of two variables without using a temporary third variable. One way (method 2 here [1]) is to use repeated bitwise XORs. Does that sound like it could be the one? [1] http://www.geeksforgeeks.org/swap-two-numbers-without-using-temporary-variable/ http://www.geeksforgeeks.org/swap-two-numbers-without-using-...