3 ms·
I suffer from similar issues. Something that really works against me in the standard coding interviews. Some ways I try to mitigate some of those issues at work
by addicted 8y ago
I suffer from similar issues. Something that really works against me in the standard coding interviews. Some ways I try to mitigate some of those issues at work are:
1) Peer/senior code reviews. I try and get code reviews done by other folks. This helps with identifying something easy that I may be missing. Usually, once I already have a solution to a problem, I find it hard to revisit it without that solution overwhelming my approach, unless a bit of time has passed. Getting some fresh eyes to look at it helps. Also, explaining the solution to someone else often helps me identify issues with my solution during the process of explaining it to someone else itsel.
2) Practice and experience. I think for the most part intuition is simply the result of experience and practice.
3) Learning different programming paradigms. Something that has helped me more than anything else I think is learning programming languages that cover different paradigms. I’ve never coded anything useful in Haskell, but just the process of solving basic programming problems in Haskell, with its strong functional approach, helps me identify issues with the proceduaral/OOP code which I do write to solve useful problems. I think it allows me to approach each problem from multiple perspectives so even if I don’t have certain Haskell features available to me, it makes it easier to recognize that this may be an issue I need to address in my OOP code (for example, the Haskell compiler when pattern matching requires all possibilities to be addressed. Awareness of this fact means that anytime I’m writing conditionals checking the input I’m much more aware of the fact that I need to also handle the else condition, something that most non-functional programming languages don’t hsually require in their conditional constructs).
4) Related to #3m opting for better solutions wherever possible. I always try and opt for expressions over statements. I try to avoid state change as much as possible. I try and minimize side effects in functions, and try to constrain them in specific areas of code, etc.
5) Formal CS study. I don’t have a CS background, but studying formal CS in my free time has helped a lot. Getting better at data structures, algorithms, formal verification, etc, has helped develop my intuitions even if I don’t sctually use those data structures and formal verification methods in practice.