The best advice I got on problem-solving from my senior developers: Spend more time thinking about the problem and less on the code. Make sure, before you even write a single line of code: - you clearly understand the problem at hand - you have an idea about the potential solutions - you have decided the best approach And then, begin to write your code. Writing bad code fast is the biggest trap you must avoid as a junior dev. You think you are executing fast, but actually, you’re making more problems for yourself in the future. Take the time to understand Take the time to ideate properly Then, be quick with the execution part.
"Make sure, before you even write a single line of code" Why do I see this advice so often for the last one week or so!! It's such a cliché and it's not really useful. > - you have decided the best approach WRONG. No solution is the best approach IF you're writing it for the first time. Okay, that maybe an exaggeration but it's largely true, like in 99.999% cases. "the best approach" comes after you have come up with "a working solution" and then you improve on it, iterating multiple times during a long a period of time, with multiple long breaks in between.
best ideas come to solve a problem is when, instead of running behind a problem with a stick and lay back and get a bit far from the problem or place.
You will never be able to "fully understand" the problem beforehand. Ever. This has been proven many times over many years over and over again. 90% of your understanding of the problem stems from trying to solve it, failing, and learning more about the problem from the failure. It's an iterative process that has been proven to work extremely well over many years.
Completely agree, the more we think the exact root cause of the problem and potential side effects, the less likely we will get regression bug and also will lead us to good quality code
Completely agree. Once you put the effort on thinking about the problem and decide an approach on how to solve it, writing code becomes just a formality.
Great advice :) , i found it really hard to get out of that "jumping to code without thinking " and then being stuck there forever..
This is exactly thing you need in today's world to crack google medium hard question in 45min. How was your interview at goggle?
Love this Karan! And here are 3 pieces of advice I received from my senior developers: - One function, one task. Period. - Don't just focus on writing code. Focus on writing code that is scalable and maintainable. - Think in terms of components. Create modular pieces of code like Lego blocks to assemble the solution. (This also takes care of 2nd point)
SDE 2 @Microsoft | Ex- Arcesium, Ninja Van, ISRO | NIT Puducherry | Building Highly Scalable Distributed Systems @ Azure Core Compute
6moThe same I was discussing with my juniors and students. The steps one should follow: 1. Understanding and gathering the requirements is very crucial. 2. Think of a solution that fits well in the system or works. 3. Figure out all dependencies and try to push them first to get them resolved. 4. Meanwhile have discussions with your seniors/team/tech leads and arrive at the final solution. 5. Start documenting the design document as well along the discussion (if applicable) 6. Code, Test, Review, and Merge 🙃