So you yourself has just given an example how easy it is to temporarily get good at "test-filling", by simply preparing for that.
The question is whether a given test measures anything relevant - did your friend become a better programmer for doing 6 weeks of leetcodes? E.g. what kind of experience did he gain about large code bases and how to handle those? Continuing your analogy, would you fly with a pilot who drilled on taking off a bunch of time, but never practised flying in a storm?
I'm not saying leetcodes or exams are useless, but Goodhart's Law apply.
The question is whether a given test measures anything relevant - did your friend become a better programmer for doing 6 weeks of leetcodes? E.g. what kind of experience did he gain about large code bases and how to handle those? Continuing your analogy, would you fly with a pilot who drilled on taking off a bunch of time, but never practised flying in a storm?
I'm not saying leetcodes or exams are useless, but Goodhart's Law apply.