Instead of grinding LeetCode, learn mathematics, bro
It doesn’t matter how many times you grind LeetCode challenges, for instance, those related to finding the shortest routes or some variation of the Dijkstra algorithm; if you don’t have any deep mathematical knowledge of the graph theory upon which it is based, you are painfully wasting your time. It is simple to see; just a slightly different formulation of the problem would be enough to expose you in the most painful way.
Yup, we all know that the tech industry is turned on by those LeetCode challenges and uses them in technical interviews. The result is a huge amount of false-positive candidates with a good memory for learning even a phone book but totally clueless when facing real problems where most toy LeetCode algorithms must be greatly tweaked and extended, or fail miserably.
22 comments
[ 3.2 ms ] story [ 48.9 ms ] threadThe low hanging fruit has been picked.
Why don't we put all that solving these unsolved mathematical problems instead of these already solved leetcode puzzles that have tweaked variation and that the employers don't even use themselves.
But as far as I am I don't believe there is any math in algorithms such as bubble sort.
Expressed as a mathematical expression. Given a problem that arrives at timsort with galloping mode as the solution, how would you hear the initial problem, and then express the solution as timsort in order theory?
It feels like it would be awesome to do but also doesn’t feel like the logic of the algorithm would quickly be found simply by knowing order theory.
I've seen otherwise good programmers write loops over elaborate data structures to deal with what are effectively composed matrix math operations. Unless you're in a language that has first-class arrays (APL, R, Matlab), it's not immediately obvious how all those unknowns could be plugged into a system of equations and solved in a single op.
In a sense, math is the exact opposite of leetcode. Math is theoretical but can be turned to great advantage by a skilled programmer. Leetcode is entirely concrete (memorizable, not grounded in any theory) yet pragmatically useless for solving novel engineering problems.
So I agree, we need more engineers who understand dot products and eigenvalues, not algorithmic code golfing.
That is assuming your company actually wants to hire engineers - I suspect the purpose of leetcode is specifically to weed out people who are likely to ask "Um why would I write this leetcode algorithm when I could solve it faster by multiplying two matrices in BLAS?". We wouldn't want our engineers to apply critical thinking now would we?
PS: My point is, Engineering should be seen a serious discipline on its own, which draws from math, science, psychology, management and a dozen other fields. No single aspect (either math or leetcode) should be emphasized as a panacea to Engineering mastery. There's no shortcut.
The way you prepare is important. A focused approach yields more learning.
Math is typically taught in a focused approach that builds on itself.
Random leetcode grinding does not build on itself.
But non random leetcode grind where you focus on specific topics can yield an underlying intuition similar to the one you would gain from a math first background.
I would argue that in the vast majority of cases, this approach has a better ROI of your time.
Interviewers seeking to "expose you" with math tricks are probably not people you want to be working with.
What people don't understand is they'll have a higher chance of getting hired if they do this.
If you wanna get (and keep) a developer job, learn development. Leetcode is just an example, learn algorithms and data structures and patterns and languages. Math is literally the least useful thing to learn in 99.98% of real programming jobs.
This skill isn't needed anymore because fries are included in most meals.
The sort of engineer who can define the requirements of a project and execute based on those requirements is much more valuable to me than a algorithmic prodigy. Seniority is not defined by the mathematical complexity of the problems you solve. Focus instead on design patterns and best practices, scalability and maintainability concerns, mentoring of more junior teammates and the buildout of tooling that helps ease the overhead of working with the codebases under your purview and the development, deployment and testing of that code.
We spent the entire hour discussing back and forth all of the challenges not just for him but the team in great detail and how they went about doing the upgrade. I'm glad the interview didn't go as planned because he's still here and he's great.
Doing leetcode in interviews is like if the NBA drafted players based on trick shots.
Frankly, I think you've given horrendous advice. Not just bad, but completely counterproductive.