3 ms·
I honestly hate interview tests like this because you never want a developer to do this in their day to day job. Code needs to be clear and simple to be maintai
by onion2k 6y ago
I honestly hate interview tests like this because you never want a developer to do this in their day to day job. Code needs to be clear and simple to be maintainable, so anywhere a developer has done work in their head and just put in a magic number (eg const foo = 763; // I did the math in my head) you would always reject that in a PR and ask them to show where the number came from.
If anything being asked to do mental arthimatic in an interview should be a red flag that the company has a code base that could be full of horrible undocumented nonsense.
- josephg 6y agoYeah; or it’s a sign they just have terrible judgement. “What makes a good programmer? Programming is like math right? Let’s assess that!?” The trick for code readability is to always make the compiler do the math. const time_ms = 30 * 1000; This is much easier to read and maintain.
- deleted 6y ago[deleted]