ibneko: (Default)
[personal profile] ibneko
...I still hate interviews.

Especially ones that ask me to recall things like the best sorting method... :P Fucking algorithms. Especially when the last time I saw them was 3+ years ago...

That being said, I did manage to get a rather curious problem out of that interview. So, given a random number generator that can only give you 0 and 1, what's the fastest way of extracting a fair 0, 1, or 2? (err, so you have a 1/3 chance of getting 0, 1/3 chance of getting 1, 1/3 chance of getting 2.)

roll it two times:
If we get 00, 01, 10 we pick a, b, or c respectively. Otherwise, we reroll twice. Is there a better way to do this?

Date: 2008-02-22 02:21 am (UTC)
From: [identity profile] contrasedative.livejournal.com
I don't have a different answer for your random number problem.

I hate interviews too, but the technical ones are at least interesting. For me, they're fresh in my mind, since I took a required course on algorithm analysis last semester. (Stupid discrete math...) I think I screwed up a mostly behavioral-question interview with Microsoft this week. I don't know why you would hire someone based on their rehearsed 30-second sound bites. We're not politicians, we're programmers.

Expand Cut Tags

No cut tags

Profile

ibneko: (Default)
ibneko

Most Popular Tags

Style Credit

Page generated Feb. 14th, 2026 06:11 am
Powered by Dreamwidth Studios
January 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2021