Preparation guide for google:
Start with Blog.
Suggestions on reading material include:
- Algorithm / Data Structure Theory books
- Google Style Guides (C++, Python, Java; Android, J
avascript)
- Coursera - Algorithms, Part 1
- Coursera - Algorithms, Part 2
- Udacity - Intro to Algorithms
- MIT Open courseware - Introduction to Algorithms
Several site that provide similar problems to those typically asked in the interview are (medium-hard questions):
- HackerRank (highly encouraged)
- Geeksforgeeks (highly encouraged)
- Topcoder
- Codeforces
- Leetcode (highly encouraged)
- InterviewBit (highly encouraged)
- Kattis
- Problems from Cracking the Coding Interview Book
- List of ACM-ICPC questions/ codejam questions
This will help get you into the problem-solving mindset.
Here are a couple of extra videos which are definitely worth watching before your interview:
1) Example of a Coding Interview
2) How to best prepare for a technical interview: Preparation
Besides, this is a gitHub link on Computer Science (CS) fundamentals which does a good job as checklist on what you should master in order to prepare for coding at Google.
We do expect you to know a lot about algorithms and data structures and especially be able to to implement them into your solutions - there is a great bigocheatsheet <http://bigocheatsheet.com/> that may also help you!
During the interview:
Ask yourself!
- Do you feel confident with CS fundamentals?
- Do you listen well?
- Do you know what to ask to clarify the questions?
- Can you find the optimal solution of the complicated coding/algorithm problems, present it in a very efficient/clean coding (no/less bug), and share your thoughts logically?
- Is your problem solving and coding speedy and efficient with your profound knowledge in CS fundamentals?
- Have you covered off edge cases?
Many thanks and as always feel free to approach me if you have any questions!
Watch: Google for India | Interview tips from Google software engineers
Approach
- Tip 1: Think out Loud & Communicate your Thought Process
- Google interviewers are accessing you based on your problem solving skills, and want to know your full thought process behind why and how you derived the final result
- The best approach I can share is to Talk through your entire thought process & explain about your approach, how you derive a certain algorithm, explain the trade offs, and discuss the complexity of the solutions you are proposing and explain your code (Talk and Code).
- Most important would be to pick the right data structure and algorithm for a specific problem! Talk about how they're implemented and why you'd choose one implementation or data structure instead of another.
- Do not mumble to yourself or keep silent when thinking.
- Tip 2: Ask Clarifying Questions (Very Important!)
- Never jump straight and code up the solution. Always take a pause, look at the interview question and ask some clarifying questions
- These clarifying questions should enable you to cover for edge/boundary cases better and to define the scope of the question
- Eg:"Describe a good algorithm for sorting a million numbers"
- Good Clarifying Questions:
- What is the range of the numbers? How are they distributed? Are the numbers integers or floating points? How much memory is available? Are there duplicates?
- Tip 3: Discuss algorithmic complexities & Identify all Edge Cases Independently
- For Algorithms, you need to know big-o notation very well.
- Always state time complexity and space complexity upfront.Think of how you can reduce the complexity further to reach an optimised solution!
- Distinguish between average case/worst case runtime
- Consider amortized time complexities!
- The goal is to reach the most optimised solution at the end of the interview, and to have a complete working solution.
- Tip 4: Test your Code
- Check for boundary conditions!
- Stress tests to ensure that the code runs within time constraint
- Create tests that have 100% code coverage
- Rectify any bugs in your code before the interviewer points it out
- Tip 5: Ensure Good Code Quality on Google Docs
- You are expected to code in Google Docs. Since it does not have any IDE, you are expected to type out your code from scratch
- Type as close to real working fully functional code as possible. This code should be maintainable and readable by a large database of engineers
- Your code is supposed to be very readable. Code in the latest version of your preferred language and use appropriate language constructs. Take care of variable names and syntax.
- Do not code Pseudo code or shortcuts, it is not good enough.
- Always cover for Edge/Boundary cases
- Tip 6: Positive & Independent Attitude & Being Open to Feedback
- If you get stuck, stay calm, asking questions can help to reduce the scope of the problem.
- Aim to solve as much independently as possible, ideally with as few hints as possible.
- Always take initiative in the interview, and treat it like a technical discussion.
- Listen attentively to the interviewer, and integrate the hints/suggestions by the interviewer to your solution.
Interview Preparation Plan (From Google Software Engineer)
- 1. Revise all concepts on data structures & algorithms (Geekforgeeks)
- 2. Structured Revision plan on the topics that to cover (Eg. hashtable, hashmaps, trees, arrays, strings, graphs, dynamic programming and more)
- Practising per category
- Practice up to a level that you reach competency - Solve the question in 20 minutes, come up with the optimal solutions, with close to zero hints, no bugs
- 3. Practice Problem identification by picking random problems and practice identifying “Which category does this problem belong to? Backtracking/Dynamic programming? Solution/Algorithmic design?”.
- Practice coding without an IDE, be familiar with the differences in how you should write code in Google Docs. Do practise coding in Google Docs and timing yourself and talking and coding at the same time!
- Advice: Practise a wide variety of questions, and also to simulate the actual the interview condition!
Time Allocation During Interview (Suggestion from Googler)
- Solve 1 question in 20mins
- 2 mins for gathering all requirements and asking clarifying questions from the interviewer.
- Approx 8-10 mins for coming up with valid solution to the question, discussion with the interviewer about my solution, tradeoffs, it's time and space complexity.
- 5 mins for coding the solution.
- 5 mins for dry run (sample test cases) along with discussion with the interviewer.
Frequently asked topics (in no particular order)
- Binary search
- BFS/DFS/Flood fill
- Tree traversals
- Hash tables
- Linked list, stacks, queues, two pointers/sliding window
- Binary heaps
- Dynamic programming
- Union find
- Ad hoc/string manipulations
- Other good to know topics: Trie, segment trees/fenwick trees, bitmask
- Google Interview Style Guides (C++, Python, Jav
a; Android, Javascript)
- You'll be expected to know and apply: lists, maps, stacks, priority queues, binary trees, graphs, bags, and sets.
- For algorithms you'll want to know greedy algorithms, divide and conquer, dynamic programming, recursion, and brute force search.
- You'll definitely want to be conversant with bigO notation, timespace complexity, and real world performance of all of this.
Strategy for Success (Framework)
- Step 1: Clarify the problem
- Step 2: Define your approach
- Step 3: Propose a solution
- Propose a solution before coding. Faster to find mistakes verbally than coding out a solution that may be incorrect
- Feel free to say that your first solution will be refined later
- Run through at least one or two examples to check for correctness
- Use reasonable variable names or clean up the code after the first pass
- Ask if the interviewer has any questions before refinement
- Step 4: Propose an alternative solution
- (Ask your interviewer if you have time to find a better solution/ If so, clarify assumptions (e.g., improving performance)/ Rinse, repeat/ Compare the solutions)
- Step 5: Implementation
Useful Resources
Please go through the attached Google Interview Prep Guide
- Start your preparation with Steve Yegge’s Blog and go through our website for Interview Preparation Tips
- Watch these 3 videos on Youtube:
- Google Technical Interview Workshop Recording
- Prepping for a Technical Interview
- Example Coding Interview
- Cracking the Coding Interview: This is one of the most helpful book you may find!!
Start with Blog.
Suggestions on reading material include:
- Algorithm / Data Structure Theory books
- Google Style Guides (C++, Python, Java; Android, J
avascript) - Coursera - Algorithms, Part 1
- Coursera - Algorithms, Part 2
- Udacity - Intro to Algorithms
- MIT Open courseware - Introduction to Algorithms
Several site that provide similar problems to those typically asked in the interview are (medium-hard questions):
- HackerRank (highly encouraged)
- Geeksforgeeks (highly encouraged)
- Topcoder
- Codeforces
- Leetcode (highly encouraged)
- InterviewBit (highly encouraged)
- Kattis
- Problems from Cracking the Coding Interview Book
- List of ACM-ICPC questions/ codejam questions
This will help get you into the problem-solving mindset.
Here are a couple of extra videos which are definitely worth watching before your interview:
1) Example of a Coding Interview
2) How to best prepare for a technical interview: Preparation
Besides, this is a gitHub link on Computer Science (CS) fundamentals which does a good job as checklist on what you should master in order to prepare for coding at Google.
We do expect you to know a lot about algorithms and data structures and especially be able to to implement them into your solutions - there is a great bigocheatsheet <http://bigocheatsheet.com/> that may also help you!
During the interview:
Ask yourself!
- Do you feel confident with CS fundamentals?
- Do you listen well?
- Do you know what to ask to clarify the questions?
- Can you find the optimal solution of the complicated coding/algorithm problems, present it in a very efficient/clean coding (no/less bug), and share your thoughts logically?
- Is your problem solving and coding speedy and efficient with your profound knowledge in CS fundamentals?
- Have you covered off edge cases?
Many thanks and as always feel free to approach me if you have any questions!
Watch: Google for India | Interview tips from Google software engineers
Approach
- Tip 1: Think out Loud & Communicate your Thought Process
- Google interviewers are accessing you based on your problem solving skills, and want to know your full thought process behind why and how you derived the final result
- The best approach I can share is to Talk through your entire thought process & explain about your approach, how you derive a certain algorithm, explain the trade offs, and discuss the complexity of the solutions you are proposing and explain your code (Talk and Code).
- Most important would be to pick the right data structure and algorithm for a specific problem! Talk about how they're implemented and why you'd choose one implementation or data structure instead of another.
- Do not mumble to yourself or keep silent when thinking.
- Tip 2: Ask Clarifying Questions (Very Important!)
- Never jump straight and code up the solution. Always take a pause, look at the interview question and ask some clarifying questions
- These clarifying questions should enable you to cover for edge/boundary cases better and to define the scope of the question
- Eg:"Describe a good algorithm for sorting a million numbers"
- Good Clarifying Questions:
- What is the range of the numbers? How are they distributed? Are the numbers integers or floating points? How much memory is available? Are there duplicates?
- Tip 3: Discuss algorithmic complexities & Identify all Edge Cases Independently
- For Algorithms, you need to know big-o notation very well.
- Always state time complexity and space complexity upfront.Think of how you can reduce the complexity further to reach an optimised solution!
- Distinguish between average case/worst case runtime
- Consider amortized time complexities!
- The goal is to reach the most optimised solution at the end of the interview, and to have a complete working solution.
- Tip 4: Test your Code
- Check for boundary conditions!
- Stress tests to ensure that the code runs within time constraint
- Create tests that have 100% code coverage
- Rectify any bugs in your code before the interviewer points it out
- Tip 5: Ensure Good Code Quality on Google Docs
- You are expected to code in Google Docs. Since it does not have any IDE, you are expected to type out your code from scratch
- Type as close to real working fully functional code as possible. This code should be maintainable and readable by a large database of engineers
- Your code is supposed to be very readable. Code in the latest version of your preferred language and use appropriate language constructs. Take care of variable names and syntax.
- Do not code Pseudo code or shortcuts, it is not good enough.
- Always cover for Edge/Boundary cases
- Tip 6: Positive & Independent Attitude & Being Open to Feedback
- If you get stuck, stay calm, asking questions can help to reduce the scope of the problem.
- Aim to solve as much independently as possible, ideally with as few hints as possible.
- Always take initiative in the interview, and treat it like a technical discussion.
- Listen attentively to the interviewer, and integrate the hints/suggestions by the interviewer to your solution.
Interview Preparation Plan (From Google Software Engineer)
- 1. Revise all concepts on data structures & algorithms (Geekforgeeks)
- 2. Structured Revision plan on the topics that to cover (Eg. hashtable, hashmaps, trees, arrays, strings, graphs, dynamic programming and more)
- Practising per category
- Practice up to a level that you reach competency - Solve the question in 20 minutes, come up with the optimal solutions, with close to zero hints, no bugs
- 3. Practice Problem identification by picking random problems and practice identifying “Which category does this problem belong to? Backtracking/Dynamic programming? Solution/Algorithmic design?”.
- Practice coding without an IDE, be familiar with the differences in how you should write code in Google Docs. Do practise coding in Google Docs and timing yourself and talking and coding at the same time!
- Advice: Practise a wide variety of questions, and also to simulate the actual the interview condition!
- Solve 1 question in 20mins
- 2 mins for gathering all requirements and asking clarifying questions from the interviewer.
- Approx 8-10 mins for coming up with valid solution to the question, discussion with the interviewer about my solution, tradeoffs, it's time and space complexity.
- 5 mins for coding the solution.
- 5 mins for dry run (sample test cases) along with discussion with the interviewer.
- Binary search
- BFS/DFS/Flood fill
- Tree traversals
- Hash tables
- Linked list, stacks, queues, two pointers/sliding window
- Binary heaps
- Dynamic programming
- Union find
- Ad hoc/string manipulations
- Other good to know topics: Trie, segment trees/fenwick trees, bitmask
- Google Interview Style Guides (C++, Python, Jav
a; Android, Javascript) - You'll be expected to know and apply: lists, maps, stacks, priority queues, binary trees, graphs, bags, and sets.
- For algorithms you'll want to know greedy algorithms, divide and conquer, dynamic programming, recursion, and brute force search.
- You'll definitely want to be conversant with bigO notation, timespace complexity, and real world performance of all of this.
- Step 1: Clarify the problem
- Step 2: Define your approach
- Step 3: Propose a solution
- Propose a solution before coding. Faster to find mistakes verbally than coding out a solution that may be incorrect
- Feel free to say that your first solution will be refined later
- Run through at least one or two examples to check for correctness
- Use reasonable variable names or clean up the code after the first pass
- Ask if the interviewer has any questions before refinement
- Step 4: Propose an alternative solution
- (Ask your interviewer if you have time to find a better solution/ If so, clarify assumptions (e.g., improving performance)/ Rinse, repeat/ Compare the solutions)
- Step 5: Implementation
Useful Resources
Please go through the attached Google Interview Prep Guide
- Start your preparation with Steve Yegge’s Blog and go through our website for Interview Preparation Tips
- Watch these 3 videos on Youtube:
- Google Technical Interview Workshop Recording
- Prepping for a Technical Interview
- Example Coding Interview
- Cracking the Coding Interview: This is one of the most helpful book you may find!!