In the last 5 years, I have given 20+ coding interviews.
Reflecting back, I have documented my learnings in 21 lessons that improved my problem solving skills significantly.
These will help you in your upcoming coding interviews.
Let's go! 🚀
Problem solving skill = Knowing toolbox of techniques + Practice of applying it in different situations
Understanding the problem is the most important step of problem solving.
Don’t rush into solving. Before that ask:
Can I simplify the problem?
Can I break the problem into easier problems?
When stuck on the problem. Be curious, not frustrated.
Spend some time thinking about more examples and edge cases of the problem.
Forget code first. Consider how a human can ‘systematically’ solve the problem.
It’s ok to temporarily ignore the difficult parts and approach them later.
Solving on whiteboard is 10x easier than keyboard.
Diving into code without planning will only give you stress.
Think of multiple solutions, before committing to one.
Start with brute-force solution and then fix the suboptimal parts.
Create step by step high level plan and validate if it leads you to desired solution.
Try simplifying the solution. Simpler solutions are easier to code.
If you are struggling with implementing your plan, write pseudo-code first.
Use pseudo-code as program comments and while coding translate each comment into code.
Focus on making a solution work before making any improvements.
Verify if your solution works for all possible scenarios and edge cases.
You only get better by solving lot of problems. Cliche for a reason.
For interviews, prioritize practicing most asked and frequently asked problems by the company.
Don’t stop at working solution. Learn other ways of solving the same problem.
Relax and see failure as feedback. It just tells you what NOT to do.
Hope you found these lessons helpful.
If you liked this post, follow me for more of these 🙂
Also, share ONE lesson from your failed programming interview👇
Top comments (4)
Thanks for reading Abhay!
Great article @codewithvoid
Glad you found it useful Kalyan 🙂