Live data from Hacker News

My Job Interview at Google

catonmat.net

81–90 of 114 posts

Re: My Job Interview at Google

#81

Could anyone point me on how to solve this(either a solution or preferrably a pointer on how to get to it): "Q: Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7." First I thought it was simple but the I got stuck, maybe I'm just tired. No matter how I twsit and turn it I seem to get only an even distribution over 5 numbers.

1) Given a number 1 to 5, get a new one if it's 5, else throw away the MSB, you get 2 bits of randomness per number. Subtract one and call it a. (Now you have two bits of randomness evenly distributed among the set {00, 01, 10, 11}) 2) Get another number 1 to 5, toss it if it's 5, take the LSB. Call it b. (Now you have another bit of randomness, evenly distributed among {0,1}) 3) if b == 1 and a == 11, start over. el…

patio11's solution is about twice as efficient as mine, and is a much simpler way to think about it.

Re: My Job Interview at Google

#82
post #69

Earlier quoted context omitted.

experimental evidence says that it is in fact a uniform distribution: r = random.Random() def one_to_five(): return r.randint(1, 5) def mod_seven(): return (sum(one_to_five() for x in xrange(7)) % 7) + 1 def test_dist(lst): return [(x, lst.count(x)) for x in [1,2,3,4,5,6,7]]

i've tried it out experimentally in google docs and it looks really good for big numbers. No real proof tho and it might be that the errors counter each other by chance: http://spreadsheets.google.com/ccc?key=pq4tB7LQWN03gF7ImGhIP...

Have a look at the distributions for each sum here: http://brianpmearns.com/ext/dice/dice.html

edit: Oops bad addition on my part, could be uniform, but you'd have to work out the actual number exactly.

Re: My Job Interview at Google

#83
post #46

Earlier quoted context omitted.

SREs are on call. That means they carry a pager/cell phone and must be accessible at all times. He should be happy he didn't get picked ;).

> must be accessible at all times Nope, just when they're on call. I was snowboarding in Montana for a week last winter with my google SRE buddy, so I'm pretty sure about this :)

So he's not on call when he's on vacation and on a ski hill. Ask him about getting late night calls while with family during regular workdays!

When you work for a big company and you're getting paid a corporate salary, being on call just plain sucks. Period. I worked one job like that and hated it. I'd never do it again. If you work for your self or your own startup, well... then that's different :).

Re: My Job Interview at Google

#84
post #83

Earlier quoted context omitted.

> must be accessible at all times Nope, just when they're on call. I was snowboarding in Montana for a week last winter with my google SRE buddy, so I'm pretty sure about this :)

So he's not on call when he's on vacation and on a ski hill. Ask him about getting late night calls while with family during regular workdays! When you work for a big company and you're getting paid a corporate salary, being on call just plain sucks. Period. I worked one job like that and hated it. I'd never do it again. If you work for your self or your own startup, well... then that's different :).

They have a call schedule, and only get called when they're on call. The size of google makes that a more solid rule than it is at smaller companies, I think. Plus they have a more lax work schedule when they're on call, to try and compensate.

I've worked jobs where you really are on 24x7x365 call, and it does suck, and google SRE is not like that.

And hey, it could be worse! Doctors can get called any time, by their most hypochondriac patients...

Re: My Job Interview at Google

#85
post #62

Earlier quoted context omitted.

you'd get 98% of the value with 10% of the time invested. Hard to say. The economics of hiring aren't intuitive - a bad hire can do a lot of damage, esp. if it's a management position (which this wasn't, I know). It's probably better to nicely turn down 10 people (and nicely ask them to re-apply in 6 months) than to let in 1 charming, but conniving and free-riding bullshitter into your team.

I dunno-- I'm a big fan of "fire fast". If you can't detect a charming, conniving, free-riding bullshitter in 1-2 weeks of working with them, how are you going to detect 'em with 10 man-hours worth of interviews?

I don't see how firing someone after they've left their previous job behind is better for either the employer or the employee.

Re: My Job Interview at Google

#86
post #78

Isn't this level of interviewing kind of excessive and time-expensive? If I were Google, I would do the following: 1) Have the first interviewer be the best/most-appropriate interviewer for the position (manager, lead dev, whatever). Have them write down in a sealed envelope a "hire" or "no hire" statement after the interview. 2) At the end of the assorted interviews, measure how often the first interviewer is correc…

Maybe there is a secondary objective for excessive interviewing: "Hazing is often used as a method to promote group loyalty and camaraderie through shared suffering (male bonding in fraternities), either with fellow participants, past participants or both."

Hmm, really good point. And I suspect beyond that you can exploit elitism by making the process seem artificially hard.

It seems clearer if you think about the converse: If you were offered a job 10 minutes into an interview, would you value it as highly?

Re: My Job Interview at Google

#87

Earlier quoted context omitted.

Maybe it was Visual C++ you were programming in. ^ is for a handle to a object on the managed heap so it's almost the same as pointer. http://msdn.microsoft.com/de-de/library/yk97tc08.aspx

I was thinking it was Pascal - I think ^ is the syntax for pointers in Pascal, but the last time I programmed in that language, I was 12.

Yep, pascal had ^ and @.

Around 5 years ago I was spent a lot of time working with really old Object Pascal and some C code that was upgraded to OS 8/9 and then left to rot. Let me just say that low level networking code on a OS that does not have threads is a PITA. They had something like interrupts but you could not allocate memory during them. You had to first allocate using Handel's and then do something before working with actual pointers as part of your run loop and then use that memory during the interrupts. Meh, I think it might have been the most fun coding project I have ever been on, but I don't want to do that again.

Re: My Job Interview at Google

#88

Earlier quoted context omitted.

Citation needed. (Seriously, two totally contradictory opinions on this, wondering if there is any actual evidence either way.)

I asked my recruiter specifically if they were in a hiring freeze (I'm in the middle of the application process now), and she was very adamant that they were not. If they were, they would lay off the whole HR department, except for a skeleton crew needed for benefits and such. After all, why spend ~40M/year on recruiters if you're not recruiting?

2 of my friends have been hired within the last couple of months.

Re: My Job Interview at Google

#89
post #88

Earlier quoted context omitted.

I asked my recruiter specifically if they were in a hiring freeze (I'm in the middle of the application process now), and she was very adamant that they were not. If they were, they would lay off the whole HR department, except for a skeleton crew needed for benefits and such. After all, why spend ~40M/year on recruiters if you're not recruiting?

2 of my friends have been hired within the last couple of months.

One of the Dojo guys just got hired yesterday:

http://alex.dojotoolkit.org/2008/11/joining-google/

So obviously they are still hiring, they're just really, really picky.

Post reply on HN