Last year I decided it was time to try something new. After 16 years at Microsoft I found myself wanting to get new experiences and challenges. This meant going through programming interviews again.
This was actually pretty scary. After all, I joined Microsoft out of college so I had only gone through a full interview process once. What if I lucked out the first time? Would I make it through interviews with another company? How would I feel if I didn’t get an offer? I’ve talked about this with a few people and it turns out I was not alone in feeling this way. I guess it’s a form of impostor syndrome.
At Microsoft I had played the role of interviewer plenty of times, which I guess helps. But interviewee, not so much. And over the years I had heard about tons of interview questions I probably wouldn’t have solved. I needed to prepare and brush up on my interview skills and I decided to give myself a few weeks, mostly on nights and weekends since I was still working at Microsoft.
If you are not already a good engineer, I think it’s very unlikely that any amount of interview preparation will land you a job at a top company. But the flip side is also true: you may be a great engineer and not get through interviews. This is a fairly common outcome for two reasons: a) there’s a certain element of randomness (the questions may not match what you are good at, you may draw a blank on a problem, etc.), and b) the best companies have a large enough pool of applicants and they can optimize from precision over recall. Still, I found there’s a lot you can do to tip the odds in your favor.
In the end I interviewed with 4 companies, I’m happy to say with very positive results. I don’t say this to brag, but to highlight that preparation is key. Here I’ll share what I Iearned and what worked well for me.
Getting ready
The first thing that was kind of shocking was to find how much people prepare nowadays. I spent a good amount of time on Quora reading up on questions about programming interviews and was amazed that some people reported preparing for 6 months or even a year for their GOOG/FB/MSFT/AMZN interview! I then started to find a boat load of resources around this.
There are books, online courses, practice sites and even expensive training programs. All of this to say, I think we are seeing a lot of interview prep inflation. And this being a competitive space, it raises the bar and the need for proper preparation. But don’t be discouraged. If you are a smart and solid software engineer you can do pretty well with a reasonable amount of work.
So first things first, you need time so don’t rush it. I told my recruiters I needed time to prepare and they were all happy to accommodate this. Depending on your workload and background, 3-4 weeks should do the trick.
Resources
Books
I went through a good chunk of the advice in these books and it’s a good place to review algorithms and data structures. If I had to pick just one I’d go with Cracking the Coding Interview, but I got value out of all of them.
Disclaimer: The above are affiliate links.
Web sites
There are tons of websites with practice questions, but I primarily used these two:
LeetCode: https://leetcode.com/
This is where I suggest you start and where I practiced the most. I probably did 20+ problems and this does take time. Some (maybe 5?) of the problems I solved on paper to simulate the whiteboard and then transcribed my solution into the web site. The site does very thorough testing of your code, which I found to be both good and bad. The good is that it forces you to really work out all the bugs and solve every corner case. But at some point I was stressing out because some problems took me *many* attempts to get right and a lot of time. I felt like I wouldn’t stand a chance at solving this in a few minutes on the whiteboard. Then I realized that in an actual interview your code is not being tested at that level. You may even have bugs that the interviewer doesn’t catch :). Plus in a real interview it helps a lot to have someone to talk through the problem. So don’t freak out like I did if you really struggle with some of these problems, they are hard.
Pramp: https://www.pramp.com
Pramp is a site where you get paired with other people that are also preparing for interviews and you interview each other. I did 5 mock interviews, which I found helpful since you have a little bit of the time pressure and a real person to interact. Here you get to practice not only your technical skills but how well you communicate, the style of your code and even your general attitude. You’ll exchange feedback with your interviewers in all these categories.
careercup: https://www.careercup.com
This is another good bank of questions. The site was created by Gayle Laakmann McDowel, the author of Cracking the Coding Interview. In addition to algorithmic questions I found some good system design questions in here.
YouTube
The above are great for coding, but most companies will include design and architecture questions, in particular for senior candidates. You can find practice questions on this too (in the above books or on the web), but it’s a bit harder to grade yourself. So I found it very useful to also watch talks and read articles on big systems. Below are a few examples:
Company classes
Both Facebook and Google have interview prep “classes”. I attended both and I think they helped. This is also a good opportunity to clarify things about the process with engineers (in addition to your recruiter). They will give you a different perspective. For example, in one of these classes I found interviewing in C# was ok, whereas my recruiter had said I should brush up on C++.
Programming Interviews – general advice
- Interview with multiple companies. This can not only get you better offers, but it amortizes the effort you put into preparing.
- When scheduling the interviews, ask about usual timelines for getting a response after the interview as these vary significantly by company. Once you know you can schedule them in a way that increases your chances of getting offers around the same time.
- Perhaps in conflict with the above, but schedule the companies you are most interested in last so that you have the most practice.
- Practice coding on a whiteboard if you can, or on paper. It’s significantly different from using an editor.
- In coding questions, focus on the core algorithm. Stub-out simple/helper functions (e.g. things like reversing an array or swapping elements). This is very helpful in interviews since your code is more readable and you write less. You can just say you’ll write them later. Once you’ve solved the problem ask the interviewer if they would like you to implement these helpers; often you won’t have to. This saves you time and whiteboard space, both precious resources.
- As I mentioned above, I spent time trying to brush up on C++, since I was worried about having use mostly C# in the past years. This turned out to be a waste of time. Initially one of the recruiters had told me it would be preferable to interview in C++ instead of C#, but I later got clarification that language didn’t matter. In every single interview, I was able to code in C# without a problem. Still, confirm this with each company.
- I was interviewing for ML Software Engineer roles, and I found that in the actual interviews the ML questions were not hard. Things like knowing when you would use a binary or multi-class classifier to solve a problem, brainstorm features, when/how to regularize, how to split train/test data, etc. These seemed generally basic if you’ve done ML for some time. If that’s not the case, you may want to look at Software Engineering to Machine Learning.
- Request your interview schedule, including who your interviewers will be. Not all companies will provide this, but it can be valuable information. Do your homework and look at the LinkedIn profiles of your interviewers to get a sense of their background. I think reducing the number of unknowns helps make the process less stressful. This can also help you prepare some good questions to ask.
- Make sure you explain your thought process as you try to solve the problems. Bounce ideas off the interviewer. In the end you are being evaluated as a potential college, and being good at expressing ideas and exploring approaches with your peers is a critical skill you want to show.
Interview day
This is a stressful day, no way around it. So you want to have as many things in your favor as possible. My typical routine was to get a good night’s sleep the night before. I’d get up early and go exercise and then have a good breakfast. And I gave myself plenty of time for everything so that I didn’t have to rush or worry. I then practiced power poses and literally smiled, especially a few minutes before the interviews started. As silly as this sounds, I’m pretty convinced it helped. If you are not familiar with power poses, watch this TED talk:
Have a positive attitude and ask lots of questions. I think often all the focus goes to the technical aspects, but your soft skills matter just as much.
Finally, take a look at: 3 Tips for Coding Interviews.
That’s all I can think of! Best of luck and remember to enjoy the process 🙂
Luck is what happens when preparation meets opportunity.
Seneca the Younger
[…] always time pressure during coding interviews. And writing code on a whiteboard creates additional challenges. Here we discuss 3 tips for being […]