Thursday, November 04, 2004

Just got off the phone...

I just got off the phone... and I think I did pretty well.

Here are the questions that he asked me:
Given 2 strings (as character arrays) A and B, how would you determine if the characters in B were a subset of the characters in A.

Given that there are about 4 billion pages indexed by Google, how would you keep from indexing the same page twice?

What is a cool project you've been thinking about? (something you might work on in your "20% time" at Google).

I also found out about some pretty sweet perks at Google

  • Free lunch and dinner - great for people just coming out of College
  • 20% time - 20% of your time is spent working on any project you want
  • Free Massages - I don't remember how often you can get them... but, still...
  • The whole Moutainview, CA staff goes on a ski trip to Tahoe every year in Januarary... with skiing competitions :-D


Now, lets all cross our collective fingers... and hope Adam gets his dream job at Google.


10 comments:

Adam said...

Question #1 answer:
bool isSubset(char* a, char* b)
{
int hasLetter[256];
int i;
for (i=0; i<256; i++)
hasLetter[i] = 0;

for (i=0; a[i]!='\0'; i++)
hasLetter[a[i]]++;

for (i=0; b[i]!='\0'; i++)
if (hasLetter[b[i]])
return false;

return true;
}

Anonymous said...

Neato. What was your answer for the 20% question?

-Margo

Adam said...

A couple things I thought would be cool for cell phones. Like, a spellchecker (a good one, like in MS Word), and a lyrics lookup (so you could settle lyrics disputes in a car or something).

dangeruss said...

holy crap dude! get hired at google, then by the time i graduate you'll be a hiring rep and then you'll interview me, but sadly i won't have the credentials that you're looking for. damnit. but you'll hire me anyway.

Adam said...

I'm definitely gonna try my hardest to get hired.

I just described this as 'the holy grail' for CS students. "the penantant man shall pass" (Indiana Jones quote... if you didn't pick up on that).

Anonymous said...

Man I want an interview with BCG...

Adam said...

What is BCG?

ppdragon said...

Q#1 answer:
bool isSubset(char* a, char* b)
{
unsigned char hash[32] = {0};
char* p = a;
while (*p) {
hash[*p>>3] |= 1<<(*p&3);
++p;
}
p = b;
while (*p) {
if (0 == (hash[*p>>3]&1<<(*p&3)))
return false;
++p;
}
return true;
}

Anonymous said...

Shouldn't that be

if (!hasLetter[b[i]])
return(FALSE);

???

Anonymous said...

loved ur blog... very motivational. :)
m also a CS grad n trying to switch to a good comapny...