I am preparing for an interview with Google (Mountain View) I was wondering if anybody could share some of the questions and experiences.
I have been told that they ask both brain teasers and coding/algorithm questions this time
Steve Yegge's Get That Job At Google [1] is the best resource I know of.
[1] http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.htmlEach interviewer is encouraged to think up their own questions, and we have a list of "banned" questions that are too widely known. Also, if you already know about the question it will be pretty obvious to the interviewer, and they'll either make it harder or just ask a different one.
Steve Yegge's advice that Simucal referenced is really good. Basically, know your stuff and don't be too downhearted if you don't get in. (Pretty much everyone I talk to at work says they're the fluke that did get in and shouldn't have done. We all view the recruiting process as a really, really high bar.)
Good luck!
I have worked for Google and Microsft and done a ton of these interviews. We just published a book called " Algorithms for Interviews [1]". Me and my co-author have put in 2 years of effort in it and we think the end result is very nice. I'd highly recommend it to anyone who is preparing for an algorithms/coding interview. Also, I'd love to get your feedback on the book at amit@algorithmsforinterviews.com
Here is a sample of problems from the book:
A triomino is formed by joining three unit-sized squares in an L-shape. A mutilated chessboard is made up of 64 unit-sized squares arranged in an 8-by-8 square, minus the top left square.
Design an algorithm which computes a placement of 21 triominos that covers the mutilated chessboard.
The mathematician G. H. Hardy was on his way to visit his collaborator S. Ramanujan who was in the hospital. Hardy remarked to Ramanujan that he traveled in a taxi cab with license plate 1729, which seemed a dull number. To this, Ramanujan replied that 1729 was a very interesting number - it was the smallest number expressible as the sum of cubes of two numbers in two different ways. Indeed, 10x10x10 + 9x9x9 = 12x12x12 + 1x1x1 = 1729.
Given an arbitrary positive integer, how would you determine if it can be expressed as a sum of two cubes?
There are fifty coins in a line---these could be pennies, nickels, dimes, or quarters. Two players, $F$ and $S$, take turns at choosing one coin each---they can only choose from the two coins at the ends of the line. The game ends when all the coins have been picked up. The player whose coins have the higher total value wins. Each player must select a coin when it is his turn, so the game ends in fifty turns.
If you want to ensure you do not lose, would you rather go first or second? Design an efficient algorithm for computing the maximum amount of money the first player can win.
You are given two sorted arrays. Design an efficient algorithm for computing the k-th smallest element in the union of the two arrays. (Keep in mind that the elements may be repeated.)
For more sample problems, you can look here [2].
[1] http://algorithmsforinterviews.comI've put together 140 Google interview questions. You might find it helpful.
Check it out: http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
I remember reading somewhere that interviewees at Google have to sign an NDA about the questions being asked. So how do you expect people to tell you what questions they have asked?
Anyway, as aku said, search the Internet.. you might not find specific questions, but you will get to know in which areas they ask questions from...
All the best!!
I had phone interview with google for software engineer position. I was asked to develop a cache interface and implementation in java.
public interface ServerCache {
public void storeCache(String keyOfObject, Object objectToStore);
public Object getCachedObject(String keyOfObject);
}
public class ServerCacheImp implements ServerCache {
LinkedList queue = new LinkedList();
Hashtable cacheStorage = null;
public ServerCacheImpl() {
cacheStorage = new Hashtable();
}
public Object getCachedObject(String keyOfObject) {
queue.remove(keyOfObject);
queue.add(keyOfObject);
return cacheStorage.get(keyOfObject);
}
public void storeCache(String keyOfObject,Object objectToStore) {
String key=””;
Object existingObj=cacheStorage.get(keyOfObject);
if(cacheStorage.get(keyOfObject)!=null&&existingObj.equals(objectToStore)){
return;
}
if(queue.size()>1000){
key=(String)queue.remove();
cacheStorage.remove(key);
}
queue.add(keyOfObject);
cacheStorage.put(keyOfObject,ObjectToStore);
}
}
Although not directly related you might want to check this previous discussion:
interview-programming-test-practice [1]
Or this book: Programming-Interviews-Exposed-Secrets-Landing/ [2]
[1] http://stackoverflow.com/questions/35901/interview-programming-test-practiceFor a software engineer I found this link pretty good
http://mysubwaydream.blogspot.com/2011/01/google-interview-questions.html
I'm surprised no one's linked to the list of 10 questions that was printed U(W)'s *math*NEWS in 2008: Ten Google interview questions - Actual, real interview questions! [1]. Having been through google interviews myself and coached friends, these are good practice questions.
As others point out, Steve Yegge's post [2] is the first thing to read.
Then, you must practice with paper or a whiteboard. Get a friend over, give them some beers, and have them pick questions from any of these lists and ask them to you. If they think you've made a mistake, they should say "are you sure that's correct?". If you provide an algorithm that's not optimal, they should say "is there any faster way to do it?".
First you should simply describe a simple solution, and then iteratively improve it. Also, be sure to go through examples that you create at the start to show that you understand the problem and to get some different forms of the input data into your head.
[1] http://www.mathnews.uwaterloo.ca/Issues/mn10704/googlequestions.phpI'm not kidding, when Google conducted interview in our college in Bangalore...
I got very weird questions completely out of scope like "How many buses does local transport corporation [1] own ?"
So, be ready with some local facts
n Best of luck :)
[1] http://www.bmtcinfo.com/english/index.htmTake a look on this web site http://google-interview.com Seems they gather all "google stories" mentioned above.
I used this one earlier for Google Interview questions Few more good ones are found here as well. http://www.freshersinterviewquestions.com/category/google-interview-questions/
You can check the following sites, they have a lot of Google questions and for other companies as well
My Career Stack [1]
LeetCode [2]
[1] http://learn.hackerearth.com/questions/?company=Google