DEV Community

Cover image for How to Ace Coding Interviews — 21 Problem Solving Lessons
Void⚡
Void⚡

Posted on

How to Ace Coding Interviews — 21 Problem Solving Lessons

Programming is less about learning syntax and more about problem solving.

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! 🚀

  1. Problem solving skill = Knowing toolbox of techniques + Practice of applying it in different situations

  2. Understanding the problem is the most important step of problem solving.

  3. Don’t rush into solving. Before that ask:
    Can I simplify the problem?
    Can I break the problem into easier problems?

  4. When stuck on the problem. Be curious, not frustrated.

  5. Spend some time thinking about more examples and edge cases of the problem.

  6. Forget code first. Consider how a human can ‘systematically’ solve the problem.

  7. It’s ok to temporarily ignore the difficult parts and approach them later.

  8. Solving on whiteboard is 10x easier than keyboard.

  9. Diving into code without planning will only give you stress.

  10. Think of multiple solutions, before committing to one.

  11. Start with brute-force solution and then fix the suboptimal parts.

  12. Create step by step high level plan and validate if it leads you to desired solution.

  13. Try simplifying the solution. Simpler solutions are easier to code.

  14. If you are struggling with implementing your plan, write pseudo-code first.

  15. Use pseudo-code as program comments and while coding translate each comment into code.

  16. Focus on making a solution work before making any improvements.

  17. Verify if your solution works for all possible scenarios and edge cases.

  18. You only get better by solving lot of problems. Cliche for a reason.

  19. For interviews, prioritize practicing most asked and frequently asked problems by the company.

  20. Don’t stop at working solution. Learn other ways of solving the same problem.

  21. Relax and see failure as feedback. It just tells you what NOT to do.

That's it!

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)

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
codewithvoid profile image
Void⚡

Thanks for reading Abhay!

Collapse
 
kumarkalyan profile image
Kumar Kalyan

Great article @codewithvoid

Collapse
 
codewithvoid profile image
Void⚡

Glad you found it useful Kalyan 🙂