News for hackers. Stuff that matters.
Re:Things I was asked to do while job hunting by onion2k on Saturday April 10, 2021 @04:38PM (#26764930)
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.

Re:Things I was asked to do while job hunting by josephg on Saturday April 10, 2021 @04:46PM (#26764989)
Yeah; 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.