Google Interview Questions
Google Interview Questions
1. Write a C program which measures the the speed of a context switch on a UNIX/Linux
system?
2. Describe the algorithm for a depth-first graph traversal?
7. Write a function f(a, b) which takes two character string arguments and returns a string
containing only the characters found in both strings in the order of a. Write a version
which is order N-squared and one which is order N?
2. You are shrunk to the height of a nickel and your mass is proportionally reduced so as
to maintain your original density. You are then thrown into an empty glass blender. The
blades will start moving in 60 seconds. What do you do?
3. How much should you charge to wash all the windows in Seattle?
4. How would you find out if a machine’s stack grows up or down in memory?
7. You have to get from point A to point B. You don’t know if you can get there. What
would you do?
III/ Google phone interview
1. The third question was open-ended. The task was to design a model for a file system
implemented in java. The main classes and the interactions between those classes?
3. You have a text file with integer numbers, one number on each line. Your task is to
write a function that reads that file and sums up the numbers?
6. If you have 1 million integers, how would you sort them efficiently? (modify a specific
sorting algorithm to solve this)?