3 ms·
The data consists of 50k records. The fastest code in the post takes 3 seconds. Have many programmers completely lost the ability to know roughly how fast code
by petters 9y ago
The data consists of 50k records. The fastest code in the post takes 3 seconds.
Have many programmers completely lost the ability to know roughly how fast code "should" be?
- RipRap 9y agoAdditionally, how many programmers do you know who write code as efficiently as possible? Or even know how to write "Efficient Code"?
- Johnny_Brahms 9y agoWe use stupid, simple maths problems (like project Euler 1-30) when hiring for junior positions. We are not looking for someone to do the maths tricks that lets you solve most of the problems with pen and paper, but for someone that recognizes a 100x speed increase using memoization. You'd think people with some programming experience would be able to reason about how to speed up a simple brute force approach, but those parts of the hiring process usually weed out 75%, and I don't expect someone to give me a perfect solution. Heck, not even a working piece of code. Just being able to say "hmm, we could maybe cut half of the computation by just using the relevant parts of the alphabet" is all I want. Then we have people like my colleague that just wrote print(103) which was the correct answer. (He could also give several fast approaches to solving the problem, one which we hadn't thought about before).