Google Interview Tips + FAQs + Resources
- 6 minsI will be interning at Google as a SWE Intern in 2020. I often get a lot of questions asking me how to start preparing and how to start coding. Here, I am sharing a few things that I have learnt during my preparation. In this blog post, I have also tried to clear some of the common questions every student has regarding interview preparation. I have also included resources that helped me during my preparation !
Why should you do Leetcode?
I have explored many sites and in the end I found leetcode to be the best.
Sites like CodeChef, Codeforces, SPOJ are really good but they are not interview/job focused, they lean more towards competitive programming. If your aim is to go compete at ACM ICPC, by all means practice at those sites.
For interview preparation, the top sites are Leetcode, GeeksForGeeks and Interview Bit. Leetcode beats the other two sites handsdown. While the theory in GeeksForGeeks is good (it is often coded inefficienty) and their practice platform has weak testcases. InterviewBit has a good collection of questions but their list is limited, also they do not have a vibrant community.
Leetcode has everything that a good site should, amazing list of questions, good editorials, really good testcases as well as a community(best thing). The discuss section has amazing discussions, sometimes the solutions here are better than those in the editorial.
I am intimidated by the list of questions, where should I start ?
First and foremost, there is no reason to be intimidated, we all have to start somewhere :) If you are a complete beginner, start with Top 100 Liked Questions and Top Interview Questions. Sort them by difficulty level and do the easy ones, followed by medium and then hard.
How should I solve each question ?
Everyone has a different way of approaching problems, I initially looked up the solution to every problem but when I gave the Weekly Contests(another amazing feature! more about it later) I realized my technique wasn’t working. I then thought about a question and worked out a basic algorithm and then coded. If it took more than a certain amount of time, I saw the solution.
Here is a curated list of “how to leetcode” from various people, do give it a read ! It is helpful :
- Leetcode Grinding Guide.Reddit
- Patterns on Leetcode Problems
- Want to crack Leetcode problems easily ?
- r/cscareerquestions - I have to literally lookup up every leetcode solution. Is it normal?
- how-to-leetcode-effectively
How do I measure my performance, I am solving questions but am I improving ?
ONE WORD - WEEKLY CONTESTS. Initially when I started giving weekly contests I would not be able to solve even a single question,but with practice I started solving two to three. It motivated me to work harder every week and manage time better.
How “MANY” questions should I solve ?
It is not about the number of questions rather it is about “how” well you understand the concepts and are able to approach new problems. Inspite of that, doing the Top Interview Questions should be a must.
Other tips
- Read as many interview experiences of people as you can from Leetcode Discuss.
- Ask doubts in Leetcode Discuss for each question.
- If your interview is nearing, take Leetcode Premium and do company wise questions (very helpful).
What are the important topics I should study ?
Big O Notation
- Theory
- Practice problems from Cracking the Coding Interview
Arrays and Maths
- Practice a lot of Questions on Arrays and Maths. Some important topics are mentioned below.
- Circular Arrays - Typical ways to solve on Leetocode
- Boyer Moore Voting Algorithm Leetcode
- Two Sum Problem - Leetcode
- Three Sum Problem - Leetcode
- Four Sum Problem - Leetcode
- Buy and Stock problem - Leetcode
- Buy and Stock problem II - Leetcode
- Buy and Stock problem III - Leetcode
- Buy and Stock problem IV - Leetcode
- Buy and Stock With Cooldown - Leetcode
- Questions relating to Palindromes.
- Longest Palindromic Subsequence
- Finding square root of a number in logn time - Leetcode
- Subarray and Subsequence problems.
Binary Search
Bitwise manipulation
- A summary: how to use bit manipulation to solve problems easily and efficiently - LeetCode Discuss
- Good website to visualize bitwise operations
- https://www.geeksforgeeks.org/bits-manipulation-important-tactics/
Trees
- Pre-order(BOTH recursive and iterative)
- Post-order(BOTH recursive and iterative
- In-order(BOTH recursive and iterative
- N-ary Tree Pre-order Traversal
- N-ary Tree Pre-order Traversal
- N-ary Tree Level Order Traversal
- Maximum Depth of N-ary Tree
- Serialization and deserialization of trees - Leetcode
- Binary Search Tree
- Lowest Common Ancestor - Leetcode
- Morris In-order traversal by Tushar Roy (Video)
- Threaded Binary Tree
Recursion and Backtracking
- Recursion and Backtracking Tutorial
- Blog by csgator(BEST)
- Interview Bit Theory
- Turnpike problem
- Word break Problem Leetcode
- Word break Problem 2 Leetcode
- Letter combinations of a phone-number Leetcode
Graphs
- Representing graphs
- DFS, BFS Explanation by csgator(BEST)
- Topological Sorting
- Prims and Kruskal
- Dijikstra
- Dijkstra on sparse graphs - Competitive Programming Algorithms
- Number of Islands
- Friend Circles
- Decode String
Geometry
Hashing
- map vs unordered_map in C++ - GeeksforGeeks
- Design HashMap
- Design Hashset
- Sliding Window algorithm template to solve all the Leetcode substring search problem. - LeetCode Discuss (This is important !)
- String Hashing
Linked List
- Insertion
- Deletion of Node
- Reverse Linked List (iterative and recursive)
- Circular Linked List
- Doubly Linked List
- Floyd’s Cycle Detection Algorithm
- Linked List Cycle - Leetcode
- LRU Cache - C++ Implementation - Bhrigu Srivastava
- Copy list with random-pointer (BEAUTIFUL QUESTION!)
Dynamic Programming
- TopCoder Article (VERY IMPORTANT!!! MUST)
- Top 20 DP questions(Geeks for geeks) Important!
- Tushar Roy DP playlist
- Do Questions from Interview Bit (Good List) :P
- Top 50 DP questions
- Difference between DP and Divide and Conquer
Disjoint Set Union
Sorting
- Be clear with the basic algorithm and time complexity of all sorting algorithms.
- Additionally read up count sort, bucket sort and radix sort.
Greedy
System Design
- Leetcode System Design Posts
- System Design Videos (Sufficient for prep)
- System Design Resources
- How to succeed in a System Design Interview
For now these are the topics that I feel are important for interview, obviously this is not a exhaustive list :)
Google Interview Tips
- Practice coding on google docs.
- Write variable and function names that are descriptive.
- Be honest. Do not bluff.
- Be vocal, explain your approach while coding.
- Give a lot of mock interviews to friends in real environment.
- Do a lot of leetcode.
- Be confident !
Hope this blog post helped you ! All the best ! Feel free to post any questions :)
[This blog post was originally published on Leetcode]