How to ACE Coding Interviews

Cracking the coding interview requires more than just skill and practice; you need a winning strategy. Learn how I ACED my Google, Microsoft, and Amazon coding interviews. πŸ‘‘

Nine Tips

Hey Pirates πŸ΄β€β˜ οΈ A coding interview is probably the biggest hurdle in anyone's software engineering career. If you want to become a software engineer, you must eventually face a coding interview. If you are already one, you know how challenging it is. As a software engineer who passed numerous FAANG coding interviews and received multiple offers from Google, Microsoft, and Amazon, I'll share my Nine Tips on How to ACE a Coding Interview. Moreover, I'll walk you through the entire process using my interview questions as examples, so watch until the end.

1. 10-30-60 Time Management

A typical coding interview is about 45 minutes. The expectation is to solve at least two LeetCode-style problems within the time limit. Of that, spend 10% on the small talk, 30% on the warmup question, and 60% on the follow-up question. Generally, most interviewers will break the ice with an introduction and end a few minutes early to leave room for questions. Remember this. Try not to waste any time on this useless piece of crap. I repeat. minimize the time spent on worthless talks. This is a technical coding interview where they assess your technical skills. Frankly, this happened to me. But if the interviewer, for some reason, loses themselves and rambles on, tell them to shut the f*** up - politely and respectfully. Every minute counts in a setting where you only have 15 to 20 minutes to solve a problem. Most of your interview time should be spent on solving problems. Be concise about your introduction and manage your time well. Never lose control of your own interview.

2. Ask clarifying questions

When you are given a problem, always begin by asking clarifying questions. Most coding interview problems are purposely vague. Your job, as the interviewee, is to clear the ambiguities. How? By asking the right questions. Here's the question I got from a FAANG phone screen: "Given a map, how would you count the number of islands?" I know this is a famous LeetCode question, but notice how I wasn't given the function signature. This is how I tackled it:

"Is the definition of an island a piece of land surrounded by water?”
”How about I use 0 and 1 to represent water and land?”
β€œCan I view the map as a 2D array of 0s and 1s?"

Do you see how I turned an open-ended question into a computer science problem? 😎 Another common mistake candidates make is making assumptions; don't assume anything. Instead, ask. For example, can the input be null or empty? Is the array sorted? If the input is an integer, can it be zero or negative? What about a string? Does it only contain lowercase English letters? Identifying the constraints is the key to simplifying your solution.

3. LeetCode Cheat Sheet

Use my LeetCode cheat sheet to quickly identify the problem type. The cheat sheet comprehensively summarizes the most common question patterns and critical concepts. Remember, every minute counts in a coding interview. Taking advantage of my LeetCode cheat sheet can help you save precious time tremendously. For example, if the problem states the input array is sorted, it's probably a binary search or a two-pointer problem. Did you know that the in-order traversal of a binary search tree visits each node in a sorted fashion? Use a priority queue if the question asks you to find the kth largest or smallest element. The cheat sheet is available for free on my website here. Watch this video for a detailed guide on how to make the most out of it.

4. Communicate

The goal of the interview is for the interviewer to collect as many positive signals from the candidates as possible. These signals start with your communication. Think out loud. Don't keep your thoughts to yourself. Share your thought process to help the interviewers follow along. Don't jump straight to coding either; always confirm your strategy before you do. If you have the right approach, then great. If not, well, now you have the chance to correct it. Don't be afraid to make mistakes either; interviewers are there to help you. If you need time to think, let the interviewer know. It's okay to ask for some quiet time to think. But once you have a solid strategy, break the silence and get ready to present. Remember. Your ultimate goal as an interviewee is to win the interviewer over. Bring them to your side by sharing your game plan.

5. Know your language

You don't want to walk into an audition with an instrument you're not familiar with. Likewise, walking into a coding interview with a language you're uncomfortable with is asking for trouble. Know your programming language. At this point, the syntax shouldn't be a hurdle; you should be an expert with the coding language of your choice. Did you know that interviewers can tell how good you are by looking at your first few lines of code? Building software is a collaborative effort; your code should be well-organized and readable. You don't have to write the perfect code, but it should capture the proper logical structure. Know your data structures and algorithms. You must be able to argue the reasoning behind your logic. Python is the best language for coding interviews. Find out why in this video.

6. Verify your solution

Once you finish coding the solution, the next step is verifying it. The best way to do this is by doing a code walkthrough. Come up with a reasonable set of test cases. Choose an example, and give the interviewer a visual presentation of how the variables change line by line. Remember to check the edge cases too. In case you discover a bug, correct it. You're not expected to write flawless code, but fixing your mistake is a positive signal.

7. Complexity Analysis

Contrary to what many think, time and space complexities are important; getting them wrong will raise red flags. Again, know your data structures and algorithms. What's the time complexity of quick sort? Binary search? What about adding an element at the end of an ArrayList? How about at the front of the list? Why are HashMaps efficient? Understand how each data structure works internally. Know what their operation complexities are.

8. Optimize

A working implementation might be acceptable depending on the company and the role you are applying for. However, some companies, like FAANG, expect their candidates to develop the most optimal solution. Again, a strong foundation in data structures and algorithms is the key here. Understand why some data structures work better than others in certain situations. For example, adding an element to the front of an ArrayList is linear; use a LinkedList instead. If the input is sorted, you should use binary search because it's logarithmic. Do you see how crucial data structures and algorithms are? A core foundation in DSA will crack the FAANG interview.

9. LeetCode

Guys, I didn't make this video to advocate the big techs' "malicious" practice of using an "irrelevant" method to evaluate their candidates. I made this video because this is just the way it is. I'm sorry to say this, but no matter what you say or think, companies are not gonna change their game rules. You are free to apply anywhere, but if you aim to eventually land at big tech, it's better to LeetCode early than late. Follow my tips on how to use LeetCode effectively for the best practice plan. If you have a US work authorization, you can also get live practice interviews and learn directly from the professionals with Pathrise. I used to work as a Pathrise mentor, so I know its program works. The first two weeks are free.

Final Thoughts

Alright. These are my nine tips on how to ace a coding interview. Let me know what you think in the comments below. Try Springboard if you're looking for an affordable online tech bootcamp with a job guarantee. I used to be a Springboard mentor too, and you can get a $1000 discount with my coupon code, PIRATEKING. Make sure to like and subscribe. I'll see you at the next one. Bye.

 
Previous
Previous

Coding languages I would learn (if I could start over)

Next
Next

Best Platforms to Learn Coding