DEV Community

Discussion on: 7 Effective Steps to Cracking the Code Interview

Collapse
 
fagnerbrack profile image
Fagner Brack • Edited

The whole post is showing a way to brute force an algorithm with an unnecessarily high mental cost. If you apply TDD instead of brute forcing your brain, you'll start testing the null cases instead of leaving it for later and use the following tests as tools to drive your thinking by using the transformation priority premise. For that it's better to have a computer, as you want to make sure your code is correct at all times.

It's like studying to apply for some work involving physics and having a test asking how much is 3*2/4+343-221/45^7-6 without allowing you to use a mere calculator or to show how to apply actual meaningful physics concepts instead of complex basic math