Google Interview Preparation

The software design process boils down to 4 main steps, this interview process is looking for you to show those things.

Requirements - Ask clarifying question
The requirements given are usually vague. The problem to solve isn't the one given. It's the one in your head. People typically prepare with hackerrank or leetcode where they have to specify the problem clearly and with all of the test cases right away because you can't ask any questions. That isn't true in an interview. Ask questions!

Test - Show it works
If you can't determine the input output of your test cases before you start designing you likely don't know what your supposed to be writing yet. Thinking about corner cases and potential pitfalls before you start will save a lot of time. It also forces you to run the program you're about to write in your brain first giving you a better intuitive understanding of your approach.

Design - Explain your algorithm
This lets you show off that you are taking into account different factors and what data structures or algorithms you are considering. Opting for a O(N) instead of O(1) solution might be fine in some cases but it's better to show you know the better solution and explain why you aren't doing it that way. It also lets you chime in if that actually is something you care a lot about. If also provides the opportunity for your interviewer to nudge you toward the solution they're looking for.

Code - Write the code
It's fine to change your design if you need to at this step but you should still have one. Try to write the best code you can despite being in a rush. If you make tradeoffs because you are in an interview say that. "I'm just going to use 's' here instead of 'supercalifragilisticexpialidocious'" because it shows you know you're making a tradeoff for the sake of time etc. 

Watch
The following videos feature Googlers who have been both interviewers and interviewees sharing their unique perspective on how to prepare for Google's technical interviews!
Prep
  • We highly encourage you to practice producing live code and talking through the exercise aloud. Pull out a blank sheet of paper and start writing code, while talking it through to a friend, family member, or to yourself. This will build a high level of comfort as you get on the phone with our engineers and you will feel the conversation go smoother.
  • Check out CareerCup.comPrampInterviewing.io or  LeetCode.
  • Many of the questions asked in Google interviews are open-ended because our engineers are looking to see how you engage the problem. Be sure to talk out-loud your thought process about the questions you are asked, as well as your approach to problems and solutions. Ask specific questions if you need more clarification. Our engineers are not looking for the right answer, but the right approach and methods of thinking, within relevance, say everything you are thinking!
  • As you prepare, build toward thinking about ways to improve the solution you'll present. In many cases, the first answer that springs to mind may need some refining. It is worthwhile to talk about your initial thoughts to a question. A brute force explanation will be received less well than taking time to compose a more efficient solution. Ask clarifying questions if you do not understand the problem or need more information. Many of the questions asked in Google interviews are deliberately underspecified because our engineers are looking to see how you engage the problem. In particular, they are looking to see which areas leap to your mind as the most important piece of the technological puzzle you've been presented.
Our interviews are very technical. It will be based on Computer Science fundamentals. Here are some tips from our engineers on the main areas candidates should prepare when interviewing with Google:

1. Algorithm Complexity: You need to know Big-O. Be sure you are very comfortable with basic big-O complexity analysis 

2. Coding: You will be expected to write some code in at least some of your interviews. You will be expected to know a fair amount of detail about your favorite programming language. Check out Programming Interviews Exposed; Secrets to landing your next job by John Monagan & Noah Suojanen 

3. System Design: 

4. 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 quicksort is impractical, so take a look at it.

5. 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 arrays in your favorite language, in about the space of one interview.

6. 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.

7. 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 its pros & cons. You should know the basic graph traversal algorithms: breadth-first search and depth-first search. Know their computational complexity, their tradeoffs, 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*.

8. 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, and be able to recognize them when an interviewer asks you them in disguise. Find out what NP-complete means.

9. Mathematics: Some interviewers ask basic discrete math questions. This is more prevalent at Google than at other companies because we are surrounded by counting problems, probability problems, and other Discrete Math 101 situations. 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.

10. Operating Systems: Know about processes, threads and concurrency issues. Know about locks and mutexes and semaphores and monitors and how they work. Know about deadlock and livelock and how to avoid them. Know what resources a processes needs, and a thread needs, and how context switching works, and how it's initiated by the operating system and underlying hardware. Know a little about scheduling. The world is rapidly moving towards multi-core, so know the fundamentals of "modern" concurrency constructs.

Comments

Popular posts from this blog

Ace the Amazon Interview

Map in c++