Interview Cheat Sheet
From Andrei Neagoie's Master The Coding Interview: Data Structures + Algorithms
The 3 pillars of good code:
Readable1.
Time Complexity2.
Space Complexity3.
What skills interviewer is looking for:
Analytic Skills - How can you think through problems and analyze things?
Coding Skills - Do you code well, by writing clean, simple, organized, readable code?
Technical knowledge - Do you know the fundamentals of the job you're applying for?
Communication skills: Does your personality match the companies’ culture?
Step By Step through a problem:
When the interviewer says the question, write down the key points at the top (i.e. sorted1.
array). Make sure you have all the details. Show how organized you are.
Make sure you double check: What are the inputs? What are the outputs?2.
What is the most important value of the problem? Do you have time, and space and memory,3.
etc.. What is the main goal?
Don't be annoying and ask too many questions.4.
Start with the naive/brute force approach. First thing that comes into mind. It shows that5.
you’re able to think well and critically (you don't need to write this code, just speak about it).
Tell them why this approach is not the best (i.e. O(n^2) or higher, not readable, etc...)6.
Walk through your approach, comment things and see where you may be able to break things.7.
Any repetition, bottlenecks like O(N^2), or unnecessary work? Did you use all the information
the interviewer gave you? Bottleneck is the part of the code with the biggest Big O. Focus on
that. Sometimes this occurs with repeated work as well.
Before you start coding, walk through your code and write down the steps you are going to8.
follow.
评论0