Is it better to spend all my time on data structures and algorithms rather than side projects, in order to crack the Google and Facebook interviews?

Discussion

Algorithms and Data Structures. Definitely.

Google and Facebook interviews consist of multiple 45-minute coding tests. If you know your algorithms, you will do well. You need to actually understand the algorithms, not just recite them. The questions won’t be like, “implement a heap”. They will be like, “implement a data structure for sending shipments to the most important customers first”. If you recognize this as a priority queue and know how to implement this as a heap in an array, you will do great.

You need to be able to code too. If you have a CS degree, you have spent enough time coding. If you are self-taught, you need enough practice coding to code something unfamiliar.

Most algorithm questions in interviews involve manipulating one or two-dimensional arrays of integers. Practice the shit out of this type of question on interview prep websites. Be sure you get the difference between an index and a count in a zero-based array.

Abstract, abstract, abstract. When writing your algorithm on the whiteboard, create a function to do each subtask. Write out the high-level logic first, then ask the interviewer if he wants you to implement the functions. Chances are reasonable that he will say no, convinced that you know your stuff, or that he’ll ask you to do just one of the functions, to save time. This is a tremendous win for you in an interview.

Interviews may also ask soft-skills questions like how you deal with people's situations, how you like to work, etc. You can prep for this kind of question, to give the “right” answer, but I recommend against it. Better to be honest and not get into a job where you won’t fit in.

Posted Mar 12, 2020, 6:24 AM UTC

10
Loading comments…