Cheat sheet for trainee: step-by-step solution for tasks at a Google interview

image



Last year, I spent the last couple of months preparing for an interview for an internship at Google (Google Internship). Everything went well: I got both a job and a great experience.



Now, two months after the internship, I want to share the document that I used to prepare for the interviews. For me it was something like a cheat sheet before an exam. But the process of creating the document and the constant step-by-step verification on it helped me remember all the most important.



I am sure that anyone can successfully pass interviews in large technology companies, it just takes some time to understand how these interviews work and to prepare for them.



My cheat sheet is enough for you to prepare for any technical interview, be it Google, a startup or your first internship. She will help to feel more confident during the preparation and in the interview itself.

We recommend free programming intensives for beginners:

Java basics in just 3 days - August 8–10;

We are writing the first model of machine learning - August 12-14;

Python messenger development - August 15-17

Cheat sheet for technical interviews



Sites



Pramp



On this resource you can practice interviewing. Participants take turns interviewing each other (there are audio and video channels) and can use a common code editor. Most likely, at the first such interviews it will be difficult for you, and you will feel awkward. But the more you train, the more confidently you go through them, and a real interview after that will seem easy.



Codesignal



Good questions from real-life interviews on Facebook, Google, Microsoft, etc. I recommend using this site along with coding practice resources, including learning about algorithmic complexity.



Books



Cracking the coding interview



My favorite parts are Interview Preparation Grid (p. 32), a section on interview behavior, and Interview Questions: Data Structures (p. 88–107). If you have not previously encountered the term “algorithmic complexity”, then now is the time, the book perfectly introduces the topic.



What to do at the interview?





Job interview step by step



And here is the checklist to prepare for the answer at the interview. It is not necessary to use all the points; skip the ones that seem unnecessary to you. The main thing is to rely on common sense. Even if you have not reached the very end of the list, nothing bad will happen.



  1. Read the question.
  2. Sort all the data, both input and output, and pay attention to side effects.
  3. Clarify the essence of the assignment and voice your assumptions so that the interviewer understands the course of your thoughts. For example, what volumes of data will be and who will become the user.
  4. Look for an example and voice it to the interviewer to be sure that you understand the task correctly. Do not be afraid to spend time delving into the conditions of the problem. The better you understand it, the faster you will find the optimal solution.
  5. Develop an algorithm. Try to solve a similar, but less difficult problem. Write down thoughts, analyze examples in a draft.
  6. Go through your algorithm with examples to make sure the code works correctly. Check all critical and borderline cases.
  7. Estimate the complexity of the algorithm both in time and in memory.
  8. If you were able to come up with a more effective solution to the problem, then go back to step 4.
  9. Write a solution using the selected algorithm. Break the problem down into several methods, if applicable in a particular case.
  10. Check the code for errors.
  11. Think about how the implementation of the algorithm handles critical and boundary cases.
  12. Check the implementation using an example, view the error code.
  13. Once you verify that the code is executing correctly, check its cleanliness and style.


That's all, actually!



All Articles