Technical interview guidance
What topics should I study?
Coding - You should know at least one programming language really well. You will be expected to write code in your interviews.
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, quicksort and merge sort). Merge sort can be highly useful in situations where quick sort is impractical, so take a look at it.
Hash Tables - Arguably the most important data structure known to mankind. You absolutely should know how they work. Be able to implement one using only arrays in your favorite language, in about the space of one interview.
Trees - Know about trees: basic tree construction, traversal, and manipulation algorithms. 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/black 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 represent a graph in memory (objects and pointers, matrix, and adjacency list); familiarize yourself with each representation and their pros and cons. You should know the basic graph traversal algorithms: breadth-first search and depth-first search. Know their computational complexities, trade offs, and how to implement them in 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 NP-complete problems, such as traveling salesmen and the knapsack problem, and be able to recognize them when an interviewer asks you them in disguise. Find out what NP-complete means.
Mathematics - Some interviewers ask basic discrete math questions. This is more prevalent to Google than at other companies because counting problems, probability problems, and other Discrete Math 101 situations surrounds us. Spend some time before the interview refreshing your memory on, or teaching yourself, the essentials of combinatorics and probability. You should be familiar with n-choose-k problems and their ilk - the more the better.
Steps for Success
Step 1: Clarify the question
This will help demonstrate your communication skills and save you a lot oftime and avoid misunderstandings
Do not start coding immediately. Share your approach to problem solving, take a moment to explain your approach and how you plan on solving the problem.
A lot of our questions intentionally leave out some information because we want to see what your approach is and how you think so ask those clarifying questions to make sure you have a full understanding of the scope of the question or problem that’s being presented
Now you may still need to make some assumptions during your problem solving and that is totally fine. Just keep the line of communication open and share those assumptions with your interviewer and in turn they will likely give you hints, direction, or feedback to guide you along.
Use those hints! Acknowledge them when they’re given, apply them to your code, and continue to work on your solution.
Step 2: Design your solution
After you’ve clarified the question, plan and design your solution.
If you can’t come up with the most refined solution right away, you can always start with the brute force solution and improve on it. Just let your interviewer know that’s your approach and talk through ways to further optimize and iterate it for a more efficient solution.
Make sure you talk through your algorithms and performances and make sure you handle your edge cases.
Step 3: Write your code
Now that you’ve clarified the question and designed your solution, you can implement it and write your code. If you don’t know the exact API, just ask the interviewer.
Make sure you produce a clean, workable full code, not pseudo code, unless you’re asked to otherwise.
Step 4: Test your code
So now that you’ve written your code, you can’t just assume it works. You need to test it so make sure you’re pacing yourself to leave time to do so.
Walk through your code line by line using your test cases from earlier and try to run through at least 1 or 2 for correctness
If you realize there are ways to improve your solution even more, talk about it! Let your interviewer know that you’re thinking through each step in the process.
You can also talk about different kinds of testing. Tests that verify methods/smaller pieces of logic, and tests are end-to-end and verify the entire solution works when put together


