A lot of folks who want to prepare for their coding interviews and take a shot at FAANGs or other top tech companies make the same critical mistake. They start with a list like Blind-75 or Neetcode-150, hoping to memorize solutions and patterns. Unfortunately, 90% of people get frustrated while working on these lists and give up on their dreams. The remaining 10% may go through the list by checking every other solution, but still end up frustrated because they fail when they encounter a problem they haven’t seen before.
Build Your APSS
The first thing you need to do is build your Algorithmic Problem-Solving Skills (APSS). This is a skill set that can be trained and doesn't require deep knowledge of algorithms and data structures beyond the basic constructs such as loops, arrays, conditionals, and perhaps hash tables. If your APSS are strong, it's easy to learn new algorithms or data structures as needed. In fact, learning a new algorithm will be similar to working on a new APSS-strengthening exercise. On the other hand, even if you've memorized all the algorithms and data structures, you may struggle to solve a random problem thrown at you during your interview if your APSS are weak.
If this all sounds too cryptic, here is an example of an APSS-strengthening problem that doesn’t require any advanced knowledge:
Example: Print a Spiral Matrix
Write a function that takes an integer n and prints an n x n matrix in spiral order, starting with the number 1 in the top-left corner and ending with n² in the center. The matrix should be filled in a clockwise spiral, incrementing each value by 1 as you go.
For n = 5, the output would be:
1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9
As you can see in this problem, there is no advanced algorithm involved. All you need to solve this problem are loops and an array. If your APSS are in shape, you'll be able to devise a solution by carefully simulating the spiral traversal and filling in the numbers accordingly.
Why Focus on APSS?
Foundation for Complex Problems and Algorithms: Strong problem-solving skills are the foundation upon which you can build knowledge of advanced algorithms and data structures.
Adaptability: Interviews often present unique problems. Relying solely on memorized solutions won't help if you can't adapt your thinking to new scenarios.
Confidence: Developing APSS boosts your confidence in tackling unfamiliar problems, reducing anxiety during interviews.
How to Build Stronger APSS
APSS exercises vary depending on your current level. In general, APSS problems don’t require any more knowledge than you already have. These are stretch exercises that make you more agile with your current knowledge.
For beginners, that usually means problems solvable with just arrays, loops and conditionals. You can later add hash tables and recursion to that list. I have shared a list of APSS-building problems for beginners here:
For more advanced learners, you will naturally strengthen your APSS when solving more and more problems from Leetcode or elsewhere.
Other Problems to Test Your APSS
Here are a few other fun problems that should be suitable for any level:
1. Print a Diamond Pattern
Given a positive odd integer n, print a diamond pattern made of asterisks (*) where the widest point is n asterisks wide.
Input: n = 5
Output:
*
***
*****
***
*
2. Increasing Staircase Pattern
Given an integer n, print a right-justified staircase of numbers that increases with each step. The last row should contain the numbers from 1 to n.
For n = 5
, the output would be:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
3. Rearrange Array to Move All Zeros to the End
Problem Statement:
Given a 1D array of integers, rearrange it in-place so that all zeroes are moved to the end while maintaining the order of non-zero elements.
Example: For [0, 1, 0, 3, 12]
, the output should be [1, 3, 12, 0, 0]
.
Next Steps
Only after strengthening your APSS do I recommend gradually moving on to classic algorithms and data structures and precompiled lists. With a solid foundation, you'll find it easier to understand and implement more complex concepts.
Remember, it's not about how many problems you've memorized but how well you can apply fundamental concepts to solve new problems.
Stay curious and happy coding!
Nurbo
I'm Accepting New Mentees!
Are you looking for a mentor to guide you and keep you accountable on your tech interview preparation journey? I'm here to help.
I'm opening up a few spots for motivated individuals who would benefit from weekly one-on-one mentorship sessions. Together, we'll:
Develop a personalized study plan
Master problem-solving techniques
Build confidence for your interviews
Ready to take your preparation to the next level? Book a free introductory session with me here.