Preparing for Technical Interviews: A Guide for Computer Science Graduates
Getting Started with LeetCode
LeetCode has numerous problems. It's impossible to solve all of them. It's also impossible for an interviewer to potentially ask you any question from the entire pool. That's why interview candidates and interviewers have created certain lists: LeetCode Blind 75, LeetCode Blind 150, etc. These lists contain problems (or similar ones) that candidates most frequently encounter in interviews. (With LeetCode premium, you can also access company-specific frequently asked problems.) Solving at least the LeetCode Blind 75 before an interview with a company will significantly benefit you.
NeetCode: Your Best Friend
We've narrowed down the number of questions. Should we start right away? You can if you want, but I'd like to mention another useful resource: NeetCode.
NeetCode offers a roadmap by categorizing the aforementioned lists based on Data Structures and arranging related problems according to their difficulty levels. Additionally, since they're a LeetCode expert, solutions to all problems in the roadmap are available on their YouTube channel.
The Learning Process
First, let me say that if you're new to problem-solving like me, it's completely normal not to understand or solve problems at first glance. Solving LeetCode problems is similar to solving math problems. As you solve more problems, you start recognizing patterns between questions, making it easier to solve subsequent problems.
This is exactly what NeetCode's roadmap does. It categorizes problems by topic and arranges them by difficulty. So when you solve an "Easy" Array problem, you're more likely to solve "Medium" Array problems because they're related.
For instance, when I first encountered the "Two Sum" problem, I tried solving it using brute force immediately. Although I had learned about HashMaps in class, I didn't know where to use them. However, after studying and understanding the solution to "Two Sum," I was able to solve "Contains Duplicate" without looking at the solution because both shared HashMaps in their solutions.
If you refresh your knowledge of data structures before starting problem-solving, your journey will be smoother.
My Recommended Approach
Based on the articles I've read and discussions with professionals, here's my approach:
- Write the problem on paper.
- Try solving the problem on paper for 1-2 days. Write down everything that comes to mind.
- If you can't come up with a solution after trying yourself, watch NeetCode's solution.
- Write down NeetCode's solution (the logic, not the code) on paper and try to understand it.
- If you think you understand the solution, try writing the code yourself. If you truly understand it, you should be able to write the code :)
- We've submitted the solution, but we're not done. Study solutions with better performance rates than yours. You can access these on LeetCode. Try to understand their thinking process. Note down these solutions too.
- We don't just solve a problem and shelve it. We revisit and repeat problems over time. If you've learned it properly, solving the same problem again should only take about 5 minutes.
I spend maximum 3 days on one problem, dedicating 1 hour per day. You can adjust the time according to your needs. However, the more problems you solve, the better, of course.
Tracking Progress
I track all these steps in a table I created in Notion. You can create a similar table to track your progress. This way, you archive your notes and solutions. It also makes it easier to implement the practice of revisiting problems.
System Design Interviews
While I haven't encountered many system design interviews in entry-level positions in Turkey, globally, you usually participate in a System Design Interview after the algorithmic interview. I haven't researched much in this area because it's not common for entry-level positions in Turkey. Therefore, I plan to prepare for it when I need it in the future.
If you want to prepare yourself in this area, here's an excellent resource: System Design Primer