Google Phone Interview Set For February 9th!
I got an email from the recruiter at Google today. My phone interview is set for February 9th, so I have 4 good days to get ready for it. I’ve been looking at the giant algorithms book, just refreshing myself on stuff like O notation, common sorting algorithms like mergesort, and stuff like that.
I should probably move on to more complicated algorthms next like Dijkstra’s Algorithm and dynamic programming algorithms like the all pairs shortest path algorithm. I don’t think Google would ask me about specific implmentations of these, but it would be good practice to get back into the mindset of designing algorithms this complex, since I haven’t had to do so in a while.
I saw a sample interview question from some blog asking about defining a function f(a,b) to return a string that is all of the characters in a (in order) that are also in b. They ask for an order n2 as well as an order n algorithm. The n2 one seems trivial, but I can’t think of how to calculate a set intersection (which is what I think the problem boils down to) in order n time… I could try and prove that it would be impossible to do it in n time, but I don’t really want to do that either. Plus I’m not sure if it is impossible…
Edit: Okay, so apparently they’re “strings” for a reason. The N solution is pretty easy. I was trying to solve a more complex problem in N, when I just needed to take a look at the actual question being asked. I guess I should do regular sanity checks during the interview and not try to accomplish more than they ask.
Well, back to the book for me.
Comments
Leave a Comment
Comments are moderated and won't appear immediately after submission.
Hi Mine is tomorrow too! I interview for a marketing position in Tel Aviv. Best of luck Tal
wondering how ur google interview goes? any details?
It went ok. I guess I can write a new post about it. I won’t include any huge details though.
did your review of old algorithm books help?
Yeah. Check this out.
This is a very old thread. But I want to add my thoughts regarding Set intersection in linear time. I think, we first need to create a hashtable with the elements of array b. Then, we can run a loop in array a and look for the current array a element in hashtable. Here, due to hashtable the look up will take O(1) time. So, overall O(n).