Algo Tips
Algo Tips
The interview will include topics such as coding, data structures, algorithms, c
omputer science theory, and systems design. We recommend you spend some time exp
loring our website to get into the right mind frame. Google Publications and Lab
s is a good starting point.
Google Labs Links:
Research at Google
Research at Google
System
Google
Google
Google
Design Publications:
File System (The Google File System)
Bigtable (Google Research Publication: Bigtable)
MapReduce (Google Research Publication: MapReduce)
"Introduction to Algorithms"
Authors: Cormen, Leiserson, Rivest & Stein
Please review the following topics:
Big-O notations also known as "the run time characteristic of an algorithm". You
may want to refresh hash tables, heaps, binary trees, linked lists, depth-first
search, recursion. For more information on Algorithms you can visit:
Algorithm Tutorials
Coding: You should know at least one programming language really well, and it sh
ould preferably be C++ or Java. C# is OK too, since it's pretty similar to Java.
You will be expected to write some code in at least some of your interviews. Yo
u will be expected to know a fair amount of detail about your favorite programmi
ng language.
Sorting: Know how to sort. Don't do bubble-sort. You should know the details of
at least one n*log(n) sorting algorithm, preferably two (say, quick sort and mer
ge sort). Merge sort can be highly useful in situations where quick sort is impr
actical, so take a look at it.
Hashtables: Arguably the single most important data structure known to mankind.
You absolutely should know how they work. Be able to implement one using only ar
rays in your favorite language, in about the space of one interview.
Trees: Know about trees; basic tree construction, traversal and manipulation alg
orithms. Familiarize yourself with binary trees, n-ary trees, and trie-trees. Be
familiar with at least one type of balanced binary tree, whether it's a red/bla
ck tree, a splay tree or an AVL tree, and know how it's implemented. Understand
tree traversal
Algorithms: BFS and DFS, and know the difference between inorder, postorder and
preorder.
Graphs: Graphs are really important at Google. There are 3 basic ways to represe
nt a graph in memory (objects and pointers, matrix, and adjacency list); familia
rize yourself with each representation and its pros & cons. You should know the
basic graph traversal algorithms: breadth-first search and depth-first search. K
now their computational complexity, their tradeoffs, and how to implement them i
n real code. If you get a chance, try to study up on fancier algorithms, such as
Dijkstra and A*.
Other Data Structures: You should study up on as many other data structures and
algorithms as possible. You should especially know about the most famous classes
of NP-complete problems, such as traveling salesman and the knapsack problem, a
nd be able to recognize them when an interviewer asks you them in disguise. Find
out whatNP-complete means.
Mathematics: Some interviewers ask basic discrete math questions. This is more p
revalent at Google than at other companies because counting problems, probabilit
y problems, and other Discrete Math 101 situations surrounds us. Spend some time
before the interview refreshing your memory on (or teaching yourself) the essen
tials of combinatorics and probability. You should be familiar with n-choose-k p
roblems and their ilk
the more the better.
Operating Systems: Know about processes, threads and concurrency issues. Know ab
out locks and mutexes and semaphores and monitors and how they work. Knowabout d
eadlock and livelock and how to avoid them. Know what resources a processes need
s, and a thread needs, and how context switching works, and how it's initiated b
y the operating system and underlying hardware. Know a little about scheduling.
The world is rapidly moving towards multi-core, so know the fundamentals of "mod
ern" concurrency constructs.